diff options
author | Von Random <von@vdrandom.org> | 2019-03-05 19:21:11 +0300 |
---|---|---|
committer | Von Random <von@vdrandom.org> | 2019-03-05 19:21:11 +0300 |
commit | c70a4549cbf2acab482aa44ed404c5af0ee2f654 (patch) | |
tree | 7832a71e86bbecc94ca8210af40cc498e1fbe902 | |
parent | 46f3d778aff5400c3ce3c3aecaf8ffaea19a6ede (diff) |
some more sensible defaults, get rid of todo
-rw-r--r-- | plugins/disk.py | 2 | ||||
-rwxr-xr-x | vdstatus | 17 |
2 files changed, 8 insertions, 11 deletions
diff --git a/plugins/disk.py b/plugins/disk.py index 6b80dd6..6ab9c2b 100644 --- a/plugins/disk.py +++ b/plugins/disk.py @@ -4,7 +4,7 @@ import psutil class PluginThread(plugins.PluginThreadCommon): def __init__(self, config): - defaults = {'partition': '/', 'problem': 80} + defaults = {'partition': '/', 'problem': 80, 'freq': 15} super(PluginThread, self).__init__(config, defaults) def main(self): @@ -1,8 +1,5 @@ #!/usr/bin/python3 # pylint: disable=C0111 -# TODO: consider per plugin hide_ok overriding global, not the other way around -# TODO: add documentation / comments -# TODO: interactivity support import argparse import importlib import json @@ -14,6 +11,12 @@ import plugins DEFAULT_CONFIG = os.path.join(os.environ['HOME'], '.config/vdstatus/conf.yaml') +DEFAULTS = { + 'output_format': 'term', + 'output_freq': 1, + 'hide_ok': False, + 'plugins': [{'name': 'date'}] +} def parse_arguments(): @@ -27,16 +30,10 @@ def parse_arguments(): class PluginRunner: def __init__(self, config_file=DEFAULT_CONFIG): - defaults = { - 'output_format': 'term', - 'output_freq': 1, - 'hide_ok': True, - 'plugins': [{'name': 'date'}] - } config = dict() with open(config_file) as config_data: config = yaml.load(config_data) - self.conf = plugins.parse_config(config, defaults) + self.conf = plugins.parse_config(config, DEFAULTS) self.plugins_loaded = list() self.format_output = self.format_term for plugin in self.conf['plugins']: |