forked from CCExtractor/sample-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanage.py
More file actions
34 lines (25 loc) · 950 Bytes
/
manage.py
File metadata and controls
34 lines (25 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/local/bin/python3
"""Root module to manage flask CLI commands."""
import click
from exceptions import CCExtractorEndedWithNonZero, MissingPathToCCExtractor
from mod_regression.update_regression import update_expected_results
from run import app
@app.cli.command('update')
@click.argument('path_to_ccex')
def update_results(path_to_ccex):
"""
Update results for the present samples with new ccextractor version.
Pass path to CCExtractor binary as the argument.
Example: flask update /path/to/ccextractor
"""
if not path_to_ccex:
click.echo('path to ccextractor is missing')
raise MissingPathToCCExtractor
click.echo(f'path to ccextractor: {path_to_ccex}')
if not update_expected_results(path_to_ccex):
click.echo('update function errored')
raise CCExtractorEndedWithNonZero
click.echo('update function finished')
return 0
if __name__ == '__main__':
app.cli()