basic cleanup
This commit is contained in:
parent
9ec1eb48e1
commit
0e6254ce0d
|
@ -111,24 +111,17 @@ class Site:
|
||||||
self.ypad = node.getAttribute("ypad")
|
self.ypad = node.getAttribute("ypad")
|
||||||
self.layout = {}
|
self.layout = {}
|
||||||
|
|
||||||
print self.site_name, self.HH_path
|
print "Loading site", self.site_name
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
# Site defaults
|
# Site defaults
|
||||||
if self.xpad == "": self.xpad = 1
|
self.xpad = 1 if self.xpad == "" else int(self.xpad)
|
||||||
else: self.xpad = int(self.xpad)
|
self.ypad = 0 if self.ypad == "" else int(self.ypad)
|
||||||
|
self.font_size = 7 if self.font_size == "" else int(self.font_size)
|
||||||
if self.ypad == "": self.ypad = 0
|
self.hudopacity = 1.0 if self.hud_opacity == "" else float(self.hudopacity)
|
||||||
else: self.ypad = int(self.ypad)
|
|
||||||
|
|
||||||
if self.font_size == "": self.font_size = 7
|
|
||||||
else: self.font_size = int(self.font_size)
|
|
||||||
|
|
||||||
if self.hudopacity == "": self.hudopacity = 1.0
|
|
||||||
else: self.hudopacity = float(self.hudopacity)
|
|
||||||
|
|
||||||
if self.use_frames == "": self.use_frames = False
|
if self.use_frames == "": self.use_frames = False
|
||||||
if self.font == "": self.font = "Sans"
|
if self.font == "": self.font = "Sans"
|
||||||
|
@ -436,7 +429,7 @@ class Config:
|
||||||
db = self.get_db_parameters()
|
db = self.get_db_parameters()
|
||||||
if db['db-password'] == 'YOUR MYSQL PASSWORD':
|
if db['db-password'] == 'YOUR MYSQL PASSWORD':
|
||||||
df_file = self.find_default_conf()
|
df_file = self.find_default_conf()
|
||||||
if df_file == None: # this is bad
|
if df_file is None: # this is bad
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
df_parms = self.read_default_conf(df_file)
|
df_parms = self.read_default_conf(df_file)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user