eric3.Utilities.__init__

Package implementing various functions/classes needed everywhere within eric3.

Classes

None

Functions

decode Function to decode a text.
direntries Function returning a list of all files and directories.
encode Function to encode a text.
escape Function to escape &, <, and > in a string of data.
escape_entities Function to encode a html entities.
getDirs Function returning a list of all directories below path.
getPythonLibPath Function to determine the path to Pythons library.
getPythonVersion Function to get the Python version (major, minor) as an integer value.
get_coding Function to get the coding of a text.
html_encode Function to correctly encode a text for html.
isinpath Function to check for an executable file.
joinext Function to join a file extension to a path.
normabsjoinpath Function returning a normalized, absolute path of the joined parts passed into it.
normabspath Function returning a normalized, absolute path.
normcasepath Function returning a path, that is normalized with respect to its case and references.
normjoinpath Function returning a normalized path of the joined parts passed into it.
parseOptionString Function used to convert an option string into a list of options.
samepath Function to compare two paths.
win32_Kill Function to provide an os.kill equivalent for Win32.

decode

decode(text)

Function to decode a text.

text
text to decode (string)
Returns:
decoded text
Up

direntries

direntries(path, filesonly=0, pattern=None, followsymlinks=1)

Function returning a list of all files and directories.

filesonly
flag indicating that only files are wanted
followsymlinks
flag indicating whether symbolic links should be followed
path
root of the tree to check
pattern
a filename pattern to check against
Returns:
list of all files and directories in the tree rooted at path. The names are expanded to start with path.
Up

encode

encode(text, orig_coding)

Function to encode a text.

orig_coding
type of the original coding (string)
text
text to encode (string)
Returns:
encoded text
Up

escape

escape(data)

Function to escape &, <, and > in a string of data.

data
data to be escaped (string)
Returns:
the escaped data (string)
Up

escape_entities

escape_entities(m, map=_escape_map)

Function to encode a html entities.

m
the match object
map
the map of entioties to encode
Returns:
the converted text (string)
Up

getDirs

getDirs(path, excludeDirs)

Function returning a list of all directories below path.

excludeDirs
basename of directories to ignore
path
root of the tree to check
Returns:
list of all directories found
Up

getPythonLibPath

getPythonLibPath()

Function to determine the path to Pythons library.

Returns:
path to the Python library (string)
Up

getPythonVersion

getPythonVersion()

Function to get the Python version (major, minor) as an integer value.

Returns:
An integer representing major and minor version number (integer)
Up

get_coding

get_coding(text)

Function to get the coding of a text.

text
text to inspect (string)
Returns:
coding string
Up

html_encode

html_encode(text, pattern=_escape)

Function to correctly encode a text for html.

pattern
search pattern for text to be encoded (string)
text
text to be encoded (string)
Returns:
the encoded text (string)
Up

isinpath

isinpath(file)

Function to check for an executable file.

file
filename of the executable to check (string)
Returns:
flag to indicate, if the executable file is accessible via the searchpath defined by the PATH environment variable.
Up

joinext

joinext(prefix, ext)

Function to join a file extension to a path.

The leading "." of ext is replaced by a platform specific extension separator if neccessary.

ext
the extension part (string)
prefix
the basepart of the filename (string)
Returns:
the complete filename (string)
Up

normabsjoinpath

normabsjoinpath(a, *p)

Function returning a normalized, absolute path of the joined parts passed into it.

a
first path to be joined (string)
p
variable number of path parts to be joind (string)
Returns:
absolute, normalized path (string)
Up

normabspath

normabspath(path)

Function returning a normalized, absolute path.

path
file path (string)
Returns:
absolute, normalized path (string)
Up

normcasepath

normcasepath(path)

Function returning a path, that is normalized with respect to its case and references.

path
file path (string)
Returns:
case normalized path (string)
Up

normjoinpath

normjoinpath(a, *p)

Function returning a normalized path of the joined parts passed into it.

a
first path to be joined (string)
p
variable number of path parts to be joind (string)
Returns:
normalized path (string)
Up

parseOptionString

parseOptionString(s)

Function used to convert an option string into a list of options.

s
option string (string or QString)
Returns:
list of options (list of strings)
Up

samepath

samepath(f1, f2)

Function to compare two paths.

f1
first path for the compare (string)
f2
second path for the compare (string)
Returns:
flag indicating whether the two paths represent the same path on disk.
Up

win32_Kill

win32_Kill(pid)

Function to provide an os.kill equivalent for Win32.

pid
process id
Up