Watchdog

Phần mềm chụp màn hình:
Watchdog
Các chi tiết về phần mềm:
Phiên bản: 0.6.0
Ngày tải lên: 14 Apr 15
Nhà phát triển: Gora Khargosh
Giấy phép: Miễn phí
Phổ biến: 3

Rating: nan/5 (Total Votes: 0)

Watchdog là một API Python để theo dõi các sự kiện hệ thống tập tin.
Watchdog cho phép các chương trình Python của bạn theo dõi các sự kiện hệ thống tập tin như portably nhất có thể sử dụng:
* Inotify trên Linux
* FSEvents trên Mac OS X
* Windows API trên Windows
* Bỏ phiếu như là một cơ chế dự phòng
Ví dụ sử dụng:

 sys nhập khẩu
thời gian nhập khẩu
từ cơ quan giám sát nhập khẩu Observer, FileSystemEventHandler
khai thác gỗ nhập khẩu
logging.basicConfig (level = logging.DEBUG)
lớp MyEventHandler (FileSystemEventHandler):
& Nbsp; & nbsp; & nbsp; def catch_all_handler (self, sự kiện):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; logging.debug (sự kiện)
& Nbsp; & nbsp; & nbsp; def on_moved (self, sự kiện):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (sự kiện)
& Nbsp; & nbsp; & nbsp; def on_created (self, sự kiện):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (sự kiện)
& Nbsp; & nbsp; & nbsp; def on_deleted (self, sự kiện):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (sự kiện)
& Nbsp; & nbsp; & nbsp; def on_modified (self, sự kiện):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; self.catch_all_handler (sự kiện)
event_handler = MyEventHandler ()
quan sát = Observer ()
observer.schedule ('a-độc đáo-name', event_handler, * sys.argv [1:])
observer.start ()
thử:
& Nbsp; & nbsp; & nbsp; trong khi True:
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; time.sleep (1)
trừ KeyboardInterrupt:
& Nbsp; & nbsp; & nbsp; observer.unschedule ('a-độc đáo-name')
& Nbsp; & nbsp; & nbsp; observer.stop ()
observer.join ()

Yêu cầu :

  • Python
  • pyinotify

Phần mềm tương tự

Monitorix
Monitorix

22 Jun 18

interceptty
interceptty

2 Jun 15

check_dir
check_dir

11 May 15

Phần mềm khác của nhà phát triển Gora Khargosh

squeeze
squeeze

14 Apr 15

Ý kiến ​​để Watchdog

Bình luận không
Nhập bình luận
Bật hình ảnh!