def process_IN_CREATE(self, event): path = os.path.join(event.path, event.name) if isInternalOyepaOp(path): return # filemon mustn't interfere with file moving around conducted by the oyepa UI app if self.interesting_path(path) and not os.path.islink(path): print "file created, path " + path if not self.has_recently_disappeared(path): add_tags_in_path_to_cache(path) # this path already exists in this doc_dir; update tag cache. What the user does next (in the doc tagger) is to simply *add/remove* tags on top of those; so the latter should already be in the cache self.call_gui_tagger(path) else: self.remove_from_recently_disappeared(path) pass return
def process_IN_MOVED_TO(self, event): path = os.path.join(event.path, event.name) if isInternalOyepaOp(path): return # filemon mustn't interfere with file moving around conducted by the oyepa UI app if self.interesting_path(path): if self.has_recently_disappeared(path): # doc went away, doc came back: all remains the same -- just prevent tags from being removed from cache print "moved_TO: %s has recently_disappeared and now reappeared, removing it from that list"%path self.remove_from_recently_disappeared(path) elif event.cookie in self.recently_moved: # this operation was a doc being moved/renamed inside the doc repository (we don't know if it remained in *the same* doc dir). An update to the cache is already pending to remove the tags corresponding to its previous name; now we just need to ensure that we add its current (possibly different!) tags to its current (possibly different!) doc_dir print "moved_TO %s: renaming/movement within doc repository, adding tags (in this path) to cache"%path add_tags_in_path_to_cache(path) else: # file imported into doc_dir from outside; the user might want to tag it print "moved_TO %s: importing from outside doc repository, adding tags to cache and calling tagger"%path add_tags_in_path_to_cache(path) # this path already exists in this doc_dir; update tag cache. What the user does next (in the doc tagger) is to simply *add/remove* tags on top of those; so the latter should already be in the cache self.call_gui_tagger(path) pass pass return