From e37d8e3111a8c652cea79c0c24b79e8acd18e6ff Mon Sep 17 00:00:00 2001 From: Daniel Mohr Date: Tue, 19 Jan 2021 16:22:51 +0100 Subject: [PATCH] enhanced coding style regarding pep8 --- setup.py | 11 ++++++++++- src/dabu/scripts/pydabu_main.py | 4 +++- src/scripts/pydabu.py | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 65e9dac..789c94b 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,7 @@ from distutils.core import setup, Command + class CheckModules(Command): """ :Author: Daniel Mohr @@ -18,10 +19,13 @@ class CheckModules(Command): """ description = "checking for modules need to run the software" user_options = [] + def initialize_options(self): pass + def finalize_options(self): pass + def run(self): import importlib summary = "" @@ -44,6 +48,7 @@ def run(self): "\nSummary\n%d modules are not available (not unique)\n%s\n" % ( i, summary)) + class CheckModulesModulefinder(Command): """ :Author: Daniel Mohr @@ -55,10 +60,13 @@ class CheckModulesModulefinder(Command): """ description = "checking for modules need to run the scripts (modulefinder)" user_options = [] + def initialize_options(self): pass + def finalize_options(self): pass + def run(self): import modulefinder for script in self.distribution.scripts: @@ -67,6 +75,7 @@ def run(self): finder.run_script(script) finder.report() + setup( name='pydabu', version='2021-01-19', @@ -111,4 +120,4 @@ def run(self): 'os.path', 'json'], provides=['dabu'] - ) +) diff --git a/src/dabu/scripts/pydabu_main.py b/src/dabu/scripts/pydabu_main.py index 8f94de5..bf5ed8c 100644 --- a/src/dabu/scripts/pydabu_main.py +++ b/src/dabu/scripts/pydabu_main.py @@ -10,12 +10,14 @@ from .run_check_data_structure import run_check_data_structure + def check_arg_directory(data): if not os.path.isdir(data): msg = '"%s" is not a directory' % data raise argparse.ArgumentTypeError(msg) return data + def pydabu_main(): """ :Author: Daniel Mohr @@ -39,7 +41,7 @@ def pydabu_main(): nargs="+", type=check_arg_directory, required=False, - default=['.'], # this is not checked against the required type + default=['.'], # this is not checked against the required type dest='directory', help='Set the directory to use. ' + 'You can also give a list of directories separated by space. ' + diff --git a/src/scripts/pydabu.py b/src/scripts/pydabu.py index 38cc6a2..2b114a0 100644 --- a/src/scripts/pydabu.py +++ b/src/scripts/pydabu.py @@ -7,6 +7,7 @@ from dabu.scripts import pydabu_main + def main(): """ :Author: Daniel Mohr @@ -16,5 +17,6 @@ def main(): """ pass + if __name__ == "__main__": pydabu_main()