|
Package itools ::
Package handlers
|
|
Package handlers
This package provides an abstraction layer for files and directories.
There are two key concepts, resources and handlers.
A resource is anything that behaves like a file (it contains an array of
bytes), as a directory (it contains other resources) or as a link (it
contains a path or an uri to another resource). Doesn't matters wether
a resource lives in the local file system, in a database or is a remote
object accessed with an URI.
A resource handler adds specific semantics to different resources, for
example there is a handler to manage XML files, another to manage PO
files, etc...
|
|
checkid(id)
Turn a bytestring or unicode into an identifier only composed of
alphanumerical characters and a limited list of signs. |
|
|
|
|
| get_handler_class_by_mimetype(mimetype) |
|
|
|
|
|
|
|
make_git_database(path,
size_min,
size_max)
Create a new empty Git database if the given path does not exists or
is a folder. |
|
|
|
|
| register_handler_class(handler_class) |
|
|
|
|
ro_database = <itools.handlers.database.RODatabase object at 0...
|
|
Turn a bytestring or unicode into an identifier only composed of
alphanumerical characters and a limited list of signs.
It only supports Latin-based alphabets.
|
Tries to guess the encoding by brute force. It is likely to get
the wrong encoding, for example many utf8 files will be identified
as latin1.
|
make_git_database(path,
size_min,
size_max)
|
|
Create a new empty Git database if the given path does not exists or
is a folder.
If the given path is a folder with content, the Git archive will be
initialized and the content of the folder will be added to it in a first
commit.
|
ro_database
- Value:
<itools.handlers.database.RODatabase object at 0xeace90>
|
|