pyfmf: a file management framework in python
Page Changed: 1/19/2005
|
Handlers
This is a description of the the
handlers that are provided at this time ( zigo version 0.4 and zago
version 0.2). The handlers are divided into four categories:
- Filters - filter files and directories.
- Processors - perform actions on files and
directoires. The actions performed on files and directories can
include collecting data, modifying, storing, removing, etc.
- Loggers - log data based on the files and directories to a file.
- Viewers - log data based on the files and directories to a wxPython window that can be used by zago.
A handler does not necessarily belong to only one category. For
instance, a handler could do both processing of files and
logging. Following is a list of all the handlers with their
descriptions:
- filterDirsBasename -
Filter. Filters directories based on their names. Uses
fnmatch to compare directory names to patterns in the configuration. Configurable to filter in or out.
- filterDirsPath -
Filter. Filters directories specified by full path. Uses
glob and paths can be configured with wildcards. Configurable to
filter in or out.
- filterFilesBasename -
Filter. Filters out files with base names that match patterns in a
list. Uses fnmatch to compare file names to patterns in the
configuration. Configurable to filter in or out.
- filterFilesBasenameRe -
Filter. Filters out files with base names that match patterns in a
list. Uses regular expressions (module re) to compare file names to patterns in the
configuration. Configurable to filter in or out.
- filterFilesPath -
Filter. Filters out files specified by full path. Uses glob
and paths can be configured with wildcards. Configurable to
filter in or out.
- logAll - Logger. Logs files and directories to a plain text file. Particularly useful for testing and debugging.
- logFilesOnly - Logger. Logs files to a plain text file.
- procBuildDict -
Processor. Builds a persistent structure containing the
tree. The top of the structure is a dictionary with an element
for each one of the top directories. All the values associated
with directories are dictionaries themselves, containing the
sub-directories and the files. The values associated with files
contain information relevant to the file (in the present
implementation, only modification time). The result is a nesting
of dictionaries. For example, for a tree starting from '/', a
file like
'/usr/include/sys/wait.h' would be represented in the persistent
structure by
self.filesStructDict['/']['usr']['include']['sys']['wait.h']
(self.filesStructDict['/usr'/include']['sys']['wait.h'] if the tree
starts from '/usr/include').
- procCompareTree
- Processor and logger. Determines differences between traversed
trees and a reference tree. Creates stack data indicating which
files and
directories are new or modified. Logs all changes, including
deleted
files and directories into a file.
- procFromDict - Processor
and logger. Determines file and directory changes from a previously
saved structure. Uses the persistent structure created by the
'procBuildDict' handler. Creates stack data indicating which files and
directories are new or modified. Logs all changes, including deleted
files and directories into a file.
- procRemoveFiles - Processor. Removes all the files that are passed in.
- procTarFiles - Processor. Creates a 'tar.gz' file with all the files that are passed in.
- viewFilesPlain - Viewer. Creates a plain list view of the files.
- viewDirsPlain - Viewer. Creates a plain list view of the directories.
|