Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/bundle
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-06-16 14:22:48 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-06-16 14:22:48 (GMT)
commitcd7debb52a563c7fe2d51ef80ce6bad19c6f484d (patch)
tree94eb193ae6e8a78477367b836bceb6e563c8f96b /src/sugar/bundle
parent042a09cccd592509431008b811a83da556d3cfc0 (diff)
Add support for tags in activity bundles
Diffstat (limited to 'src/sugar/bundle')
-rw-r--r--src/sugar/bundle/activitybundle.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py
index 268576e..8f85098 100644
--- a/src/sugar/bundle/activitybundle.py
+++ b/src/sugar/bundle/activitybundle.py
@@ -54,6 +54,7 @@ class ActivityBundle(Bundle):
self._bundle_id = None
self._mime_types = None
self._show_launcher = True
+ self._tags = None
self._activity_version = 0
self._installation_time = os.stat(path).st_mtime
self._manifest = None
@@ -175,6 +176,10 @@ class ActivityBundle(Bundle):
if cp.get(section, 'show_launcher') == 'no':
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'):
self._icon = cp.get(section, 'icon')
@@ -213,6 +218,10 @@ class ActivityBundle(Bundle):
if cp.has_option(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):
"""Get the locale path inside the (installed) activity bundle."""
if self._zip_file is not None:
@@ -273,6 +282,10 @@ class ActivityBundle(Bundle):
"""Get the MIME types supported by the activity"""
return self._mime_types
+ def get_tags(self):
+ """Get the tags that describe the activity"""
+ return self._tags
+
def get_show_launcher(self):
"""Get whether there should be a visible launcher for the activity"""
return self._show_launcher