SourceForge.net Logo Home of http://sourceforge.net/projects/pyfmf
Contact: danperl@users.sourceforge.net
Downloads: http://sourceforge.net/project/showfiles.php?group_id=116235

pyfmf: a file management framework in python
Page Changed: 1/19/2005


http://www.python.org

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:
  1. Filters - filter files and directories.
  2. Processors - perform actions on files and directoires.  The actions performed on files and directories can include collecting data, modifying, storing, removing, etc.
  3. Loggers - log data based on the files and directories to a file.
  4. 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:
  1. 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.
  2. filterDirsPath - Filter.  Filters directories specified by full path.  Uses glob and paths can be configured with wildcards.  Configurable to filter in or out.
  3. 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.
  4. 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.
  5. filterFilesPath - Filter.  Filters out files specified by full path.  Uses glob and paths can be configured with wildcards.  Configurable to filter in or out.
  6. logAll - Logger.  Logs files and directories to a plain text file.  Particularly useful for testing and debugging.
  7. logFilesOnly - Logger.  Logs files to a plain text file.
  8. 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').
  9. 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.
  10. 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.
  11. procRemoveFiles - Processor.  Removes all the files that are passed in.
  12. procTarFiles - Processor.  Creates a 'tar.gz' file with all the files that are passed in.
  13. viewFilesPlain - Viewer.  Creates a plain list view of the files.
  14. viewDirsPlain - Viewer.  Creates a plain list view of the directories.