forked from jodal/comics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
43 lines (32 loc) · 965 Bytes
/
Copy pathtasks.py
File metadata and controls
43 lines (32 loc) · 965 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
35
36
37
38
39
40
41
42
43
import sys
from invoke import run, task
@task
def docs(watch=False, warn=False):
if watch:
return watcher(docs)
run('make -C docs/ html', warn=warn)
@task
def test(watch=False, warn=False):
if watch:
return watcher(test)
run('python manage.py test', pty=True, warn=warn)
@task
def lint(watch=False, warn=False):
if watch:
return watcher(lint)
run('flake8', warn=warn)
@task
def update_authors():
# Keep authors in the order of appearance and use awk to filter out dupes
run("git log --format='- %aN <%aE>' --reverse | awk '!x[$0]++' > AUTHORS")
def watcher(task, *args, **kwargs):
while True:
run('clear')
kwargs['warn'] = True
task(*args, **kwargs)
try:
run(
'inotifywait -q -e create -e modify -e delete '
'--exclude ".*\.(pyc|sw.)" -r docs/ mopidy/ tests/')
except KeyboardInterrupt:
sys.exit()