Commit 508144eb087eab76bb20d9f7148de3b10ef0a968

Authored by hitier
1 parent c99e4b38

Add cli pattern

Showing 3 changed files with 15 additions and 3 deletions   Show diff stats
app/cli.py 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +
  2 +def register(app):
  3 + @app.cli.group()
  4 + def pdc_tools():
  5 + """pdc default cli group"""
  6 + pass
... ...
pdc_web.py
1 1 #
2 2 # Flask app wrapper
3 3 #
4   -from app import create_app
5   -
  4 +from app import create_app, cli
6 5  
7 6 #
8 7 # Use app factory with configuration set by FLASK_ENV
9 8 # see app/__init_.py/create_app() for more details.
10 9 #
11 10 pdc_app = create_app()
  11 +
  12 +#
  13 +# Declare command line interpreter
  14 +# used with 'flask aroma_db' command
  15 +# see aroma/cli.py for more details.
  16 +#
  17 +cli.register(pdc_app)
... ...
pytest.ini
... ... @@ -3,4 +3,4 @@ testpaths = tests
3 3 python_files = *_tests.py
4 4 log_level = INFO
5 5 log_cli = True
6   -console_output_style = classic
7 6 \ No newline at end of file
  7 +console_output_style = classic
... ...