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

Method on_created

Downloaded Files Organizer/obs.py:10–16  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

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

nothing calls this directly

Calls 2

add_to_dirFunction · 0.90
stopMethod · 0.45

Tested by

no test coverage detected