Classes | |
class | FileUtilsException |
Functions | |
def | updateConfigurationFromFile |
def | findNextNewDirectoryName |
def | checkDirectory |
def | checkFile |
def | convertIntoFileName |
def | filesAllExist |
def | isContent |
def | isGraphics |
def | isSound |
def | getParentDirectory |
def | getChildrenDirectories |
def | getFilesInDir |
def | getDirectoryElements |
def | addPrefixToFileList |
def | scanDirectoryForContent |
def | getAllFilePathsFromRoot |
def | getAllRelativeFilePathsFromRoot |
def | getAllRelativeFilePathsFromRootHelper |
def | getMD5codeFor |
def | backup |
Variables | |
string | __file__ = 'fileUtils.py' |
string | __title__ = 'This module helps managing files and directories.' |
string | __version__ = '0.1' |
string | __author__ = 'Olivier Boudeville (olivier.boudeville@online.fr)' |
string | __project__ = 'Ceylan' |
string | __creationDate__ = '2004, February 1' |
string | __comments__ = "" |
string | __source__ = 'Mark Pilgrim, http://diveintopython.org/, and al.' |
string | __doc__ = '\n' |
def fileUtils::addPrefixToFileList | ( | prefix, | ||
filesList | ||||
) |
All files or directories in filesList will be prefixed with prefix.
Definition at line 153 of file fileUtils.py.
def fileUtils::backup | ( | fileToBackup | ) |
Backups a file. Non-existing file will be ignored. Backup file will have the suffix '.bak'.
Definition at line 223 of file fileUtils.py.
def fileUtils::checkDirectory | ( | directoryName | ) |
Checks if corresponding directory exists. If not, raises FileUtilsException.
Definition at line 63 of file fileUtils.py.
def fileUtils::checkFile | ( | filename | ) |
Checks if corresponding file exists. If not, raises FileUtilsException.
Definition at line 73 of file fileUtils.py.
def fileUtils::convertIntoFileName | ( | name | ) |
Converts specified name into a valid filename for most file systems.
Definition at line 82 of file fileUtils.py.
def fileUtils::filesAllExist | ( | filenamesList | ) |
Returns true if and only if all files in the list exist.
Definition at line 88 of file fileUtils.py.
def fileUtils::findNextNewDirectoryName | ( | destinationPrefix | ) |
Returns a unique name : find next possible new directory name by adding increasing numbers to the end of the names of pre existing ones. Example : OSDL-data -> OSDL-data-1, OSDL-data-17 -> OSDL-data-18
Definition at line 49 of file fileUtils.py.
def fileUtils::getAllFilePathsFromRoot | ( | directoryName | ) |
Returns a list of all files relative paths found from specified directory.
Definition at line 178 of file fileUtils.py.
def fileUtils::getAllRelativeFilePathsFromRoot | ( | directoryName | ) |
Definition at line 194 of file fileUtils.py.
def fileUtils::getAllRelativeFilePathsFromRootHelper | ( | directorySuffixName, | ||
baseRoot | ||||
) |
Returns a list of all files relative paths found from specified directory.
Definition at line 198 of file fileUtils.py.
def fileUtils::getChildrenDirectories | ( | directoryName | ) |
Returns a list made of the (relative) names of the children directories of directoryName.
Definition at line 119 of file fileUtils.py.
def fileUtils::getDirectoryElements | ( | directoryName | ) |
Returns a pair, the list of subdirectories of directoryName and the list of the files in directoryName, all of them relatively to that directory, no absolute path.
Definition at line 136 of file fileUtils.py.
def fileUtils::getFilesInDir | ( | directoryName | ) |
Returns a list made of the (relative) names of the files in directory directoryName.
Definition at line 126 of file fileUtils.py.
def fileUtils::getMD5codeFor | ( | file_path | ) |
"Returns the MD5 code corresponding to the file in specified path.
Definition at line 216 of file fileUtils.py.
def fileUtils::getParentDirectory | ( | directoryName | ) |
Returns the name of the parent directory of directoryName.
Definition at line 114 of file fileUtils.py.
def fileUtils::isContent | ( | filename | ) |
Returns true if and only if filename corresponds to a content file.
Definition at line 97 of file fileUtils.py.
def fileUtils::isGraphics | ( | filename | ) |
Returns true if and only if filename corresponds to a picture file.
Definition at line 102 of file fileUtils.py.
def fileUtils::isSound | ( | filename | ) |
Returns true if and only if filename corresponds to a sound file.
Definition at line 108 of file fileUtils.py.
def fileUtils::scanDirectoryForContent | ( | directoryName | ) |
Scans provided directory and return a 3-item tuple with graphics files, sound files and other files that were spotted.
Definition at line 159 of file fileUtils.py.
def fileUtils::updateConfigurationFromFile | ( | configDic, | ||
configFile | ||||
) |
Updates configuration dictionary 'configDic' with informations found in file 'configFile'. Warning : uppercase letters should not be used in configuration files, since ConfigParser downcase them.
Definition at line 26 of file fileUtils.py.
string fileUtils::__author__ = 'Olivier Boudeville (olivier.boudeville@online.fr)' |
Definition at line 7 of file fileUtils.py.
string fileUtils::__comments__ = "" |
Definition at line 10 of file fileUtils.py.
string fileUtils::__creationDate__ = '2004, February 1' |
Definition at line 9 of file fileUtils.py.
string fileUtils::__doc__ = '\n' |
Definition at line 12 of file fileUtils.py.
string fileUtils::__file__ = 'fileUtils.py' |
Definition at line 4 of file fileUtils.py.
string fileUtils::__project__ = 'Ceylan' |
Definition at line 8 of file fileUtils.py.
string fileUtils::__source__ = 'Mark Pilgrim, http://diveintopython.org/, and al.' |
Definition at line 11 of file fileUtils.py.
string fileUtils::__title__ = 'This module helps managing files and directories.' |
Definition at line 5 of file fileUtils.py.
string fileUtils::__version__ = '0.1' |
Definition at line 6 of file fileUtils.py.