-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
executable file
·42 lines (34 loc) · 1.11 KB
/
tasks.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
from __future__ import unicode_literals
import sys
from invoke import run, task
@task
def test(coverage=False, watch=False, warn=False):
if watch:
return watcher(test, coverage=coverage)
cmd = 'py.test'
if coverage:
cmd += ' --cov=spotifyconnect --cov-report=term-missing'
run(cmd, pty=True, warn=warn)
@task
def preprocess_header():
run(
'cpp spotifyconnect/spotify.armv6l.h > '
'spotifyconnect/spotify.processed.armv6l.h && '
'sed -i "s/__extension__//g" spotifyconnect/spotify.processed.armv6l.h'
)
run(
'cpp spotifyconnect/spotify.armv7l.h > '
'spotifyconnect/spotify.processed.armv7l.h && '
'sed -i "s/__extension__//g" spotifyconnect/spotify.processed.armv7l.h'
)
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 spotifyconnect/ tests/')
except KeyboardInterrupt:
sys.exit()