Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/sugar-activity34
1 files changed, 17 insertions, 17 deletions
diff --git a/bin/sugar-activity b/bin/sugar-activity
index ed6c7df..2e10922 100755
--- a/bin/sugar-activity
+++ b/bin/sugar-activity
@@ -94,17 +94,6 @@ if len(args) == 0:
bundle_path = os.environ['SUGAR_BUNDLE_PATH']
sys.path.append(bundle_path)
-bundle = ActivityBundle(bundle_path)
-
-gettext.bindtextdomain(bundle.get_bundle_id(),
- bundle.get_locale_path())
-gettext.textdomain(bundle.get_bundle_id())
-
-gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path())
-
-_sugarbaseext.set_prgname(bundle.get_bundle_id())
-_sugarbaseext.set_application_name(bundle.get_name())
-
splitted_module = args[0].rsplit('.', 1)
module_name = splitted_module[0]
class_name = splitted_module[1]
@@ -112,10 +101,8 @@ class_name = splitted_module[1]
module = __import__(module_name)
for comp in module_name.split('.')[1:]:
module = getattr(module, comp)
- if hasattr(module, 'start'):
- module.start()
-constructor = getattr(module, class_name)
+constructor = getattr(module, class_name)
handle = activityhandle.ActivityHandle(
activity_id=options.activity_id,
object_id=options.object_id, uri=options.uri)
@@ -123,9 +110,8 @@ handle = activityhandle.ActivityHandle(
if options.single_process is True:
bus = dbus.SessionBus()
- bundle_id = bundle.get_bundle_id()
- service_name = get_single_process_name(bundle_id)
- service_path = get_single_process_path(bundle_id)
+ service_name = get_single_process_name(options.bundle_id)
+ service_path = get_single_process_path(options.bundle_id)
bus_object = bus.get_object(
'org.freedesktop.DBus', '/org/freedesktop/DBus')
@@ -144,6 +130,20 @@ if options.single_process is True:
print 'Created %s in a single process.' % service_name
sys.exit(0)
+if hasattr(module, 'start'):
+ module.start()
+
+bundle = ActivityBundle(bundle_path)
+
+os.environ['SUGAR_BUNDLE_ID'] = bundle.get_bundle_id()
+os.environ['SUGAR_BUNDLE_NAME'] = bundle.get_name()
+
+gettext.bindtextdomain(bundle.get_bundle_id(),
+ bundle.get_locale_path())
+gettext.textdomain(bundle.get_bundle_id())
+
+gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path())
+
create_activity_instance(constructor, handle)
gtk.main()