Merge branch 'godiard-try-2'

This commit is contained in:
Sam Parkinson 2015-04-07 07:28:27 +10:00
commit 597721877f

View File

@ -101,7 +101,6 @@ class ActivityBundle(Bundle):
def __init__(self, path, translated=True): def __init__(self, path, translated=True):
Bundle.__init__(self, path) Bundle.__init__(self, path)
self.activity_class = None
self.bundle_exec = None self.bundle_exec = None
self._name = None self._name = None
@ -157,10 +156,16 @@ class ActivityBundle(Bundle):
if cp.has_option(section, 'exec'): if cp.has_option(section, 'exec'):
self.bundle_exec = cp.get(section, 'exec') self.bundle_exec = cp.get(section, 'exec')
else:
if cp.has_option(section, 'class'):
self.bundle_exec = 'sugar-activity ' + cp.get(section,
'class')
logging.error('ATTENTION: class property in the '
'activity.info file is deprecated, should be '
'changed to exec')
else: else:
raise MalformedBundleException( raise MalformedBundleException(
'Activity bundle %s must specify either class or exec' % 'Activity bundle %s must specify exec' % self._path)
self._path)
if cp.has_option(section, 'mime_types'): if cp.has_option(section, 'mime_types'):
mime_list = cp.get(section, 'mime_types').strip(';') mime_list = cp.get(section, 'mime_types').strip(';')
@ -287,12 +292,7 @@ class ActivityBundle(Bundle):
def get_command(self): def get_command(self):
"""Get the command to execute to launch the activity factory""" """Get the command to execute to launch the activity factory"""
if self.bundle_exec: return os.path.expandvars(self.bundle_exec)
command = os.path.expandvars(self.bundle_exec)
else:
command = 'sugar-activity ' + self.activity_class
return command
def get_mime_types(self): def get_mime_types(self):
"""Get the MIME types supported by the activity""" """Get the MIME types supported by the activity"""