Module factory
source code
factory methods to build real storage objects that conform to
base.py
|
_examine_txt(storefile)
Determine the true filetype for a .txt file |
source code
|
|
|
|
|
_getdummyname(storefile)
Provides a dummy name for a file object without a name attribute, by
guessing the file type. |
source code
|
|
|
|
|
getclass(storefile,
ignore=None)
Factory that returns the applicable class for the type of file
presented. |
source code
|
|
|
getobject(storefile,
ignore=None)
Factory that returns a usable object for the type of file presented. |
source code
|
|
list
|
|
|
BZ2File = None
Parse an instance of this class from the start of the given string.
|
|
support_xml = False
Parse an instance of this class from the start of the given string.
|
|
classes = {"csv": csvl10n.csvfile, "po": po.pofile, "pot": po....
Dictionary of file extensions and their associated class.
|
|
decompressclass = {'gz': GzipFile,}
|
|
hiddenclasses = {"txt": _examine_txt}
|
Imports:
os,
GzipFile,
sys,
base,
csvl10n,
mo,
po,
qm,
wordfast,
poxliff,
qph,
tbx,
tmx,
ts,
xliff
Guesses the type of a file object by looking at the first few
characters. The return value is a file extention .
|
Factory that returns the applicable class for the type of file
presented. Specify ignore to ignore some part at the back of the name
(like .gz).
|
Factory that returns a usable object for the type of file
presented.
- Parameters:
|
Returns data about all supported files
- Returns: list
- list of type that include (name, extensions, mimetypes)
|
classes
Dictionary of file extensions and their associated class.
_ext is a pseudo extension, that is their is no real extension by that
name.
- Value:
{"csv": csvl10n.csvfile, "po": po.pofile, "pot": po.pofile, "mo": mo.m
ofile, "gmo": mo.mofile, "qm": qm.qmfile, "_wftm": wordfast.WordfastTM
File,}
|
|