From ce42db4843c3048f31fa42cb0707b50a723e82dd Mon Sep 17 00:00:00 2001
From: Wade Brainerd <wadetb@gmail.com>
Date: Sun, 27 Sep 2009 19:58:50 -0400
Subject: [PATCH] Support sugar_version field in activity.info
---
src/sugar/bundle/activitybundle.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py
index a1f10b9..026062f 100644
a
|
b
|
class ActivityBundle(Bundle): |
59 | 59 | self._activity_version = 0 |
60 | 60 | self._installation_time = os.stat(path).st_mtime |
61 | 61 | self._manifest = None |
| 62 | self._sugar_version = '0.0.0' |
62 | 63 | |
63 | 64 | info_file = self.get_file('activity/activity.info') |
64 | 65 | if info_file is None: |
… |
… |
class ActivityBundle(Bundle): |
193 | 194 | 'Activity bundle %s has invalid version number %s' % |
194 | 195 | (self._path, version)) |
195 | 196 | |
| 197 | if cp.has_option(section, 'sugar_version'): |
| 198 | self._sugar_version = cp.get(section, 'sugar_version') |
| 199 | |
196 | 200 | def _get_linfo_file(self): |
197 | 201 | lang = locale.getdefaultlocale()[0] |
198 | 202 | if not lang: |
… |
… |
class ActivityBundle(Bundle): |
292 | 296 | """Get whether there should be a visible launcher for the activity""" |
293 | 297 | return self._show_launcher |
294 | 298 | |
| 299 | def get_sugar_version(self): |
| 300 | """Get the minimum Sugar version required to launch the activity""" |
| 301 | return self._sugar_version |
| 302 | |
295 | 303 | def install(self, install_dir=None, strict_manifest=False): |
296 | 304 | if install_dir is None: |
297 | 305 | install_dir = env.get_user_activities_path() |