taggedFileDescriptors(cls,
directories,
taglist,
pattern=None)
Class Method
| source code
|
Finds tagged configuration files in given directories and return them.
The files retrieved can be files like "file.ext" or can contain tags. Tags are '.'
separated files tags that are to be matched with the tags in taglist in order.
All tags must match to retrieve a filepointer to the respective file.
Example Usage: you could give two paths, one is a global one in a read-only location,
another is a local one in the user's home (where you might have precreated a file already).
The list of filepointers returned would be all matching files from the global path and
all matching files from the local one, sorted such that the file with the smallest amount
of tags come first, files with more tags (more specialized ones) will come after that.
If fed into the readfp or the __init__ method, the individual file contents can override each other.
Once changes have been applied to the configuration, they can be written back to the writable
file pointers respectively.
- Parameters:
directories - [string(path) ...] of directories to look in for files
taglist - [string(tag) ...] of tags, like a tag for the operating system, or the user name
pattern - simple fnmatch pattern as used for globs or a list of them (allowing to match several
different patterns at once)
|