start making a proper module from vdstatus.py, also properly use configparser

This commit is contained in:
Von Random 2016-10-19 12:19:45 +03:00
parent 7edaa54a6f
commit e2ca550f37
4 changed files with 19 additions and 15 deletions

View file

@ -1,6 +1,10 @@
import time
def run(conf):
fmt = conf['format']
return time.strftime(fmt)
def run(config, section):
fmt = config.get(section, 'format')
result = dict()
if config.has_option(section, 'color'):
result['color'] = config.get(section, 'color')
result['full_text'] = time.strftime(fmt)
return result