initial commit
This commit is contained in:
commit
6be576aa63
4 changed files with 28 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
__pycache__
|
||||
*.iml
|
||||
.idea
|
5
conf.ini
Normal file
5
conf.ini
Normal file
|
@ -0,0 +1,5 @@
|
|||
[main]
|
||||
some_option = some value
|
||||
|
||||
[date]
|
||||
format = %%A %%d %%H:%%M
|
6
plugins/date.py
Normal file
6
plugins/date.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
import time
|
||||
|
||||
|
||||
def run(conf):
|
||||
fmt = conf['date']['format']
|
||||
return time.strftime(fmt)
|
14
vdstatus.py
Normal file
14
vdstatus.py
Normal file
|
@ -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))
|
Loading…
Reference in a new issue