Module Expr Str Import alias Import alias Import alias Assign NameStore Dict FunctionDef arguments args NameParam defaults body Expr Str Global identifier For NameStore NameLoad body Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse If CompareNotEq NameLoad SubscriptLoad NameLoad Index NameLoad body Assign NameStore Dict Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str While NameLoad body If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Slice Num TryExcept body Expr Call NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 
Watch a bunch of files and run a command if any changes are detected.

Usage
-----
::

    python watcher.py 'echo changes' one.py two.py

To automatically keep Sphinx docs up to date::

    python watcher.py 'make html' $(find . -name '*.rst')

Problems
--------

 * The file checking would be way more efficient using inotify or whatever the
   equivalent is on OS X.
 * It doesn't handle bad input or spaces in filenames.

But it works for me.
 N/A os N/A sys N/A time N/A _mtimes N/A timecheck N/A N/A files N/A N/A N/A Return True if any of the files have changed. N/A _mtimes N/A filename files N/A N/A mtime N/A N/A N/A os stat filename st_mtime N/A N/A filename _mtimes N/A N/A N/A _mtimes N/A filename mtime N/A N/A N/A mtime N/A _mtimes N/A filename N/A N/A _mtimes N/A N/A True N/A N/A False N/A watcher N/A N/A command files N/A N/A N/A Run ``command`` if any file in ``files`` changes. N/A True N/A N/A N/A timecheck files N/A N/A N/A N/A os system command N/A N/A N/A time sleep 1 N/A main N/A N/A N/A N/A N/A N/A command files N/A N/A N/A sys argv N/A 1 N/A N/A sys argv N/A 2 N/A N/A N/A N/A watcher command files N/A N/A N/A KeyboardInterrupt N/A N/A N/A N/A N/A __name__ __main__ N/A N/A N/A main