Add support for tags in activity bundles

This commit is contained in:
Tomeu Vizoso 2009-06-16 16:22:48 +02:00
parent 042a09cccd
commit cd7debb52a

View File

@ -54,6 +54,7 @@ class ActivityBundle(Bundle):
self._bundle_id = None self._bundle_id = None
self._mime_types = None self._mime_types = None
self._show_launcher = True self._show_launcher = True
self._tags = None
self._activity_version = 0 self._activity_version = 0
self._installation_time = os.stat(path).st_mtime self._installation_time = os.stat(path).st_mtime
self._manifest = None self._manifest = None
@ -175,6 +176,10 @@ class ActivityBundle(Bundle):
if cp.get(section, 'show_launcher') == 'no': if cp.get(section, 'show_launcher') == 'no':
self._show_launcher = False self._show_launcher = False
if cp.has_option(section, 'tags'):
tag_list = cp.get(section, 'tags').strip(';')
self._tags = [tag.strip() for tag in tag_list.split(';')]
if cp.has_option(section, 'icon'): if cp.has_option(section, 'icon'):
self._icon = cp.get(section, 'icon') self._icon = cp.get(section, 'icon')
@ -213,6 +218,10 @@ class ActivityBundle(Bundle):
if cp.has_option(section, 'name'): if cp.has_option(section, 'name'):
self._name = cp.get(section, 'name') self._name = cp.get(section, 'name')
if cp.has_option(section, 'tags'):
tag_list = cp.get(section, 'tags').strip(';')
self._tags = [tag.strip() for tag in tag_list.split(';')]
def get_locale_path(self): def get_locale_path(self):
"""Get the locale path inside the (installed) activity bundle.""" """Get the locale path inside the (installed) activity bundle."""
if self._zip_file is not None: if self._zip_file is not None:
@ -273,6 +282,10 @@ class ActivityBundle(Bundle):
"""Get the MIME types supported by the activity""" """Get the MIME types supported by the activity"""
return self._mime_types return self._mime_types
def get_tags(self):
"""Get the tags that describe the activity"""
return self._tags
def get_show_launcher(self): def get_show_launcher(self):
"""Get whether there should be a visible launcher for the activity""" """Get whether there should be a visible launcher for the activity"""
return self._show_launcher return self._show_launcher