diff options
author | Christopher Harvey <chris@basementcode.com> | 2010-06-01 08:35:13 -0400 |
---|---|---|
committer | Christopher Harvey <chris@basementcode.com> | 2010-06-01 08:35:13 -0400 |
commit | 8c11d0e0cfd31a269a41ce0c4800b4c2d727a9e5 (patch) | |
tree | 152e33db9b9931cd808c30b1728b338f4b20f1bf /src | |
parent | Moved project into official GSoC hosting from github. (diff) | |
download | ventoo-8c11d0e0cfd31a269a41ce0c4800b4c2d727a9e5.tar.gz ventoo-8c11d0e0cfd31a269a41ce0c4800b4c2d727a9e5.tar.bz2 ventoo-8c11d0e0cfd31a269a41ce0c4800b4c2d727a9e5.zip |
Documentation files are now located relative to the module root directory.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/VentooModule.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/VentooModule.py b/src/backend/VentooModule.py index 77a81ea..ff2af32 100644 --- a/src/backend/VentooModule.py +++ b/src/backend/VentooModule.py @@ -21,6 +21,7 @@ import os.path as osp from lxml import etree +import augeas_utils _ventoo_search_paths_ = ['../modules', '../../modules'] @@ -33,6 +34,7 @@ class VentooModule: if osp.isfile(thisPath): self.pathFound = thisPath found = True + self.docRoot = osp.join(p, moduleName) break if not found: raise RuntimeError('Could not find '+moduleName+' Module') @@ -59,11 +61,12 @@ class VentooModule: else: return '0' - def getDocURLOf(self, xPath): + def getDocURLOf(self, xPath): try: elem = self.xmlTree.xpath(osp.join(xPath)) - if len(elem) >= 1: - return elem[0].get("docurl") + if len(elem) >= 1 and not elem[0].get("docurl") == None: + #pdb.set_trace() + return "file:///"+osp.abspath(osp.join(self.docRoot, augeas_utils.stripBothSlashes(elem[0].get("docurl")))) except etree.XPathEvalError: pass return None |