这是我的FileHandler ..当我移动文件时,我得到一个移动事件和一个修改过的事件,但我只想要一个移动事件。我该如何处理?
class FileHandler(FileSystemEventHandler):
def on_modified(self, event):
print "path: " + event.src_path
print "type: " + event.event_type
print "is dir: " + str(event.is_directory)
print "\n"
def on_created(self, event):
print "path: " + event.src_path
print "type: " + event.event_type
print "is dir: " + str(event.is_directory)
print "\n"
def on_deleted(self, event):
print "path: " + event.src_path
print "type: " + event.event_type
print "is dir: " + str(event.is_directory)
print "\n"
def on_moved(self, event):
print "path: " + event.src_path
print "type: " + event.event_type
print "is dir: " + str(event.is_directory)
print "dest_path: " + event.dest_path
print "\n"
答案 0 :(得分:0)
你一次只能有一个事件,你必须玩 SOU 目录/文件和 DESTINATION