Package handlers :: Module baseClass :: Class Handler
[show private | hide private]
[frames | no frames]

Type Handler

object --+
         |
        Handler

Known Subclasses:
Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler, Handler

The base class for all the handlers.

Methods that can be overridden: Default implementations are provided for these methods.
Method Summary
  __init__(self, configDict)
Initializer that uses a dictionary to configure the handler.
  __add__(self, otherHandler)
Operator for layering the handlers in a stack.
  __repr__(self)
  beginParentDirHook(self, dirName, subdirNames, fileNames)
Handles the parent directory that the 'walk' has reached.
  beginParentDirWrapper(self, dirName, subdirNames, fileNames)
Invokes beginParentDirHook for this handler and, recursively, for each handler below this one in the stack.
  calcModifValue(fileNamePath)
Helper method that calculates the value used to determine if a file has been changed or is different from another file. (Static method)
  endParentDirHook(self)
Handles the parent directory that the 'walk' has reached.
  endParentDirWrapper(self)
Invokes endParentDirHook for this handler and, recursively, for each handler below this one in the stack.
  finalizeHook(self)
Save all the results if needed and release resources.
  finalizeWrapper(self)
Invokes finalizeHook for this handler and, recursively, for each handler below this one in the stack.
  getMetaCfg(cls)
(Static method)
  handleChildDirHook(self, dirName)
Handles a child directory contained in the parent directory.
  handleChildDirWrapper(self, dirName)
Invokes handleChildDirHook for this handler and, recursively, for each handler below this one in the stack.
  handleFileHook(self, fileName)
Handles a file contained in the parent directory.
  handleFileWrapper(self, fileName)
Invokes handleFileHook for this handler and, recursively, for each handler below this one in the stack.
  modifValue(self, fileName)
Helper method to get the value used to determine if a file has been changed or is different from another file.
  setConfig(self, configDict)
Updates itself with configDict.
  setTopDir(self, topDir)
Sets the top directory in the handler.
  treeTopHook(self, topDir)
Takes care of initialization that is needed for every tree.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
type metaCfgCls = handlers.baseClass.metaCfgCls
tuple _metaCfg = ( (label='name'  desc='Optional, unused.  Ide...

Instance Method Details

__init__(self, configDict=None)
(Constructor)

Initializer that uses a dictionary to configure the handler.
Overrides:
__builtin__.object.__init__

__add__(self, otherHandler)
(Addition operator)

Operator for layering the handlers in a stack. Right-hand member is added in the stack below the left-hand member.

beginParentDirHook(self, dirName, subdirNames=None, fileNames=None)

Handles the parent directory that the 'walk' has reached. It is invoked BEFORE handling the directories and files that the parent directory contains.

It can modify the subdirNames and fileNames lists, thus affecting the traversal of the tree. It is a feature useful for comparing the traversed tree to other trees.

beginParentDirWrapper(self, dirName, subdirNames=None, fileNames=None)

Invokes beginParentDirHook for this handler and, recursively, for each handler below this one in the stack.

endParentDirHook(self)

Handles the parent directory that the 'walk' has reached. It is invoked AFTER handling the directories and files that the parent directory contains.

endParentDirWrapper(self)

Invokes endParentDirHook for this handler and, recursively, for each handler below this one in the stack.

finalizeHook(self)

Save all the results if needed and release resources.

finalizeWrapper(self)

Invokes finalizeHook for this handler and, recursively, for each handler below this one in the stack.

handleChildDirHook(self, dirName)

Handles a child directory contained in the parent directory.

handleChildDirWrapper(self, dirName)

Invokes handleChildDirHook for this handler and, recursively, for each handler below this one in the stack.

handleFileHook(self, fileName)

Handles a file contained in the parent directory.

handleFileWrapper(self, fileName)

Invokes handleFileHook for this handler and, recursively, for each handler below this one in the stack.

modifValue(self, fileName)

Helper method to get the value used to determine if a file has been changed or is different from another file.

Checks first if the value is not already passed in the stack data and only if it is not, it invokes calcModifValue.

Returns the value or None if the file cannot be accessed.

setConfig(self, configDict)

Updates itself with configDict.

setTopDir(self, topDir)

Sets the top directory in the handler. It recurses into the handlers below it in the stack. Invokes treeTopHook for initialization that is needed for every tree.

treeTopHook(self, topDir)

Takes care of initialization that is needed for every tree.

Static Method Details

calcModifValue(fileNamePath)

Helper method that calculates the value used to determine if a file has been changed or is different from another file.

The value is the modification time of the file but it is possible to use another value (eg, MD5 signature) in the future.

Returns the value or None if the file cannot be accessed.

Class Variable Details

_metaCfg

Type:
tuple
Value:
(	(label='name'
	 desc='Optional, unused.  Identifies a handler in the stack.'
	 typ='string'):,)                                                     

Generated by Epydoc 2.1 on Wed Dec 22 15:47:44 2004 http://epydoc.sf.net