← 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)

-- 
https://code.launchpad.net/~raoul-snyman/openlp/version-fix/+merge/23164
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw	2010-03-27 12:37:21 +0000
+++ openlp.pyw	2010-04-10 22:30:32 +0000
@@ -78,9 +78,7 @@
         Run the OpenLP application.
         """
         #Load and store current Application Version
-        filepath = AppLocation.get_directory(AppLocation.AppDir)
-        if not hasattr(sys, u'frozen'):
-            filepath = os.path.join(filepath, u'openlp')
+        filepath = AppLocation.get_directory(AppLocation.VersionDir)
         filepath = os.path.join(filepath, u'.version')
         fversion = None
         try:

=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py	2010-03-27 20:19:47 +0000
+++ openlp/core/utils/__init__.py	2010-04-10 22:30:32 +0000
@@ -43,9 +43,10 @@
     ConfigDir = 2
     DataDir = 3
     PluginsDir = 4
+    VersionDir = 5
 
     @staticmethod
-    def get_directory(dir_type):
+    def get_directory(dir_type=1):
         """
         Return the appropriate directory according to the directory type.
 
@@ -83,17 +84,18 @@
         elif dir_type == AppLocation.PluginsDir:
             plugin_path = None
             app_path = os.path.abspath(os.path.split(sys.argv[0])[0])
-            if sys.platform == u'win32':
-                if hasattr(sys, u'frozen') and sys.frozen == 1:
-                    plugin_path = os.path.join(app_path, u'plugins')
-                else:
-                    plugin_path = os.path.join(app_path, u'openlp', u'plugins')
-            elif sys.platform == u'darwin':
+            if hasattr(sys, u'frozen') and sys.frozen == 1:
                 plugin_path = os.path.join(app_path, u'plugins')
             else:
                 plugin_path = os.path.join(
                     os.path.split(openlp.__file__)[0], u'plugins')
             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])
+            else:
+                plugin_path = os.path.split(openlp.__file__)[0]
+            return plugin_path
 
 
 def check_latest_version(config, current_version):


Follow ups