Watchdog

Screenshot Software:
Watchdog
Szczegóły programowe:
Wersja: 0.6.0
Filmu: 14 Apr 15
Wywoływacz: Gora Khargosh
Licencja: Wolny
Popularność: 3

Rating: nan/5 (Total Votes: 0)

Watchdog to API Pythona do monitorowania zdarzeń systemu plików.
Watchdog pozwala programy Python monitorowania zdarzeń systemu plików, jak przenośnie jak to jest możliwe:
* Inotify na Linuksie
* FSEvents na Mac OS X
* Windows API w systemie Windows
* Ankietowanie jako mechanizm awaryjnego
Przykład użycia:

 import sys
Czas importu
z watchdog importu Observer, FileSystemEventHandler
rejestrowanie importu
logging.basicConfig (poziom = logging.DEBUG)
Klasa MyEventHandler (FileSystemEventHandler):
& Nbsp; & nbsp; & nbsp; catch_all_handler def (self, zdarzenia):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; logging.debug (wydarzenie)
& Nbsp; & nbsp; & nbsp; def on_moved (self, zdarzenia):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (wydarzenie)
& Nbsp; & nbsp; & nbsp; def on_created (self, zdarzenia):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (wydarzenie)
& Nbsp; & nbsp; & nbsp; def on_deleted (self, zdarzenia):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (wydarzenie)
& Nbsp; & nbsp; & nbsp; def on_modified (self, zdarzenia):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (wydarzenie)
event_handler = MyEventHandler ()
obserwator = Obserwator ()
observer.schedule ("nazwa-specyficzne", event_handler, * sys.argv [1:])
observer.start ()
spróbuj:
& Nbsp; & nbsp; & nbsp; while True:
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; time.sleep (1)
wyjątkiem KeyboardInterrupt:
& Nbsp; & nbsp; & nbsp; observer.unschedule ("nazwa-specyficzne")
& Nbsp; & nbsp; & nbsp; observer.stop ()
observer.join ()

Wymagania :

  • Python
  • pyinotify

Podobne oprogramowanie

CN=Monitor
CN=Monitor

20 Feb 15

pms
pms

11 May 15

qmail-smtpd-auth
qmail-smtpd-auth

3 Jun 15

StackApplet
StackApplet

15 Apr 15

Inne programy z deweloperem Gora Khargosh

squeeze
squeeze

14 Apr 15

Komentarze do Watchdog

Komentarze nie znaleziono
Dodaj komentarz
Włącz zdjęć!