Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/presence
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2006-06-23 02:42:35 (GMT)
committer Dan Williams <dcbw@redhat.com>2006-06-23 02:42:35 (GMT)
commit4511d13fb50f9f9ebb0d8115c662950422baa8dc (patch)
tree381c28d790563e0eac7f2b97e954dd8a52ee222e /sugar/presence
parentf2ef2a68477819f8337eb2c421127f2c719596d1 (diff)
parentd57c94970fc87e3b8b16b831348b69a404474e93 (diff)
Merge branch 'master' of git+ssh://dcbw@crank.laptop.org/git/sugar
Diffstat (limited to 'sugar/presence')
-rw-r--r--sugar/presence/PresenceService.py7
-rw-r--r--sugar/presence/Service.py19
2 files changed, 15 insertions, 11 deletions
diff --git a/sugar/presence/PresenceService.py b/sugar/presence/PresenceService.py
index 9599025..e6345cb 100644
--- a/sugar/presence/PresenceService.py
+++ b/sugar/presence/PresenceService.py
@@ -90,10 +90,9 @@ class PresenceService(gobject.GObject):
return PresenceService.__instance
get_instance = staticmethod(get_instance)
- def __init__(self, debug=True):
+ def __init__(self):
gobject.GObject.__init__(self)
- self._debug = debug
self._lock = threading.Lock()
self._started = False
@@ -158,9 +157,6 @@ class PresenceService(gobject.GObject):
db = dbus.Interface(self._bus.get_object(avahi.DBUS_NAME, domain_browser), avahi.DBUS_INTERFACE_DOMAIN_BROWSER)
db.connect_to_signal('ItemNew', self._new_domain_cb_glue)
- def set_debug(self, debug):
- self._debug = debug
-
def get_owner(self):
"""Return the owner of this machine/instance, if we've recognized them yet."""
return self._owner
@@ -634,7 +630,6 @@ def main():
import pygtk, gtk
global ps
ps = PresenceService.get_instance()
- ps.set_debug(True)
ps.start()
gobject.timeout_add(4000, runTests)
gtk.main()
diff --git a/sugar/presence/Service.py b/sugar/presence/Service.py
index 56246bb..c82d019 100644
--- a/sugar/presence/Service.py
+++ b/sugar/presence/Service.py
@@ -69,9 +69,6 @@ def deserialize(sdict):
stype = sdict['stype']
if type(stype) == type(u""):
stype = stype.encode()
- activity_id = sdict['activity_id']
- if type(activity_id) == type(u""):
- activity_id = activity_id.encode()
domain = sdict['domain']
if type(domain) == type(u""):
domain = domain.encode()
@@ -87,7 +84,18 @@ def deserialize(sdict):
address = address.encode()
except KeyError:
pass
- name = compose_service_name(name, activity_id)
+
+ activity_id = None
+ try:
+ activity_id = sdict['activity_id']
+ if type(activity_id) == type(u""):
+ activity_id = activity_id.encode()
+ except KeyError:
+ pass
+
+ if activity_id is not None:
+ name = compose_service_name(name, activity_id)
+
return Service(name, stype, domain, address=address,
port=port, properties=properties)
@@ -152,7 +160,8 @@ class Service(object):
else:
sdict['name'] = dbus.Variant(self._name)
sdict['stype'] = dbus.Variant(self._stype)
- sdict['activity_id'] = dbus.Variant(self._activity_id)
+ if self._activity_id:
+ sdict['activity_id'] = dbus.Variant(self._activity_id)
sdict['domain'] = dbus.Variant(self._domain)
if self._address:
sdict['address'] = dbus.Variant(self._address)