start making a proper module from vdstatus.py, also properly use configparser
This commit is contained in:
parent
7edaa54a6f
commit
e2ca550f37
4 changed files with 19 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue