forked from openlp/openlp
Fixed up some problems (like mising Registry classes)
bzr-revno: 159
This commit is contained in:
parent
84631f272d
commit
a27b216387
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
|
||||
<!-- eric4 user project file for project openlp.org 2.0 -->
|
||||
<!-- Saved: 2008-12-01, 20:35:11 -->
|
||||
<!-- Saved: 2008-12-01, 21:49:55 -->
|
||||
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
|
||||
<UserProject version="4.0">
|
||||
</UserProject>
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd">
|
||||
<!-- eric4 tasks file for project openlp.org 2.0 -->
|
||||
<!-- Saved: 2008-12-01, 20:35:12 -->
|
||||
<!-- Saved: 2008-12-01, 21:49:55 -->
|
||||
<Tasks version="4.2">
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Project SYSTEM "Project-4.4.dtd">
|
||||
<!-- eric4 project file for project openlp.org 2.0 -->
|
||||
<!-- Saved: 2008-12-01, 20:35:01 -->
|
||||
<!-- Saved: 2008-12-01, 21:42:45 -->
|
||||
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
|
||||
<Project version="4.4">
|
||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||
@ -80,6 +80,8 @@
|
||||
<Source>openlp/core/lib/event.py</Source>
|
||||
<Source>openlp/core/utils/confighelper.py</Source>
|
||||
<Source>openlp/core/utils/winregistry.py</Source>
|
||||
<Source>openlp/core/utils/registry.py</Source>
|
||||
<Source>openlp/core/utils/linregistry.py</Source>
|
||||
</Sources>
|
||||
<Forms>
|
||||
<Form>resources/forms/bibleimport.ui</Form>
|
||||
|
@ -65,8 +65,8 @@ class PluginManager(object):
|
||||
log.debug("Importing %s from %s." % (modulename, path))
|
||||
try:
|
||||
__import__(modulename, globals(), locals(), [])
|
||||
except ImportError:
|
||||
pass
|
||||
except ImportError, e:
|
||||
print e.message
|
||||
self.plugin_classes = Plugin.__subclasses__()
|
||||
self.plugins = []
|
||||
plugin_objects = []
|
||||
|
@ -24,12 +24,14 @@ class ConfigHelper(object):
|
||||
"""
|
||||
Utility Helper to allow classes to find directories in a standard manner.
|
||||
"""
|
||||
@staticmethod
|
||||
def get_registry_value(reg, key, value_name):
|
||||
k = _winreg.OpenKey(reg, key)
|
||||
value = _winreg.QueryValueEx(k, value_name)[0]
|
||||
_winreg.CloseKey(k)
|
||||
return value
|
||||
|
||||
@staticmethod
|
||||
def getConfigPath():
|
||||
if os.name == 'nt':
|
||||
import _winreg
|
||||
@ -38,17 +40,19 @@ class ConfigHelper(object):
|
||||
path = get_registry_value(reg, key, "Common AppData")
|
||||
elif os.name == 'posix':
|
||||
path = os.path.join(os.getenv('HOME'), ".openlp.org")
|
||||
if os.path.exists(path) == False :
|
||||
raise Exception ('Configuration Directory does not Exist ')
|
||||
#if os.path.exists(path) == False :
|
||||
# raise Exception ('Configuration Directory does not Exist ')
|
||||
return path
|
||||
|
||||
@staticmethod
|
||||
def getSongsFile():
|
||||
path = getConfigPath()
|
||||
path = ConfigHelper.getConfigPath()
|
||||
songfile = os.path.join(path, ".openlp.org", "Data", "songs.olp")
|
||||
if os.path.exists(songfile):
|
||||
filename.set_filename(songfile)
|
||||
print songfile
|
||||
|
||||
@staticmethod
|
||||
def getBiblePath():
|
||||
return os.path.join(getConfigPath(), "Data","Bibles")
|
||||
return os.path.join(ConfigHelper.getConfigPath(), "Data","Bibles")
|
||||
|
||||
|
29
openlp/core/utils/linregistry.py
Normal file
29
openlp/core/utils/linregistry.py
Normal file
@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
from openlp.core.utils import Registry
|
||||
|
||||
class LinRegistry(Registry):
|
||||
"""
|
||||
The LinRegistry class is a high-level class for working with Linux and
|
||||
Unix configurations.
|
||||
"""
|
||||
def __init__(self):
|
||||
pass
|
26
openlp/core/utils/registry.py
Normal file
26
openlp/core/utils/registry.py
Normal file
@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
class Registry(object):
|
||||
"""
|
||||
The Registry class is a generic class for the accessing configurations.
|
||||
"""
|
||||
def __init__(self):
|
||||
pass
|
@ -18,7 +18,7 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
import _winreg
|
||||
from openlp.core.utils import Registry
|
||||
|
||||
class WinRegistry(Registry):
|
||||
"""
|
||||
@ -26,4 +26,4 @@ class WinRegistry(Registry):
|
||||
functions in Python.
|
||||
"""
|
||||
def __init__(self):
|
||||
pass
|
||||
import _winreg
|
||||
|
Loading…
Reference in New Issue
Block a user