[Pkg-sugar-commit] [sugar] 01/05: Add a dbus method to provide information about a bundle path

Jonas Smedegaard dr at jones.dk
Tue Jul 7 02:16:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository sugar.

commit 78caed990480d7e2607a0a0d7f81ad09c6f88e22
Author: Gonzalo Odiard <godiard at gmail.com>
Date:   Thu Jul 2 16:15:08 2015 -0300

    Add a dbus method to provide information about a bundle path
    
    This is used in the toolkit to provide the get_bundle functionality.
---
 src/jarabe/journal/journalactivity.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
index 917845a..18e6ef7 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -44,7 +44,7 @@ from jarabe.journal.objectchooser import ObjectChooser
 from jarabe.journal.modalalert import ModalAlert
 from jarabe.journal import model
 from jarabe.journal.journalwindow import JournalWindow
-from jarabe.journal.bundlelauncher import launch_bundle
+from jarabe.journal.bundlelauncher import launch_bundle, get_bundle
 
 from jarabe.model import session
 
@@ -71,6 +71,27 @@ class JournalActivityDBusService(dbus.service.Object):
         dbus.service.Object.__init__(self, bus_name, J_DBUS_PATH)
 
     @dbus.service.method(J_DBUS_INTERFACE, in_signature='ss',
+                         out_signature='s')
+    def GetBundlePath(self, bundle_id, object_id):
+        '''
+        Get bundle path given object_id and/or bundle_id.
+        This is used in the toolkit to provide the bundle information
+        to other activities using activity.get_bundle()
+        '''
+        # Convert dbus empty strings to None, is the only way to pass
+        # optional parameters with dbus.
+        if bundle_id == "":
+            bundle_id = None
+        if object_id == "":
+            object_id = None
+
+        bundle = get_bundle(bundle_id, object_id)
+        if bundle is None:
+            return ''
+        else:
+            return bundle.get_path()
+
+    @dbus.service.method(J_DBUS_INTERFACE, in_signature='ss',
                          out_signature='b')
     def LaunchBundle(self, bundle_id, object_id):
         '''

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar.git



More information about the pkg-sugar-commit mailing list