python watchdog: definition of commands in file -
i use grunt , gruntfile.js watch files , launch test, like this
// gruntfile.js module.exports = function(grunt){ grunt.initconfig({ watch: { grunt: { files: ['gruntfile.js'] }, python: { files : ['./tests/*.py','./libs/*/*.py'], tasks: ['pythontest'], }, } }); grunt.registertask('pythontest', function(){ grunt.util.spawn({ cmd: 'python', args: ['setup.py','test'], opts: {stdio: 'inherit'}, }); }); grunt.registertask('default', ['watch']); }; i'm searching python solution, watchdog.
for defition of task , commands, watchdog have file similar gruntfile.js ?
for single command, use watchmedo script command installed in python's watchdog module:
watchmedo shell-command --patterns="*.py" --recursive --command='echo python setup.py test # "${watch_src_path}"'
Comments
Post a Comment