From f0799200e9d3278681c2b271e376e026e3cea9a1 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 27 Aug 2018 16:38:12 +0200 Subject: [PATCH] Bugfixing in scripts --- lib/webhooks/__init__.py | 2 +- lib/webhooks/show_modules.py | 4 ++-- show-modules-html.py | 3 +-- show-modules-txt.py | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/webhooks/__init__.py b/lib/webhooks/__init__.py index 246f418..380b36c 100644 --- a/lib/webhooks/__init__.py +++ b/lib/webhooks/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '0.10.8' +__version__ = '0.10.9' # vim: ts=4 et list diff --git a/lib/webhooks/show_modules.py b/lib/webhooks/show_modules.py index 874c2c3..a43fb0f 100644 --- a/lib/webhooks/show_modules.py +++ b/lib/webhooks/show_modules.py @@ -60,7 +60,7 @@ class ShowModulesApp(BaseHookApp): } # ------------------------------------------------------------------------- - def __init__(self, appname=None, verbose=0, version=__version__): + def __init__(self, output_type='json', appname=None, verbose=0, version=__version__): """Constructor.""" self.description = textwrap.dedent('''\ @@ -68,7 +68,7 @@ class ShowModulesApp(BaseHookApp): ''').strip() self.cache_file = None - self._output_type = 'json' + self._output_type = output_type self.filters = None super(ShowModulesApp, self).__init__( diff --git a/show-modules-html.py b/show-modules-html.py index 4b510ef..f46017e 100755 --- a/show-modules-html.py +++ b/show-modules-html.py @@ -17,8 +17,7 @@ from webhooks.show_modules import ShowModulesApp MY_APPNAME = os.path.basename(sys.argv[0]) LOG = logging.getLogger(MY_APPNAME) -app = ShowModulesApp(appname=MY_APPNAME) -app._output_type = 'html' +app = ShowModulesApp(output_type='html', appname=MY_APPNAME) if app.verbose > 2: LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) diff --git a/show-modules-txt.py b/show-modules-txt.py index 697930b..1f64d09 100755 --- a/show-modules-txt.py +++ b/show-modules-txt.py @@ -17,8 +17,7 @@ from webhooks.show_modules import ShowModulesApp MY_APPNAME = os.path.basename(sys.argv[0]) LOG = logging.getLogger(MY_APPNAME) -app = ShowModulesApp(appname=MY_APPNAME) -app._output_type = 'txt' +app = ShowModulesApp(output_type='txt', appname=MY_APPNAME) if app.verbose > 2: LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) -- 2.39.5