MCPcopy Index your code
hub / github.com/geekcomputers/Python / Handler

Class Handler

Downloaded Files Organizer/obs.py:9–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7 from move_to_directory import add_to_dir
8
9 class Handler(FileSystemEventHandler):
10 def on_created(self, event):
11 if event.event_type == "created":
12 file_name = os.path.basename(event.src_path)
13 ext = os.path.splitext(event.src_path)[1]
14 time.sleep(2)
15 add_to_dir(ext[1:], event.src_path, path)
16 observer.stop()
17
18 observer = Observer()
19 event_handler = Handler()

Callers 1

watcherFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected