diff options
author | Morgan Collett <morgan.collett@gmail.com> | 2008-06-13 13:38:57 (GMT) |
---|---|---|
committer | Morgan Collett <morgan.collett@gmail.com> | 2008-06-13 14:59:34 (GMT) |
commit | 4a04ea9e04b9d0b959abd2b0adb59f1b15ecf75d (patch) | |
tree | 2e6f74e17d47cb30f5dfb9acf502ed9376a180af /src/model | |
parent | 13e586794c0b1bc8af7b139e487eed8e0392f804 (diff) |
#6298: Cleanups from review
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/Invites.py | 20 | ||||
-rw-r--r-- | src/model/Owner.py | 3 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/model/Invites.py b/src/model/Invites.py index 0f2c050..8bcffd2 100644 --- a/src/model/Invites.py +++ b/src/model/Invites.py @@ -20,11 +20,12 @@ from sugar.presence import presenceservice class BaseInvite: """Invitation to shared activity or private 1-1 Telepathy channel""" - def __init__(self): - self._activity_id = None + def __init__(self, bundle_id): + """init for BaseInvite. - def get_activity_id(self): - return self._activity_id + bundle_id: string, e.g. 'org.laptop.Chat' + """ + self._bundle_id = bundle_id def get_bundle_id(self): return self._bundle_id @@ -33,8 +34,11 @@ class BaseInvite: class ActivityInvite(BaseInvite): """Invitation to a shared activity.""" def __init__(self, bundle_id, activity_id): + BaseInvite.__init__(self, bundle_id) self._activity_id = activity_id - self._bundle_id = bundle_id + + def get_activity_id(self): + return self._activity_id class PrivateInvite(BaseInvite): @@ -48,12 +52,8 @@ class PrivateInvite(BaseInvite): bundle_id: string, e.g. 'org.laptop.Chat' private_channel: string containing simplejson dump of Telepathy bus, connection and channel - - Note: self_activity_id is set to None to differentiate between - PrivateInvites and ActivityInvites """ - self._activity_id = None - self._bundle_id = bundle_id + BaseInvite.__init__(self, bundle_id) self._private_channel = private_channel def get_private_channel(self): diff --git a/src/model/Owner.py b/src/model/Owner.py index 0132425..934a8fc 100644 --- a/src/model/Owner.py +++ b/src/model/Owner.py @@ -97,8 +97,7 @@ class ShellOwner(gobject.GObject): bundle_id = 'org.laptop.Chat' else: bundle_id = 'org.laptop.VideoChat' - tp_channel = simplejson.dumps([str(bus_name), str(connection), - str(channel)]) + tp_channel = simplejson.dumps([bus_name, connection, channel]) self._invites.add_private_invite(tp_channel, bundle_id) def _activity_disappeared_cb(self, pservice, activity): |