vdstatus/plugins/date.py

12 lines
363 B
Python
Raw Normal View History

2016-10-18 20:00:43 +03:00
import time
import plugins.common
2016-10-18 20:00:43 +03:00
class PluginThread(plugins.common.PluginThreadCommon):
def __init__(self, section, config, thread_id):
super(PluginThread, self).__init__(section, config)
2016-10-22 19:27:28 +03:00
self.date_format = config.get(section, 'format', fallback='%c')
2016-10-22 19:27:28 +03:00
def main(self):
self.status['full_text'] = time.strftime(self.date_format)