Watchdog

Software screenshot:
Watchdog
Podrobnosti Software:
Verze: 0.6.0
Datum uploadu: 14 Apr 15
Vývojka: Gora Khargosh
Licence: Volný
Popularita: 3

Rating: nan/5 (Total Votes: 0)

Watchdog je Python API pro sledování souborového systému událostí.
Watchdog umožňuje svým Python programy sledovat filesystem události podle portably jak je to možné za použití:
* Inotify na Linuxu
* FSEvents na Mac OS X
* Windows API na Windows
* Polling jako nouzový mechanismus
Příklad použití:

 import sys
import time
od hlídací dovozu Observer, FileSystemEventHandler
import protokolování
logging.basicConfig (level = logging.DEBUG)
třída MyEventHandler (FileSystemEventHandler):
& Nbsp; & nbsp; & nbsp; def catch_all_handler (self, event):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; logging.debug (event)
& Nbsp; & nbsp; & nbsp; def on_moved (self, event):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (event)
& Nbsp; & nbsp; & nbsp; def on_created (self, event):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (event)
& Nbsp; & nbsp; & nbsp; def on_deleted (self, event):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (event)
& Nbsp; & nbsp; & nbsp; def on_modified (self, event):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (event)
event_handler = MyEventHandler ()
pozorovatel = Observer ()
observer.schedule ("specifické-name", event_handler, * sys.argv [1:])
observer.start ()
zkuste:
& Nbsp; & nbsp; & nbsp; zatímco True:
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; time.sleep (1)
kromě KeyboardInterrupt:
& Nbsp; & nbsp; & nbsp; observer.unschedule ("specifické-name")
& Nbsp; & nbsp; & nbsp; observer.stop ()
observer.join ()

Požadavky na :

  • Python
  • pyinotify

Podobný software

Ganglia
Ganglia

27 Sep 15

Log Watcher
Log Watcher

14 Apr 15

NConf
NConf

14 Apr 15

BestCrypt
BestCrypt

11 May 15

Ostatní software developer Gora Khargosh

squeeze
squeeze

14 Apr 15

Komentáře k Watchdog

Komentáře nebyl nalezen
Přidat komentář
Zapnout obrázky!