handle conf params more robustly again

This commit is contained in:
Josh Holtrop 2011-07-07 16:03:24 -04:00
parent bd72122b95
commit 1374bc0626

View File

@ -10,9 +10,6 @@ class Window(object):
self.conf = conf self.conf = conf
self.count = 0 self.count = 0
self.connection = None self.connection = None
self.fgcolor = ''.join(map(lambda x: '%02x' % int(0xFF * x),
self.conf['fgcolor']))
self.font_sz = int(1024 * self.conf['font_size'])
if not 'width' in self.conf: if not 'width' in self.conf:
self.conf['width'] = 32 self.conf['width'] = 32
@ -32,6 +29,9 @@ class Window(object):
self.conf['flash_rate'] = 3000 self.conf['flash_rate'] = 3000
if not 'font_size' in self.conf: if not 'font_size' in self.conf:
self.conf['font_size'] = 18 self.conf['font_size'] = 18
self.font_sz = int(1024 * self.conf['font_size'])
self.fgcolor = ''.join(map(lambda x: '%02x' % int(0xFF * x),
self.conf['fgcolor']))
sticky = True sticky = True
if 'sticky' in self.conf: if 'sticky' in self.conf:
sticky = self.conf['sticky'] sticky = self.conf['sticky']