← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/version-fix into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/version-fix into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Try to catch some of the problems that might occur when OpenLP can't fetch the version number from the site.
-- 
https://code.launchpad.net/~raoul-snyman/openlp/version-fix/+merge/33734
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/version-fix into lp:openlp.
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py	2010-07-30 22:48:09 +0000
+++ openlp/core/utils/__init__.py	2010-08-26 05:41:04 +0000
@@ -70,6 +70,8 @@
             remote_version[u'release'] = int(match.group(3))
             if len(match.groups()) > 3 and match.group(4):
                 remote_version[u'revision'] = int(match.group(4))
+        else:
+            return
         match = self.version_splitter.match(self.app_version[u'full'])
         if match:
             local_version[u'major'] = int(match.group(1))
@@ -77,6 +79,8 @@
             local_version[u'release'] = int(match.group(3))
             if len(match.groups()) > 3 and match.group(4):
                 local_version[u'revision'] = int(match.group(4))
+        else:
+            return
         if remote_version[u'major'] > local_version[u'major'] or \
             remote_version[u'minor'] > local_version[u'minor'] or \
             remote_version[u'release'] > local_version[u'release']:
@@ -147,10 +151,10 @@
             return plugin_path
         elif dir_type == AppLocation.VersionDir:
             if hasattr(sys, u'frozen') and sys.frozen == 1:
-                plugin_path = os.path.abspath(os.path.split(sys.argv[0])[0])
+                version_path = os.path.abspath(os.path.split(sys.argv[0])[0])
             else:
-                plugin_path = os.path.split(openlp.__file__)[0]
-            return plugin_path
+                version_path = os.path.split(openlp.__file__)[0]
+            return version_path
         elif dir_type == AppLocation.CacheDir:
             if sys.platform == u'win32':
                 path = os.path.join(os.getenv(u'APPDATA'), u'openlp')


Follow ups