Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-04-09 19:07:40 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-04-09 19:07:40 (GMT)
commit3eeec9bf07c4d8c5d61b15691ec0613fa0123cda (patch)
tree33a2b1ca297fc6ba30138fba35f77d8ecb25054e /shell
parentbc083dae5a601d9ce099496096330691efc46447 (diff)
Remove references to obsolete p2p.Stream classes
Diffstat (limited to 'shell')
-rw-r--r--shell/model/Owner.py57
-rw-r--r--shell/view/ActivityHost.py2
2 files changed, 0 insertions, 59 deletions
diff --git a/shell/model/Owner.py b/shell/model/Owner.py
index bbc3075..ddee4a9 100644
--- a/shell/model/Owner.py
+++ b/shell/model/Owner.py
@@ -24,13 +24,10 @@ import dbus
from sugar import env
from sugar import profile
-from sugar.p2p import Stream
from sugar.presence import presenceservice
from sugar import util
from model.Invites import Invites
-PRESENCE_SERVICE_TYPE = "_presence_olpc._tcp"
-
class ShellOwner(gobject.GObject):
__gtype_name__ = "ShellOwner"
@@ -72,67 +69,13 @@ class ShellOwner(gobject.GObject):
self._invites = Invites()
- self._last_activity_update = time.time()
- self._pending_activity_update_timer = None
- self._pending_activity_update = None
- self._current_activity = None
-
def get_invites(self):
return self._invites
def get_name(self):
return self._nick
- def announce(self):
- # Create and announce our presence
- color = profile.get_color()
- props = {'color': color.to_string(), 'icon-hash': self._icon_hash}
- self._service = self._pservice.register_service(self._nick,
- PRESENCE_SERVICE_TYPE, properties=props)
- #logging.debug("Owner '%s' using port %d" % (self._nick, self._service.get_port()))
-
- #self._icon_stream = Stream.Stream.new_from_service(self._service)
- #self._icon_stream.register_reader_handler(self._handle_buddy_icon_request, "get_buddy_icon")
- #self._icon_stream.register_reader_handler(self._handle_invite, "invite")
-
- def _handle_buddy_icon_request(self):
- """XMLRPC method, return the owner's icon encoded with base64."""
- if self._icon:
- return base64.b64encode(self._icon)
- return ""
-
def _handle_invite(self, issuer, bundle_id, activity_id):
"""XMLRPC method, called when the owner is invited to an activity."""
self._invites.add_invite(issuer, bundle_id, activity_id)
return ''
-
- def __update_advertised_current_activity_cb(self):
- self._last_activity_update = time.time()
- self._pending_activity_update_timer = None
- if self._pending_activity_update:
- self.emit('current-activity-changed', self._pending_activity_update)
- logging.debug("*** Updating current activity to %s" % self._pending_activity_update)
- self._service.set_published_value('curact', dbus.String(self._pending_activity_update))
- return False
-
- def set_current_activity(self, activity_id):
- """Update our presence service with the latest activity, but no
- more frequently than every 30 seconds"""
- self._pending_activity_update = activity_id
- # If there's no pending update, we must not have updated it in the
- # last 30 seconds (except for the initial update, hence we also check
- # for the last update)
- if not self._pending_activity_update_timer or time.time() - self._last_activity_update > 30:
- self.__update_advertised_current_activity_cb()
- return
-
- # If we have a pending update already, we have nothing left to do
- if self._pending_activity_update_timer:
- return
-
- # Otherwise, we start a timer to update the activity at the next
- # interval, which should be 30 seconds from the last update, or if that
- # is in the past already, then now
- next = 30 - max(30, time.time() - self._last_activity_update)
- self._pending_activity_update_timer = gobject.timeout_add(next * 1000,
- self.__update_advertised_current_activity_cb)
diff --git a/shell/view/ActivityHost.py b/shell/view/ActivityHost.py
index 4a212a1..d0bb663 100644
--- a/shell/view/ActivityHost.py
+++ b/shell/view/ActivityHost.py
@@ -17,8 +17,6 @@
import gtk
import dbus
-from sugar.p2p import Stream
-from sugar.p2p import network
import OverlayWindow
class ActivityChatWindow(gtk.Window):