Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/activity
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-06-22 14:31:21 (GMT)
committer Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-08-20 13:33:52 (GMT)
commit98cc77f1fb35ae0c0e44a27dc389248b8024bba7 (patch)
treee91674e18a1f142069f51453a4708f7f6b2c687a /src/sugar/activity
parentd6da506dfdd8dbfa2e6baf145d4bb62dbb5b73cc (diff)
Replace enough of the old PS so we can join an activity instance on the network.
* src/sugar/activity/activity.py: Get the shared activity wrapper from sugar.presence. * src/sugar/activity/activityfactory.py: Disable checking in the PS for activity_id duplicates. * src/sugar/presence/activity.py: Remove the PS dependency and query Telepathy directly. Implemented enough to join an activity. * src/sugar/presence/buddy.py: Remove the PS dependency and query Telepathy directly. Implemented enough to join an activity. Added an Owner subclass of Buddy() * src/sugar/presence/presenceservice.py: Remove the PS dependency and query Telepathy directly. Implemented enough to join an activity. * src/sugar/presence/util.py: Add ConnectionManager for discovering and tracking connections.
Diffstat (limited to 'src/sugar/activity')
-rw-r--r--src/sugar/activity/activity.py7
-rw-r--r--src/sugar/activity/activityfactory.py3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
index 0e2ecc5..20c9c7d 100644
--- a/src/sugar/activity/activity.py
+++ b/src/sugar/activity/activity.py
@@ -70,6 +70,7 @@ from sugar.graphics.alert import Alert
from sugar.graphics.icon import Icon
from sugar.datastore import datastore
from sugar.session import XSMPClient
+from sugar.presence import presenceservice
from sugar import wm
# support deprecated imports
@@ -266,7 +267,6 @@ class Activity(Window, gtk.Container):
self._active = False
self._activity_id = handle.activity_id
- self._pservice = presenceservice.get_instance()
self.shared_activity = None
self._share_id = None
self._join_id = None
@@ -302,8 +302,9 @@ class Activity(Window, gtk.Container):
share_scope = self._jobject.metadata['share-scope']
# handle activity share/join
- mesh_instance = self._pservice.get_activity(self._activity_id,
- warn_if_none=False)
+ pservice = presenceservice.get_instance()
+ mesh_instance = pservice.get_activity(self._activity_id,
+ warn_if_none=False)
logging.debug("*** Act %s, mesh instance %r, scope %s",
self._activity_id, mesh_instance, share_scope)
if mesh_instance is not None:
diff --git a/src/sugar/activity/activityfactory.py b/src/sugar/activity/activityfactory.py
index 6b4ba32..0dd3793 100644
--- a/src/sugar/activity/activityfactory.py
+++ b/src/sugar/activity/activityfactory.py
@@ -75,11 +75,14 @@ def create_activity_id():
# check through network activities
found = False
+ logging.info('KILL_PS check the activity_id is not used in the network')
+ """
activities = pservice.get_activities()
for act in activities:
if act_id == act.props.id:
found = True
break
+ """
if not found:
return act_id
raise RuntimeError("Cannot generate unique activity id.")