diff options
author | Simon Schampijer <simon@schampijer.de> | 2007-09-03 21:28:59 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2007-09-03 21:28:59 (GMT) |
commit | 4aace42d6d19e928daa666c5264203eb525f0b96 (patch) | |
tree | 2e26e78a403be338ad789628d77ae938dfca3eed /sugar/activity | |
parent | 6c43e80c452d27947fb141477a02204c7f9bdf02 (diff) | |
parent | b104f1e11ebb711869dbe55a374c96f7b2cd0a5f (diff) |
Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
Diffstat (limited to 'sugar/activity')
-rw-r--r-- | sugar/activity/activityfactoryservice.py | 2 | ||||
-rw-r--r-- | sugar/activity/bundle.py | 27 |
2 files changed, 16 insertions, 13 deletions
diff --git a/sugar/activity/activityfactoryservice.py b/sugar/activity/activityfactoryservice.py index 63265a1..682abaa 100644 --- a/sugar/activity/activityfactoryservice.py +++ b/sugar/activity/activityfactoryservice.py @@ -163,4 +163,4 @@ def run(bundle_path): _sugarext.set_application_name(bundle.get_name()) factory = ActivityFactoryService(bundle.get_service_name(), - bundle.get_class()) + bundle.activity_class) diff --git a/sugar/activity/bundle.py b/sugar/activity/bundle.py index 8bf3386..cccff5a 100644 --- a/sugar/activity/bundle.py +++ b/sugar/activity/bundle.py @@ -59,6 +59,9 @@ class Bundle: self._init_with_path(path) def _init_with_path(self, path): + self.activity_class = None + self.bundle_exec = None + self._name = None self._icon = None self._service_name = None @@ -116,18 +119,10 @@ class Bundle: logging.error('%s must specify a name' % self._path) if cp.has_option(section, 'class'): - self._class = cp.get(section, 'class') - self._exec = '%s --bundle-path="%s"' % ( - env.get_bin_path(_PYTHON_FACTORY), self._path) + self.activity_class = cp.get(section, 'class') elif cp.has_option(section, 'exec'): - self._class = None - cmdline = cp.get(section, 'exec') - cmdline = os.path.join(self._path, cmdline) - cmdline = cmdline.replace('$SUGAR_BUNDLE_PATH', self._path) - cmdline = os.path.expandvars(cmdline) - self._exec = cmdline + self.bundle_exec = cp.get(section, 'exec') else: - self._exec = None self._valid = False logging.error('%s must specify exec or class' % self._path) @@ -232,9 +227,17 @@ class Bundle: """Get the activity version""" return self._activity_version - def get_exec(self): + def get_command(self): """Get the command to execute to launch the activity factory""" - return self._exec + if self.bundle_exec: + command = os.path.join(self._path, self.bundle_exec) + command = command.replace('$SUGAR_BUNDLE_PATH', self._path) + command = os.path.expandvars(command) + else: + command = '%s --bundle-path="%s"' % ( + env.get_bin_path(_PYTHON_FACTORY), self._path) + + return command def get_class(self): """Get the main Activity class""" |