-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
64 lines (45 loc) · 1.4 KB
/
manage.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""Script manager for running locally. Gunicorn is used to run the
application on Google App Engine. See entrypoint in app.yaml.
"""
from flask_script import Manager
from pymoji.app import APP
from pymoji.faces import process_path
from pymoji.utils import process_folder, shell
MANAGER = Manager(APP)
@MANAGER.command
def build():
"""test + lint
You'll know if shit's broken first; then you'll get to hear grief about your line length
"""
test()
lint()
@MANAGER.command
def lint():
"""Runs all project linters on errythang!"""
shell("pylint manage.py pymoji tests")
#shell("static/js/node_modules/.bin/eslint --ext .js,.jsx,.json,.es6,.es static/js")
@MANAGER.command
def runface(image_path):
"""Processes faces in the given image.
Args:
image_path: path to an image file to process faces in.
"""
process_path(image_path)
@MANAGER.command
def rundir(directory_path):
"""Processes images in the given directory.
Args:
directory_path: path to a directory to process images in.
"""
process_folder(directory_path, process_path)
@MANAGER.command
def test():
"""Runs all project tests!"""
shell("pytest --doctest-modules")
#shell("cd static/js && npm test")
@MANAGER.command
def install():
"""Installs all project dependencies"""
shell("pip install -r requirements.txt")
if __name__ == "__main__":
MANAGER.run()