From 5105074abf30e0c2fc73cd5807d83ba92ee6a463 Mon Sep 17 00:00:00 2001 From: Sebastien Pierre Date: Sat, 26 Apr 2008 14:55:13 -0400 Subject: [PATCH] Added 'onNodeCreated' hook --- Sources/sink/tracking.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/sink/tracking.py b/Sources/sink/tracking.py index 893a70d..aec33c2 100644 --- a/Sources/sink/tracking.py +++ b/Sources/sink/tracking.py @@ -65,6 +65,7 @@ def __init__( self, state, location, usesSignature=True, accepts=(), self.location( location ) assert type(self._accepts) in (tuple, list) assert type(self._rejects) in (tuple, list) + state.onNodeCreated(self) def isDirectory( self ): """Tells wether the node is a directory or not.""" @@ -537,6 +538,11 @@ def __init__( self, rootLocation, rootNodeState=None, populate=False, if populate: self.populate() + def onNodeCreated( self, node ): + """A callback placeholder that can be used to output stuff when a node + is created.""" + return None + def accepts( self, a ): """Specifies the GLOBS (as strings) that all inserted node must match."""