stagestatus/scent.py

29 lines
966 B
Python
Raw Normal View History

2017-04-01 18:22:16 +00:00
from sniffer.api import * # import the really small API
import os, termstyle
# you can customize the pass/fail colors like this
pass_fg_color = termstyle.green
pass_bg_color = termstyle.bg_default
fail_fg_color = termstyle.red
fail_bg_color = termstyle.bg_default
# All lists in this variable will be under surveillance for changes.
watch_paths = ['stagestatus/',]
# this gets invoked on every file that gets changed in the directory. Return
# True to invoke any runnable functions, False otherwise.
#
# This fires runnables only if files ending with .py extension and not prefixed
# with a period.
@file_validator
def py_files(filename):
return filename.endswith('.py') and not os.path.basename(filename).startswith('.')
@runnable
def execute_nose(*args):
from subprocess import call
if len(args) > 1:
return call('python manage.py test %s' % args[1], shell=True) == 0
else:
return call('python manage.py test', shell=True) == 0