commit 6be576aa634b9307ef2710d7d9ac71e8c5ec9df3 Author: Von Random Date: Tue Oct 18 20:00:43 2016 +0300 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..35ba9cd --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__ +*.iml +.idea diff --git a/conf.ini b/conf.ini new file mode 100644 index 0000000..452e091 --- /dev/null +++ b/conf.ini @@ -0,0 +1,5 @@ +[main] +some_option = some value + +[date] +format = %%A %%d %%H:%%M \ No newline at end of file diff --git a/plugins/date.py b/plugins/date.py new file mode 100644 index 0000000..18a38ce --- /dev/null +++ b/plugins/date.py @@ -0,0 +1,6 @@ +import time + + +def run(conf): + fmt = conf['date']['format'] + return time.strftime(fmt) diff --git a/vdstatus.py b/vdstatus.py new file mode 100644 index 0000000..495d11c --- /dev/null +++ b/vdstatus.py @@ -0,0 +1,14 @@ +import sys +import os +import configparser +import importlib +import plugins + + +DEFAULT_CONFIG = os.path.join(os.environ['HOME'], 'IdeaProjects/vdstatus/conf.ini') + +configuration = configparser.ConfigParser() +configuration.read(DEFAULT_CONFIG) + +importlib.import_module('.date', 'plugins') +print(plugins.date.run(configuration))