summaryrefslogtreecommitdiff
path: root/check/commands
diff options
context:
space:
mode:
Diffstat (limited to 'check/commands')
-rw-r--r--check/commands/cli_imagehash.py1
-rw-r--r--check/commands/imagehash/add.py21
-rw-r--r--check/commands/imagehash/load.py25
-rw-r--r--check/commands/imagehash/query.py19
-rw-r--r--check/commands/imagehash/test.py19
5 files changed, 78 insertions, 7 deletions
diff --git a/check/commands/cli_imagehash.py b/check/commands/cli_imagehash.py
index c51c84c..32f8250 100644
--- a/check/commands/cli_imagehash.py
+++ b/check/commands/cli_imagehash.py
@@ -32,4 +32,3 @@ def cli(ctx, **kwargs):
# --------------------------------------------------------
if __name__ == '__main__':
cli()
-
diff --git a/check/commands/imagehash/add.py b/check/commands/imagehash/add.py
index 7c5dc31..37aad0d 100644
--- a/check/commands/imagehash/add.py
+++ b/check/commands/imagehash/add.py
@@ -1 +1,20 @@
-# add a file to the database \ No newline at end of file
+"""
+Add a file to the database
+"""
+
+import click
+
+# from app.models.sql_factory import load_sql_datasets
+
+@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...')
diff --git a/check/commands/imagehash/load.py b/check/commands/imagehash/load.py
index bdcb19c..dbb2567 100644
--- a/check/commands/imagehash/load.py
+++ b/check/commands/imagehash/load.py
@@ -1,3 +1,22 @@
-# loop over a directory of images
-# - compute their phashes
-# - optionally upload them to s3?
+"""
+Loop over a directory of images
+ - Compute their phashes
+ - Optionally upload them to s3?
+"""
+
+import click
+
+# from app.models.sql_factory import load_sql_datasets
+
+@click.command()
+@click.option('-i', '--input', 'opt_dir_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_dir_fn, opt_store):
+ """
+ Add a directory of images
+ """
+ print('Adding a directory...')
diff --git a/check/commands/imagehash/query.py b/check/commands/imagehash/query.py
index eb15960..cf5c2d4 100644
--- a/check/commands/imagehash/query.py
+++ b/check/commands/imagehash/query.py
@@ -1 +1,18 @@
-# search the database for a file \ No newline at end of file
+"""
+Search the database for an image
+"""
+
+import click
+
+# from app.models.sql_factory import load_sql_datasets
+
+@click.command()
+@click.option('-i', '--input', 'opt_fn',
+ required=True,
+ help="File to search")
+@click.pass_context
+def cli(ctx, opt_fn):
+ """
+ Search the database for an image
+ """
+ print('Searching for a file...')
diff --git a/check/commands/imagehash/test.py b/check/commands/imagehash/test.py
index 05d2ee4..499a424 100644
--- a/check/commands/imagehash/test.py
+++ b/check/commands/imagehash/test.py
@@ -1 +1,18 @@
-# query the database with a test set \ No newline at end of file
+"""
+Query the database with a test set
+"""
+
+import click
+
+# from app.models.sql_factory import load_sql_datasets
+
+@click.command()
+@click.option('-i', '--input', 'opt_fn',
+ required=True,
+ help="Directory to search")
+@click.pass_context
+def cli(ctx, opt_fn):
+ """
+ Search the database for an image
+ """
+ print('Searching for a file...')