Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ActivityRegistry.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-07-08 09:56:13 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-08 09:56:13 (GMT)
commit0cbe559dbf6a5a324828a94e28fe06e9fbb26f9c (patch)
treefd4dd3ff89f8d765977df145d76dbdff460c6323 /shell/ActivityRegistry.py
parent2999244b54848d989894c19664a3b0da2454d469 (diff)
Forgot to add these
Diffstat (limited to 'shell/ActivityRegistry.py')
-rw-r--r--shell/ActivityRegistry.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/shell/ActivityRegistry.py b/shell/ActivityRegistry.py
new file mode 100644
index 0000000..2f40640
--- /dev/null
+++ b/shell/ActivityRegistry.py
@@ -0,0 +1,30 @@
+import dbus
+
+class ActivityInfo:
+ def __init__(self, name, title):
+ self._name = name
+ self._title = title
+
+ def get_name(self):
+ return self._name
+
+ def get_title(self):
+ return self._title
+
+class ActivityRegistry(dbus.service.Object):
+ """Dbus service that tracks the available activities"""
+
+ def __init__(self):
+ self._activities = []
+
+ bus = dbus.SessionBus()
+ bus_name = dbus.service.BusName('com.redhat.Sugar.ActivityRegistry', bus = bus)
+ dbus.service.Object.__init__(self, bus_name, '/com/redhat/Sugar/ActivityRegistry')
+
+ @dbus.service.method("com.redhat.Sugar.ActivityRegistry")
+ def add(self, name, title):
+ self._activities.append(ActivityInfo(name, title))
+
+ @dbus.service.method("com.redhat.Sugar.ActivityRegistry")
+ def list_activities(self):
+ return self._activities