diff options
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 |