| |
- Method resolution order:
- dfile
- dshell.Blob
- dshell.Data
- __builtin__.object
Methods defined here:
- __init__(self, mode=2, name=None, data=None, **kwargs)
- __iter__(self)
- Undefined
- __repr__(self)
- Returns filename (string)
- __str__(self)
- Returns filename (string)
- load(self)
- Load file from disk. Converts object to mode FILEINMEMORY
- md5(self)
- Returns md5 of file
Calculate based on reassembly from FILEINMEMORY
or loads from FILEONDISK
- update(self, data, offset=None)
- write(self, path='.', name=None, clobber=False, errorHandler=None, padding=None, overlap=True)
- Write file contents at location relative to path.
Name on disk will be based on internal name unless one is provided.
For mode FILEINMEMORY, file will data() will be called for reconstruction.
After writing to disk, mode will be changed to FILEONDISK.
If mode is already FILEONDISK, file will be moved to new location.
Methods inherited from dshell.Blob:
- data(self, errorHandler=None, padding=None, overlap=True, caller=None, dup=-1)
- returns segments of blob reassembled into a string
if next segment offset is not the expected offset
errorHandler(blob,expected,offset) will be called
blob is a reference to the blob
if expected<offset, data is missing
if expected>offset, data is overlapping
else a KeyError will be raised.
if the exception is passed and data is missing
if padding != None it will be used to fill the gap
if segment overlaps existing data
new data is kept if overlap=True
existing data is kept if overlap=False
caller: a ref to the calling object, passed to errorhandler
dup: how to handle duplicate segments:
0: use first segment seen
-1 (default): use last segment seen
Data and other attributes inherited from dshell.Blob:
- MAX_OFFSET = 4294967295L
Methods inherited from dshell.Data:
- __getitem__(self, k)
- __setitem__(self, k, v)
- info(self, *args, **kwargs)
- update/return info stored in this object
data can be passwd as dict(s) or keyword args
- pack(self, fmt, *args)
- packs info keys in args using fmt
- unpack(self, fmt, data, *args)
- unpacks data using fmt to keys listed in args
Data descriptors inherited from dshell.Data:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|