Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius
diff options
context:
space:
mode:
authorerick <erick@sugar-dev-erick.(none)>2009-10-01 21:17:52 (GMT)
committer erick <erick@sugar-dev-erick.(none)>2009-10-01 21:18:34 (GMT)
commit5000f3e0278cda91a82da8146918bf0ff6938daf (patch)
tree7c68cc93eeee2bbd48e40770115a5f53b03e8dad /tutorius
parent8883669cc67299a3c80da36fbe02ad63d2fc6d1f (diff)
Added a proxy for the service
Diffstat (limited to 'tutorius')
-rw-r--r--tutorius/engine.py2
-rw-r--r--tutorius/service.py17
2 files changed, 17 insertions, 2 deletions
diff --git a/tutorius/engine.py b/tutorius/engine.py
index 396a9e1..192bdde 100644
--- a/tutorius/engine.py
+++ b/tutorius/engine.py
@@ -19,7 +19,6 @@ class Engine:
"""
if self._bm = None:
self._bm = addon.create("BubbleMessage")
-
self._bm.position = (300,300)
self._bm.message = "Tutorial Started"
@@ -30,7 +29,6 @@ class Engine:
""" Stop the current tutorial
"""
self._probe.uninstall(self._bm)
- self._bm = None
def pause(self):
""" Interrupt the current tutorial and save its state in the journal
diff --git a/tutorius/service.py b/tutorius/service.py
index 02c93b1..b75ec13 100644
--- a/tutorius/service.py
+++ b/tutorius/service.py
@@ -45,3 +45,20 @@ class Service(dbus.service.Object):
""" Interrupt the current tutorial and save its state in the journal
"""
self._engine.pause()
+
+class ServiceProxy:
+ """ Proxy to connect to the Service object, abstracting the DBus interface"""
+
+ def __init__(self):
+ bus = dbus.SessionBus()
+ self._object = bus.get_object(_DBUS_SERVICE,_DBUS_PATH)
+ self._service = dbus.Interface(self._object, _DBUS_SERVICE_IFACE)
+
+ def launch(self, tutorialID):
+ self._service.launch(tutorialID)
+
+ def stop(self):
+ self._service.stop()
+
+ def pause(self):
+ self._service.pause()