From 79f0e696f3f6067a0841a37404fb546dedaa07cb Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 15 Apr 2019 16:26:03 +0200 Subject: cli suite working --- check/commands/phash/add.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 check/commands/phash/add.py (limited to 'check/commands/phash/add.py') diff --git a/check/commands/phash/add.py b/check/commands/phash/add.py new file mode 100644 index 0000000..1565202 --- /dev/null +++ b/check/commands/phash/add.py @@ -0,0 +1,21 @@ +""" +Add a file to the database +""" + +import click + +from app.models.sql_factory import add_phash_by_filename + +@click.command() +@click.option('-i', '--input', 'opt_fn', + required=True, + help="File to add (gif/jpg/png)") +@click.option('-u', '--upload', 'opt_upload', is_flag=True, + help='Whether to upload this file to S3') +@click.pass_context +def cli(ctx, opt_fn, opt_upload): + """ + Add a single file + """ + print('Adding a file...') + add_phash_by_filename(opt_fn) -- cgit v1.2.3-70-g09d2