Skip to content

Commit

Permalink
enhanced coding style regarding pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-mohr committed Jan 19, 2021
1 parent 8865783 commit e37d8e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from distutils.core import setup, Command


class CheckModules(Command):
"""
:Author: Daniel Mohr
Expand All @@ -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 = ""
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -67,6 +75,7 @@ def run(self):
finder.run_script(script)
finder.report()


setup(
name='pydabu',
version='2021-01-19',
Expand Down Expand Up @@ -111,4 +120,4 @@ def run(self):
'os.path',
'json'],
provides=['dabu']
)
)
4 changes: 3 additions & 1 deletion src/dabu/scripts/pydabu_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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. ' +
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/pydabu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from dabu.scripts import pydabu_main


def main():
"""
:Author: Daniel Mohr
Expand All @@ -16,5 +17,6 @@ def main():
"""
pass


if __name__ == "__main__":
pydabu_main()

0 comments on commit e37d8e3

Please sign in to comment.