Package peppy :: Package vfs :: Package itools :: Package vfs :: Module base :: Class BaseFS
[frames] | no frames]

Class BaseFS

object --+
         |
        BaseFS
Known Subclasses:

Instance Methods

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

Class Methods
 
get_mimetype(cls, reference)
Try to guess the mimetype for a resource, given the resource itself and its name.
 
get_names(cls, reference)
 
is_folder(cls, reference)
 
traverse(cls, reference)
Static Methods
 
can_read(reference)
 
can_write(reference)
 
exists(reference)
 
find_local_cached(fstype, path)
 
get_atime(reference)
 
get_ctime(reference)
 
get_mtime(reference)
 
is_file(reference)
 
make_file(reference)
 
make_folder(reference)
 
move(source, target)
 
open(reference, mode=None)
 
remove(reference)
 
store_local_cache(fstype, path, obj)
Properties

Inherited from object: __class__

Method Details

get_mimetype(cls, reference)
Class Method

 

Try to guess the mimetype for a resource, given the resource itself and its name. To guess from the name we need to extract the type extension, we use an heuristic for this task, but it needs to be improved because there are many patterns:

<name> README <name>.<type> index.html <name>.<type>.<language> index.html.en <name>.<type>.<language>.<encoding> index.html.en.UTF-8 <name>.<type>.<compression> itools.tar.gz etc...

And even more complex, the name could contain dots, or the filename could start by a dot (a hidden file in Unix systems).

XXX Use magic numbers too (like file -i).