Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpgritti@gmail.com>2008-10-06 14:21:40 (GMT)
committer Marco Pesenti Gritti <mpgritti@gmail.com>2008-10-06 14:21:40 (GMT)
commitb36db6599ed59412ce77c8ed4fb1dea782877a62 (patch)
tree8f48c66568cad7e76c900e99714301007ab4613c /bin
parent1d744efc2916b47e36c79eed9f2fc0d9bbeece0e (diff)
Get sugar-launch back to work.
Diffstat (limited to 'bin')
-rw-r--r--bin/sugar-launch17
1 files changed, 10 insertions, 7 deletions
diff --git a/bin/sugar-launch b/bin/sugar-launch
index 7765ff1..68fe613 100644
--- a/bin/sugar-launch
+++ b/bin/sugar-launch
@@ -18,10 +18,11 @@
import os
import sys
+import dbus
from optparse import OptionParser
from sugar.activity import activityfactory
-from sugar.activity.registry import get_registry
+from sugar.bundle.activitybundle import ActivityBundle
usage = "usage: %prog [options] activity"
parser = OptionParser(usage)
@@ -30,15 +31,17 @@ parser.add_option("-d", "--debug", action="store_true", dest="debug",
(options, args) = parser.parse_args()
if len(args) == 0:
- print 'You need to specify the activity name or part of it.'
+ print 'You need to specify the activity bundle_id.'
sys.exit(1)
-registry = get_registry()
-activities = registry.find_activity(args[0])
-if len(activities) == 0:
- print 'Activity not found.'
+bus = dbus.SessionBus()
+proxy = bus.get_object('org.laptop.Shell', '/org/laptop/Shell')
+path = dbus.Interface(proxy, 'org.laptop.Shell').GetBundlePath(args[0])
+if not path:
+ print 'Cannot find %s bundle.' % args[0]
+ sys.exit(1)
-activity = activities[0]
+activity = ActivityBundle(path)
cmd_args = activityfactory.get_command(activity)
def _which(exec_file):