Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/service.py
diff options
context:
space:
mode:
Diffstat (limited to 'tutorius/service.py')
-rw-r--r--tutorius/service.py17
1 files changed, 17 insertions, 0 deletions
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()