Package libxyz :: Package vfs :: Module local :: Class LocalVFSObject
[hide private]
[frames] | no frames]

Class LocalVFSObject

source code

      object --+    
               |    
vfsobj.VFSObject --+
                   |
                  LocalVFSObject

Local VFS object is used to access local filesystem

Instance Methods [hide private]
 
walk(self)
Directory tree walker
source code
 
remove(self, recursive=True)
[Recursively] remove object
source code
 
mkdir(self, newdir)
Create new dir inside object (only valid for directory object types)
source code
 
copy(self, path, existcb=None, errorcb=None, save_attrs=True, follow_links=False, cancel=None)
Copy file to specified location
source code
 
move(self, path, existcb=None, errorcb=None, save_attrs=True, follow_links=False, cancel=None)
Move object
source code
 
_prepare(self) source code
 
__str__(self)
str(x)
source code
 
_uid(self, uid) source code
 
_gid(self, gid) source code
 
_find_type(self, path)
Find out file type
source code
 
_set_attributes(self)
Set file attibutes
source code
 
_copy_file(self, src, dst, existcb, errorcb, save_attrs, follow_links, env, cancel=None)
File-to-file copy
source code
 
_copy_dir(self, src, dst, existcb, errorcb, save_attrs, follow_links, env, cancel=None)
Dir-to-dir copy
source code

Inherited from vfsobj.VFSObject: __init__, __repr__, __unicode__, is_block, is_char, is_dir, is_dir_empty, is_fifo, is_file, is_link, is_socket

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

walk(self)

source code 

Directory tree walker

Returns:
tuple (parent, dir, dirs, files) where: parent - parent dir LocalVFSObject instance dir - current LocalVFSObject instance dirs - list of LocalVFSObject objects of directories files - list of LocalVFSObject objects of files
Overrides: vfsobj.VFSObject.walk

remove(self, recursive=True)

source code 

[Recursively] remove object

Overrides: vfsobj.VFSObject.remove

mkdir(self, newdir)

source code 

Create new dir inside object (only valid for directory object types)

Overrides: vfsobj.VFSObject.mkdir

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)

move(self, path, existcb=None, errorcb=None, save_attrs=True, follow_links=False, cancel=None)

source code 

Move object

Overrides: vfsobj.VFSObject.move

_prepare(self)

source code 
Overrides: vfsobj.VFSObject._prepare

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)