Home | Trees | Indices | Help |
|
---|
|
|
|||
| ToolsError | ||
| PickleError | ||
|
PseudoClass Empty class that raises an ImportError upon creation. |
||
|
Test Test class |
|
|||
|
errWriteln(s) print s to standard error with line feed. |
||
|
errWrite(s) print s to standard error. |
||
|
flushPrint(s) print s without line break and flush standard out. |
||
String
|
lastError() Collect type and line of last exception. |
||
| lastErrorTrace(limit=None) | ||
|
dictAdd(dic,
key,
value) Add value to dic, create list, if dic has already value in key. |
||
string
|
absfile(filename,
resolveLinks=1) Get absolute file path: |
||
str
|
homefile(filename,
otherUser=1,
ownCopy=1) Relativize a file name to ~ or, if it is in another user's home, to ~otheruser or, if it is in nobody's home, to / . |
||
(str, str)
|
splithome(filename) Split path into home directory and remaining path. |
||
str
|
stripSuffix(filename) Return file name without ending. |
||
str
|
stripFilename(filename) Return filename without path and without ending. |
||
int
|
fileLength(filename) Count number of lines in a file. |
||
str
|
tempDir() Get folder for temporary files - either from environment settings or '/tmp' |
||
|
file2dic(filename) Construct dictionary from file with key - value pairs (one per line). |
||
{<option> : <value>}
|
get_cmdDict(lst_cmd,
dic_default) Parse commandline options into dictionary of type {<option> : <value>} Options are recognised
by a leading '-'.
|
||
dic
|
cmdDict(defaultDic={}) Convenience implementation of get_cmdDict. |
||
|
Dump(this,
filename,
gzip=0,
mode='w') Dump this: |
||
|
Load(filename,
gzip=0) Load dumped object from file. |
||
(str, function)
|
getOnDemand(attr,
dumpIt=1) Return attr either unpickled, freshly calculated or unchanged. |
||
string
|
projectRoot() Root of biskit project. |
||
string
|
testRoot() Root of Biskit test directory. |
||
1|0
|
isBinary(f) Check if file is a binary. |
||
1|0
|
binExists(f) Check if binary with file name f exists. |
||
str
|
absbinary(f) Absolute path of binary. |
||
str
|
platformFolder(f) Get a platform-specific subfolder of f for platform-dependent imports. |
||
str
|
sortString(s) Sort the letters of a string: |
||
str
|
string2Fname(s) Remove forbidden character from string so that it can be used as a filename. |
||
[int]
|
toIntList(o) Convert single value or list of values into list of integers. |
||
Numeric.array('i')
|
toIntArray(o) Convert single value or list of values to Numeric array of int. |
||
[any]
|
toList(o) Make a list: |
||
[any]
|
toStr(o) Make a string from a list or interger. |
||
int OR None
|
toInt(o,
default=None) Convert to intereg if possible: |
||
[int]
|
colorSpectrum(nColors,
firstColor='FF0000',
lastColor='FF00FF') Creates a list of 'nColors' colors for biggles starting at 'firstColor' ending at 'lastColor' Examples: |
||
[ str ]
|
hexColors(nColors,
firstColor='FF0000',
lastColor='FF00FF') Creates a list of 'nColors' colors for PyMol starting at 'firstColor' ending at 'lastColor' Examples: |
||
str
|
rgb2hex(rgbColor) convert rgb color into 8 bit hex rgb color: |
||
[float]
|
hex2rgb(hexColor,
str=0) convert 8 bit hex rgb color into rgb color : |
||
str
|
dateString() Returns DD/MM/YYYY |
||
|
dateSortString() Returns YYYY/MM/DD:hh:mm.ss.ms |
||
1|0
|
tryRemove(f,
verbose=0,
tree=0,
wildcard=0) Remove file or folder: |
||
bool
|
backup(fname,
suffix='~') Create backup of file if it already exists. |
||
|
ensure(v,
t,
allowed=[],
forbidden=[]) Check type of a variable |
||
str
|
clipStr(s,
length,
suffix='..',
expandtabs=1) Shorten string from end and replace the last characters with suffix: |
||
|
info(item,
short=1) : |
||
bool
|
tryImport(module,
cls,
as=None,
namespace=None) Try to import a class from a module. |
||
bool
|
tryImportModule(module,
as=None,
namespace=None) Try to import a class from a module. |
|
|||
|
test = Test()
|
|
print s to standard error with line feed.
|
print s to standard error.
|
print s without line break and flush standard out.
|
Collect type and line of last exception.
|
|
Add value to dic, create list, if dic has already value in key.
|
Get absolute file path: - expand ~ to user home, change - expand ../../ to absolute path - resolve links - add working directory to unbound files ('ab.txt'->'/home/raik/ab.txt')
|
Relativize a file name to ~ or, if it is in another user's home, to ~otheruser or, if it is in nobody's home, to / . splithome() is used to also guess home directories of other users.
|
Split path into home directory and remaining path. Valid home directories are folders belonging to the same folder as the current user's home. I.e. the method tries also to guess home directories of other users.
|
Return file name without ending.
|
Return filename without path and without ending.
|
Count number of lines in a file.
|
Get folder for temporary files - either from environment settings or '/tmp'
|
Construct dictionary from file with key - value pairs (one per line).
|
Parse commandline options into dictionary of type
-x |file_name| is interpreted as file with
additional options. The key value pairs in lst_cmd replace key value
pairs in the -x file and in dic_default.
|
Convenience implementation of get_cmdDict. Take command line options from sys.argv[1:] and convert them into dictionary. Example: '-o out.dat -in 1.pdb 2.pdb 3.pdb -d' will be converted to {'o':'out.dat', 'in': ['1.pdb', '2.pdb', '3.pdb'], 'd':'' }Option -x |file_name| is interpreted as file with
additional options.
|
Dump this: Dump(this, filename, gzip = 0) Supports also '~' or '~user'.
|
Load dumped object from file.
|
Return attr either unpickled, freshly calculated or unchanged. If attr is no tuple or anything else goes wrong it is returned unchanged
|
Root of biskit project.
|
Root of Biskit test directory.
|
Check if file is a binary.
|
Check if binary with file name f exists.
|
Absolute path of binary.
|
Get a platform-specific subfolder of f for platform-dependent imports.
|
Sort the letters of a string: sortString( str ) -> str with sorted letters
|
Remove forbidden character from string so that it can be used as a filename.
|
Convert single value or list of values into list of integers.
|
Convert single value or list of values to Numeric array of int.
|
Make a list: toList(o) -> [o], or o, if o is already a list
|
Make a string from a list or interger. Stripping of any flanking witespaces.
|
Convert to intereg if possible: toInt(o) -> int, int(o) or default if o is impossible to convert.
|
Creates a list of 'nColors' colors for biggles starting at 'firstColor' ending at 'lastColor' Examples: free spectrum red FF0000 to green 00FF00 bound spectrum cyan 00FFFF to magenta FF00FF
|
Creates a list of 'nColors' colors for PyMol starting at 'firstColor' ending at 'lastColor' Examples: free spectrum red FF0000 to green 00FF00 bound spectrum cyan 00FFFF to magenta FF00FF
|
convert rgb color into 8 bit hex rgb color: [ 1.0, 0.0, 1.0, ] -> 'FF00FF'
|
convert 8 bit hex rgb color into rgb color : 'FF00FF' -> [ 1.0, 0.0, 1.0, ]
|
|
|
Remove file or folder: remove(f [,verbose=0, tree=0]), remove if possible, otherwise do nothing
|
Create backup of file if it already exists.
|
Check type of a variable
|
Shorten string from end and replace the last characters with suffix: clipStr( str, length ) -> str, with len( str ) <= length
|
: info( item, short=1) -> Print useful information about item.
|
Try to import a class from a module. If that fails, 'import' a default class of the same name that raises an exception when used.
|
Try to import a class from a module. If that fails, 'import' a default class of the same name that raises an exception when used.
|
|
test
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Fri Dec 22 20:11:39 2006 | http://epydoc.sourceforge.net |