Python watchdog.events.LoggingEventHandler() Examples

The following are 4 code examples of watchdog.events.LoggingEventHandler(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module watchdog.events , or try the search function .
Example #1
Source File: brain.py    From kim-voice-assistant with MIT License 5 votes vote down vote up
def mod_change_detected(self):
        return LoggingEventHandler() 
Example #2
Source File: __init__.py    From pyTSon_plugins with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        event_handler = LoggingEventHandler()
        self.observer = Observer()
        self.observer.schedule(event_handler, ts3lib.getConfigPath(), recursive=True)
        self.observer.start()
        try:
            while True:
                time.sleep(1)
        except KeyboardInterrupt:
            self.observer.stop()
            self.observer.join()
        if PluginHost.cfg.getboolean("general", "verbose"): ts3lib.printMessageToCurrentTab("{0}[color=orange]{1}[/color] Plugin for pyTSon by [url=https://github.com/{2}]{2}[/url] loaded.".format(timestamp(), self.name, self.author)) 
Example #3
Source File: monitor_directory.py    From SPSE with MIT License 5 votes vote down vote up
def main():
  logging.basicConfig(level=logging.INFO,
                      format='%(asctime)s - %(message)s',
                      datefmt='%Y-%m-%d %H:%M:%S')
  path = raw_input("What is the path of the directory (and all files recursively) you wish to monitor: ")
  event_handler = LoggingEventHandler()
  observer = Observer()
  observer.schedule(event_handler, path, recursive=True)
  observer.start()
  try:
    while True:
      time.sleep(1)
  except KeyboardInterrupt:
    observer.stop()
  observer.join() 
Example #4
Source File: pycard.py    From pycard with MIT License 5 votes vote down vote up
def main():
    logging.basicConfig(level=logging.INFO,
                        format='%(asctime)s - %(message)s',
                        datefmt='%Y-%m-%d %H:%M:%S')

    (options, args) = parse_options()

    port = options.port
    assets_path = options.path
    file_prefix = options.prefix
    host_address = options.host_address

    csv.register_dialect('custom_delimiter', delimiter=options.delimiter)

    card_renderer = CardRenderer(assets_path, file_prefix)

    observer = Observer()
    observer.schedule(LoggingEventHandler(), assets_path, recursive=True)
    observer.schedule(RenderingEventHandler(card_renderer), assets_path, recursive=True)

    card_renderer.render_cards()

    observer.start()

    server = Server()
    server.watch(card_renderer.all_cards_rendered_path)
    server.serve(root=assets_path, port=port, host=host_address)

    observer.stop()
    observer.join()