Watchdog

Software kuvakaappaus:
Watchdog
Ohjelmiston tiedot:
Versio: 0.6.0
Lähetyksen päivämäärä: 14 Apr 15
Kehittäjä: Gora Khargosh
Lupa: Vapaa
Suosio: 65

Rating: 3.0/5 (Total Votes: 2)

Vahtikoira on Python API seurata tiedostojärjestelmän tapahtumia.
Vahtikoira avulla Python-ohjelmia seurata tiedostojärjestelmän tapahtumista portably kuin mahdollista käyttämällä:
* Inotify Linux
* FSEvents Mac OS X
* Windows API Windows
* Äänestyspaikoilla varamahdollisuutena mekanismi
Esimerkki Käyttö:

 tuonti sys
tuonti aika
alkaen vahtikoira tuonti Observer, FileSystemEventHandler
tuonti puunkorjuu
logging.basicConfig (taso = logging.DEBUG)
luokan MyEventHandler (FileSystemEventHandler):
& Nbsp; & nbsp; & nbsp; def catch_all_handler (itse, tapahtuma):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; logging.debug (tapahtuma)
& Nbsp; & nbsp; & nbsp; def on_moved (itse, tapahtuma):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (tapahtuma)
& Nbsp; & nbsp; & nbsp; def on_created (itse, tapahtuma):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (tapahtuma)
& Nbsp; & nbsp; & nbsp; def on_deleted (itse, tapahtuma):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (tapahtuma)
& Nbsp; & nbsp; & nbsp; def on_modified (itse, tapahtuma):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (tapahtuma)
event_handler = MyEventHandler ()
tarkkailija = Observer ()
observer.schedule (-ainutlaatuinen-nimi ", event_handler, * sys.argv [1:])
observer.start ()
kokeile:
& Nbsp; & nbsp; & nbsp; vaikka True:
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; time.sleep (1)
paitsi KeyboardInterrupt:
& Nbsp; & nbsp; & nbsp; observer.unschedule (-ainutlaatuinen-nimi)
& Nbsp; & nbsp; & nbsp; observer.stop ()
observer.join ()

Vaatimukset :

  • Python
  • pyinotify

Vastaavia ohjelmistoja

pmem
pmem

2 Jun 15

Conky
Conky

17 Feb 15

Snarl
Snarl

11 May 15

Muu ohjelmistojen kehittäjä Gora Khargosh

squeeze
squeeze

14 Apr 15

Kommentit Watchdog

Kommentteja ei löytynyt
Lisää kommentti
Ota kuvia!