forked from openlp/openlp
- Fixed up Mac OS X detection
- Removed an unnecessary import - Fixed an export
This commit is contained in:
parent
835fd8a3f0
commit
ccfa7501ce
@ -34,7 +34,6 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
|
|
||||||
import openlp
|
|
||||||
from openlp.core.lib import Receiver, str_to_bool
|
from openlp.core.lib import Receiver, str_to_bool
|
||||||
from openlp.core.resources import qInitResources
|
from openlp.core.resources import qInitResources
|
||||||
from openlp.core.ui import MainWindow, SplashScreen, ScreenList
|
from openlp.core.ui import MainWindow, SplashScreen, ScreenList
|
||||||
|
@ -45,9 +45,9 @@ class AppLocation(object):
|
|||||||
if dir_type == AppLocation.AppDir:
|
if dir_type == AppLocation.AppDir:
|
||||||
return os.path.abspath(os.path.split(sys.argv[0])[0])
|
return os.path.abspath(os.path.split(sys.argv[0])[0])
|
||||||
elif dir_type == AppLocation.ConfigDir:
|
elif dir_type == AppLocation.ConfigDir:
|
||||||
if os.name == u'nt':
|
if sys.platform == u'win32':
|
||||||
path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
|
path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
|
||||||
elif os.name == u'mac':
|
elif sys.platform == u'darwin':
|
||||||
path = os.path.join(os.getenv(u'HOME'), u'Library',
|
path = os.path.join(os.getenv(u'HOME'), u'Library',
|
||||||
u'Application Support', u'openlp')
|
u'Application Support', u'openlp')
|
||||||
else:
|
else:
|
||||||
@ -58,9 +58,9 @@ class AppLocation(object):
|
|||||||
path = os.path.join(os.getenv(u'HOME'), u'.openlp')
|
path = os.path.join(os.getenv(u'HOME'), u'.openlp')
|
||||||
return path
|
return path
|
||||||
elif dir_type == AppLocation.DataDir:
|
elif dir_type == AppLocation.DataDir:
|
||||||
if os.name == u'nt':
|
if sys.platform == u'win32':
|
||||||
path = os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data')
|
path = os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data')
|
||||||
elif os.name == u'mac':
|
elif sys.platform == u'darwin':
|
||||||
path = os.path.join(os.getenv(u'HOME'), u'Library',
|
path = os.path.join(os.getenv(u'HOME'), u'Library',
|
||||||
u'Application Support', u'openlp', u'Data')
|
u'Application Support', u'openlp', u'Data')
|
||||||
else:
|
else:
|
||||||
@ -100,4 +100,4 @@ def check_latest_version(config, current_version):
|
|||||||
from registry import Registry
|
from registry import Registry
|
||||||
from confighelper import ConfigHelper
|
from confighelper import ConfigHelper
|
||||||
|
|
||||||
__all__ = [u'Registry', u'ConfigHelper', u'AppLocations', u'check_latest_version']
|
__all__ = [u'Registry', u'ConfigHelper', u'AppLocation', u'check_latest_version']
|
||||||
|
Loading…
Reference in New Issue
Block a user