Added hh path normalization
Slashes '/' in hh path can lead to import errors on non-posix systems Path normalization eliminates this problem
This commit is contained in:
parent
dc3c721884
commit
a67368cc5a
|
@ -74,11 +74,17 @@ class Layout:
|
||||||
|
|
||||||
class Site:
|
class Site:
|
||||||
def __init__(self, node):
|
def __init__(self, node):
|
||||||
|
def normalizePath(path):
|
||||||
|
"Normalized existing pathes"
|
||||||
|
if os.path.exists(path):
|
||||||
|
return os.path.abspath(path)
|
||||||
|
return path
|
||||||
|
|
||||||
self.site_name = node.getAttribute("site_name")
|
self.site_name = node.getAttribute("site_name")
|
||||||
self.table_finder = node.getAttribute("table_finder")
|
self.table_finder = node.getAttribute("table_finder")
|
||||||
self.screen_name = node.getAttribute("screen_name")
|
self.screen_name = node.getAttribute("screen_name")
|
||||||
self.site_path = node.getAttribute("site_path")
|
self.site_path = normalizePath(node.getAttribute("site_path"))
|
||||||
self.HH_path = node.getAttribute("HH_path")
|
self.HH_path = normalizePath(node.getAttribute("HH_path"))
|
||||||
self.decoder = node.getAttribute("decoder")
|
self.decoder = node.getAttribute("decoder")
|
||||||
self.hudopacity = node.getAttribute("hudopacity")
|
self.hudopacity = node.getAttribute("hudopacity")
|
||||||
self.hudbgcolor = node.getAttribute("bgcolor")
|
self.hudbgcolor = node.getAttribute("bgcolor")
|
||||||
|
@ -93,6 +99,8 @@ class Site:
|
||||||
self.ypad = node.getAttribute("ypad")
|
self.ypad = node.getAttribute("ypad")
|
||||||
self.layout = {}
|
self.layout = {}
|
||||||
|
|
||||||
|
print self.site_name, self.HH_path
|
||||||
|
|
||||||
for layout_node in node.getElementsByTagName('layout'):
|
for layout_node in node.getElementsByTagName('layout'):
|
||||||
lo = Layout(layout_node)
|
lo = Layout(layout_node)
|
||||||
self.layout[lo.max] = lo
|
self.layout[lo.max] = lo
|
||||||
|
|
Loading…
Reference in New Issue
Block a user