Skip to content

Commit

Permalink
Added 'onNodeCreated' hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Pierre authored and Sébastien committed Apr 26, 2008
1 parent 2c370db commit 5105074
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/sink/tracking.py
Expand Up @@ -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."""
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit 5105074

Please sign in to comment.