min.js compilation_level : advanced # simple|advanced source_directory : app/static/js/ destination_directory : app/public/js/ files : index-page : - app/static/js/vendor/jquery*.js - app/static/js/base.js - app/static/js/index-page.js about-page : - app/static/js/vendor/jquery*.js - app/static/js/base.js - app/static/js/about-page/**/*.js TrickĬlasses are augmented with a few additional features that regular event handlersĪn example tricks.yaml file: tricks : - : patterns : - watchmedo_webtricks.GoogleClosureTrick : patterns : hash_names : true mappings_format : json # json|yaml|python mappings_module : app/javascript_mappings suffix. Subclass and are written by plugin authors. Watchmedo can read tricks.yaml files and execute tricks within them in Please see the help information for these commands by typing: watchmedo -help About watchmedo Tricks Response to events: watchmedo shell-command \ You can use the shell-command subcommand to execute shell commands in Ignoring all directory events: watchmedo log \ Here is how you can log the current directory recursivelyįor events related only to *.py and *.txt files while Please type watchmedo -help at the shell prompt to Watchdog comes with an optional utility script called watchmedo. schedule ( event_handler, path, recursive = True ) observer. argv ) > 1 else '.' event_handler = LoggingEventHandler () observer = Observer () observer. INFO, format = ' %(asctime)s - %(message)s ', datefmt = '%Y-%m- %d %H:%M:%S' ) path = sys. Python API and shell utilities to monitor file system events.Ī simple program that uses watchdog to monitor directories specifiedĪs command-line arguments and logs events generated: import sys import time import logging from watchdog.observers import Observer from watchdog.events import LoggingEventHandler if _name_ = "_main_" : logging.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |