From 75dc923f207cccfe4439f46792e624c9c5c230bd Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 26 May 2019 16:21:58 +0200 Subject: Move generate to external file --- cli/__init__.py | 0 cli/cli.py | 9 +++++++++ pyblog | 8 ++------ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 cli/__init__.py create mode 100644 cli/cli.py diff --git a/cli/__init__.py b/cli/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cli/cli.py b/cli/cli.py new file mode 100644 index 00000000..ad081fb7 --- /dev/null +++ b/cli/cli.py @@ -0,0 +1,9 @@ +#/bin/python3 + +from generators import generators + + +def generate(args): + """Wrapper for generate_blog(fresh=False).""" + # pylint: disable=unused-argument + exit(generators.generate_blog(fresh=False)) diff --git a/pyblog b/pyblog index a3f483d5..ace987ae 100755 --- a/pyblog +++ b/pyblog @@ -50,11 +50,7 @@ from config.config import * from generators import generators - -def generate(args): - """Wrapper for generate_blog(fresh=False).""" - # pylint: disable=unused-argument - exit(generators.generate_blog(fresh=False)) +from cli import cli def regenerate(args): @@ -658,7 +654,7 @@ def main(): parser_generate = subparsers.add_parser( "generate", aliases=["g", "gen"], description="Generate new or changed objects.") - parser_generate.set_defaults(func=generate) + parser_generate.set_defaults(func=cli.generate) parser_regenerate = subparsers.add_parser( "regenerate", aliases=["r", "regen"], -- cgit v1.2.1