mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
Update vendored windows libs
This commit is contained in:
parent
f61c211655
commit
b1cefa94e5
226 changed files with 33472 additions and 11882 deletions
35
libs/win/scripts/watch-changes.py
Normal file
35
libs/win/scripts/watch-changes.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
import traceback
|
||||
import sys
|
||||
import logging
|
||||
|
||||
from jaraco.windows.filesystem import change
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
|
||||
def long_handler(file):
|
||||
try:
|
||||
with open(file, 'rb') as f:
|
||||
data = f.read()
|
||||
print("read", len(data), "bytes from", file)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
watch()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
def watch():
|
||||
notifier = change.BlockingNotifier(sys.argv[1])
|
||||
notifier.watch_subtree = True
|
||||
|
||||
for ch in notifier.get_changed_files():
|
||||
long_handler(ch)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue