[Pkg-sugar-commit] [sugar-toolkit] 04/13: Apply new version scheme as well to content bundles #10379

Jonas Smedegaard dr at jones.dk
Thu Apr 16 18:50:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.84.15-1
in repository sugar-toolkit.

commit 6c1681ef7be635bae2a367913094443cd6c388f1
Author: Simon Schampijer <simon at schampijer.de>
Date:   Thu Nov 25 12:07:36 2010 +0100

    Apply new version scheme as well to content bundles #10379
    
    Reviewed-by: James Cameron<quozl at laptop.org>
---
 src/sugar/bundle/contentbundle.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/sugar/bundle/contentbundle.py b/src/sugar/bundle/contentbundle.py
index 2d19417..7ee486e 100644
--- a/src/sugar/bundle/contentbundle.py
+++ b/src/sugar/bundle/contentbundle.py
@@ -29,6 +29,9 @@ from sugar import env
 from sugar.bundle.bundle import Bundle, NotInstalledException, \
     MalformedBundleException
 
+from sugar.bundle.bundleversion import NormalizedVersion
+from sugar.bundle.bundleversion import InvalidVersionError
+
 class ContentBundle(Bundle):
     """A Sugar content bundle
 
@@ -51,7 +54,7 @@ class ContentBundle(Bundle):
         self._subcategory = None
         self._category_class = None
         self._category_icon = None
-        self._library_version = None
+        self._library_version = '0'
         self._bundle_class = None
         self._activity_start = None
         self._global_name = None
@@ -94,11 +97,12 @@ class ContentBundle(Bundle):
         if cp.has_option(section, 'library_version'):
             version = cp.get(section, 'library_version')
             try:
-                self._library_version = int(version)
-            except ValueError:
+                NormalizedVersion(version)
+            except InvalidVersionError:
                 raise MalformedBundleException(
                     'Content bundle %s has invalid version number %s' %
                     (self._path, version))
+            self._library_version = version
 
         if cp.has_option(section, 'l10n'):
             l10n = cp.get(section, 'l10n')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-toolkit.git



More information about the pkg-sugar-commit mailing list