Package libxyz :: Package vfs :: Module zip :: Class ZipVFSObject |
[hide private]
[frames] | no frames]

# Class ZipVFSObject

source code

          object --+
                   |
    vfsobj.VFSObject --+
                       |
                      ZipVFSObject

Zip archive interface

Instance Methods | [hide private]
either(self, a, b) | source code
__init__(self, *args, **kwargs) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
walk(self) Directory tree walker | source code
copy(self, path, existcb=None, errorcb=None, save_attrs=True, follow_links=False, cancel=None) Copy file to specified location | source code
_prepare(self) | source code
_normalize(self, path) Normalize path | source code
__str__(self) str(x) | source code
in_dir(self, d, e) Filter only those archive entries which exist in the same directory level | source code
_find_type(self) Find out file type | source code
_set_attributes(self) Set file attibutes | source code
_init_obj(self, altpath=None) | source code
_open_archive(self) | source code
_copy_file(self, src, dst, existcb, errorcb, save_attrs, follow_links, env, cancel=None, tarobj=None) File-to-file copy | source code
_copy_dir(self, src, dst, existcb, errorcb, save_attrs, follow_links, env, cancel=None, tarobj=None) Dir-to-dir copy | source code
_do_copy(self, src, dst, save_attrs, tarobj, obj) Copy file from inside archive | source code
_copystat(self, obj, dst) | source code
Inherited from `vfsobj.VFSObject`: `__repr__`, `__unicode__`, `is_block`, `is_char`, `is_dir`, `is_dir_empty`, `is_fifo`, `is_file`, `is_link`, `is_socket`, `mkdir`, `move`, `remove` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Class Variables | [hide private]
| get_name = `lambda self, x:`
| get_path = `lambda self, x:`
| file_type_map = `{lambda obj: obj.isfile(): vfstypes.VFSTypeFil`...``

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, *args, **kwargs) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__ (inherited documentation)

### walk(self) | source code
Directory tree walker Returns: tuple (parent, dir, dirs, files) where: parent - parent dir *VFSObject instance dir - current dir TarVFSObject instance dirs - list of TarVFSObject objects of directories files - list of TarVFSObject objects of files Overrides: vfsobj.VFSObject.walk

### copy(self, path, existcb=None, errorcb=None, save_attrs=True, follow_links=False, cancel=None) | source code
Copy file to specified location Parameters: `path` - Local path to copy file to `existcb` - Callback function to be called if there exists an object in target directory with the same name. Callback function receives VFSObject instance as an argument and must return one of: 'override' - to override this very object 'override all' - to override any future collisions 'skip' - to skip the object 'skip all' - to skip all future collisions 'abort' - to abort the process. If no existscb provided 'abort' is used as default `errorcb` - Callback function to be called in case an error occured during copying. Function receives VFSObject instance and error string as arguments and must return one of: 'skip' - to continue the process 'skip all' - to skip all future errors 'abort' - to abort the process. If no errorcb provided 'abort' is used as default `save_attrs` - Whether to save object attributes `follow_links` - Whether to follow symlinks `cancel` - a threading.Event instance, if it is found set - abort Overrides: vfsobj.VFSObject.copy (inherited documentation)

### _prepare(self) | source code
Overrides: vfsobj.VFSObject._prepare

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

Class Variable Details | [hide private]

  ### file_type_map Value:
      {lambda obj: obj.isfile(): vfstypes.VFSTypeFile(), lambda obj: obj.isd
      ir(): vfstypes.VFSTypeDir(), lambda obj: obj.issym(): vfstypes.VFSType
      Link(), lambda obj: obj.ischr(): vfstypes.VFSTypeChar(), lambda obj: o
      bj.isblk(): vfstypes.VFSTypeBlock(), lambda obj: obj.isfifo(): vfstype
      s.VFSTypeFifo(),}