commonutilslib package¶
Submodules¶
commonutilslib.commonutilslib module¶
Main code for commonutilslib.
-
class
commonutilslib.commonutilslib.
Hasher
(buffer_size=65536)[source]¶ Bases:
object
Calculated sha1 hashes for files and directories.
-
class
commonutilslib.commonutilslib.
Pushd
(directory_name)[source]¶ Bases:
object
Implements bash pushd capabilities.
-
cwd
= None¶
-
original_dir
= None¶
-
-
class
commonutilslib.commonutilslib.
RecursiveDictionary
[source]¶ Bases:
dict
Implements recursively updating dictionary.
RecursiveDictionary provides the methods rec_update and iter_rec_update that can be used to update member dictionaries rather than overwriting them.
-
commonutilslib.commonutilslib.
cd
(new_directory, clean_up=<function <lambda>>)[source]¶ Changes into a given directory and cleans up after it is done.
Parameters: - new_directory – The directory to change to
- clean_up – A method to clean up the working directory once done
-
commonutilslib.commonutilslib.
on_error
(func, path, exc_info)[source]¶ Error handler for
shutil.rmtree
.If the error is due to an access error (read only file) it attempts to add write permission and then retries.
If the error is for another reason it re-raises the error.
Usage :
shutil.rmtree(path, onerror=onerror)
# 2007/11/08 # Version 0.2.6 # pathutils.py # Functions useful for working with files and paths. # http://www.voidspace.org.uk/python/recipebook.shtml#utils
# Copyright Michael Foord 2004 # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml
# For information about bugfixes, updates and support, please join the Pythonutils mailing list. # http://groups.google.com/group/pythonutils/ # Comments, suggestions and bug reports welcome. # Scripts maintained at http://www.voidspace.org.uk/python/index.shtml # E-mail fuzzyman@voidspace.org.uk
commonutilslib.commonutilslibexceptions module¶
Custom exception code for commonutilslib.