aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Harvey <chris@basementcode.com>2010-06-08 22:56:48 -0400
committerChristopher Harvey <chris@basementcode.com>2010-06-10 11:48:42 -0400
commitd94f00973fa95315bea9f04f24ebde458c80ce04 (patch)
tree8aa34473f355c0f3c3946996b977c8ff6469fe31
parentAdded __init__.py files to frontend and backend (diff)
downloadventoo-d94f00973fa95315bea9f04f24ebde458c80ce04.tar.gz
ventoo-d94f00973fa95315bea9f04f24ebde458c80ce04.tar.bz2
ventoo-d94f00973fa95315bea9f04f24ebde458c80ce04.zip
Made a place for system wide search paths to live, so that they can be easily changed on installation.
-rw-r--r--src/backend/VentooModule.py5
-rw-r--r--src/backend/search_paths.py22
2 files changed, 24 insertions, 3 deletions
diff --git a/src/backend/VentooModule.py b/src/backend/VentooModule.py
index ff2af32..35c79f9 100644
--- a/src/backend/VentooModule.py
+++ b/src/backend/VentooModule.py
@@ -22,14 +22,13 @@
import os.path as osp
from lxml import etree
import augeas_utils
-
-_ventoo_search_paths_ = ['../modules', '../../modules']
+import search_paths
class VentooModule:
def __init__(self, moduleName):
#see if we can find the module files
found = False;
- for p in _ventoo_search_paths_:
+ for p in search_paths.modules:
thisPath = osp.join(p,moduleName,"main.xml")
if osp.isfile(thisPath):
self.pathFound = thisPath
diff --git a/src/backend/search_paths.py b/src/backend/search_paths.py
new file mode 100644
index 0000000..5c0c24d
--- /dev/null
+++ b/src/backend/search_paths.py
@@ -0,0 +1,22 @@
+"""
+
+ This file is part of the Ventoo program.
+
+ This 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, either version 3 of the License, or
+ (at your option) any later version.
+
+ It 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 software. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Christopher Harvey
+
+"""
+
+modules = ['../modules', '../../modules']