Package conduit :: Module Vfs
[hide private]

Module Vfs

source code

Classes [hide private]
  FileMonitor
  VolumeMonitor
  FolderScannerThreadManager
Manages many FolderScanner threads.
  FolderScanner
Recursively scans a given folder URI, returning the number of contained files.
Functions [hide private]
 
uri_is_valid(uri)
(weakly) checks if a uri is valid by looking for a scheme seperator
source code
 
uri_join(first, *rest)
Joins multiple uri components.
source code
 
uri_get_relative(fromURI, toURI)
Returns the relative path fromURI --> toURI
source code
 
uri_open(uri)
Opens a gnomevfs or xdg compatible uri.
source code
 
uri_to_local_path(uri)
Returns: The local path (/foo/bar) for the given URI.
source code
 
uri_get_volume_root_uri(uri)
Returns: The root path of the volume at the given uri, or None
source code
 
uri_is_on_removable_volume(uri)
Returns: True if the specified uri is on a removable volume, like a USB key or removable/mountable disk.
source code
 
uri_get_filesystem_type(uri)
Returns: The filesystem that uri is stored on or None if it cannot be determined
source code
 
uri_make_canonical(uri)
Standardizes the format of the uri
source code
 
uri_escape(uri)
Escapes a uri, replacing only special characters that would not be found in paths or host names.
source code
 
uri_unescape(uri)
Replace "%xx" escapes by their single-character equivalent.
source code
 
uri_get_protocol(uri)
Returns the protocol (file, smb, etc) for a URI
source code
 
uri_get_filename(uri)
Method to return the filename of a file.
source code
 
uri_get_filename_and_extension(uri)
Returns filename,file_extension
source code
 
uri_sanitize_for_filesystem(uri, filesystem=None)
Removes illegal characters in uri that cannot be stored on the given filesystem - particuarly fat and ntfs types
source code
 
uri_is_folder(uri)
Returns: True if the uri is a folder and not a file
source code
 
uri_format_for_display(uri)
Formats the uri so it can be displayed to the user (strips passwords, etc)
source code
 
uri_exists(uri)
Returns: True if the uri exists
source code
 
uri_make_directory(uri)
Makes a directory with the default permissions.
source code
 
uri_make_directory_and_parents(uri)
Because gnomevfs.make_dir does not perform as mkdir -p this function is required to make a heirarchy of directories.
source code
Variables [hide private]
  log = logging.getLogger("Vfs")
  CONFIG_FILE_NAME = ".conduit.conf"
Function Details [hide private]

uri_join(first, *rest)

source code 
Joins multiple uri components. Performs safely if the first argument contains a uri scheme

uri_to_local_path(uri)

source code 
Returns:
The local path (/foo/bar) for the given URI. Throws a RuntimeError (wtf??) if the uri is not a local one

uri_get_volume_root_uri(uri)

source code 
Returns:
The root path of the volume at the given uri, or None

uri_is_on_removable_volume(uri)

source code 
Returns:
True if the specified uri is on a removable volume, like a USB key or removable/mountable disk.

uri_get_filesystem_type(uri)

source code 
Returns:
The filesystem that uri is stored on or None if it cannot be determined

uri_make_canonical(uri)

source code 
Standardizes the format of the uri
Parameters:
  • uri - an absolute or relative stringified uri. It might have scheme.

uri_escape(uri)

source code 
Escapes a uri, replacing only special characters that would not be found in paths or host names. (so '/', '&', '=', ':' and '@' will not be escaped by this function)

uri_get_filename(uri)

source code 
Method to return the filename of a file. Could use GnomeVFS for this is it wasnt so slow

uri_is_folder(uri)

source code 
Returns:
True if the uri is a folder and not a file

uri_exists(uri)

source code 
Returns:
True if the uri exists

uri_make_directory(uri)

source code 
Makes a directory with the default permissions. Does not catch any error

uri_make_directory_and_parents(uri)

source code 
Because gnomevfs.make_dir does not perform as mkdir -p this function is required to make a heirarchy of directories.
Parameters:
  • uri (str) - A directory that does not exist