Home | Trees | Index | Help |
|
---|
|
|
|||
StdoutRedirector | Redirect stdout to a temporary file. |
|
|||
run_cmd(cmd,
env=None)
Run command and return its return code and its output. |
|||
command_successful(cmd)
Returns True if command exited normally, False otherwise. |
|||
pad_with_dots(msg,
length=PAD_TEXT)
Pad text with dots up to given length. |
|||
pad_left_spaces(value,
length=PAD_VALUE)
Pad value with spaces at left up to given length. |
|||
pad_right_spaces(value,
length=PAD_VALUE)
Pad value with spaces at left up to given length. |
|||
pad_msg(msg,
value,
msg_length=PAD_TEXT,
value_length=PAD_VALUE)
Pad message with dots and pad value with spaces. |
|||
pad_line(char="=",
length=(PAD_TEXT+PAD_VALUE+1))
Return line consisting of 'char' characters. |
|||
unzip_package(package,
destination)
Unzip given package to the destination directory.
|
|||
untar_package(package,
destination)
Untar given package to the destination directory.
|
|||
unegg_package(package,
destination)
Unpack given egg to the destination directory.
|
|||
mkdirs(dir)
Make directory with parent directories as needed. |
|||
time_function(function)
Measure function execution time. |
|
|||
PAD_TEXT | |||
PAD_VALUE |
|
Run command and return its return code and its output. >>> run_cmd('/bin/true') (0, '') |
Returns True if command exited normally, False otherwise. >>> command_successful('/bin/true') True >>> command_successful('this-command-doesnt-exist') False |
Pad text with dots up to given length. >>> pad_with_dots("Hello world", 20) 'Hello world ........' >>> pad_with_dots("Exceeding length", 10) 'Exceeding length' |
Pad value with spaces at left up to given length. >>> pad_left_spaces(15, 4) ' 15' >>> pad_left_spaces(123456, 2) '123456' >>> len(pad_left_spaces("")) == PAD_VALUE True |
Pad value with spaces at left up to given length. >>> pad_right_spaces(123, 5) '123 ' >>> pad_right_spaces(12.1, 5) '12.1 ' |
Pad message with dots and pad value with spaces. >>> pad_msg("123456", 77, msg_length=10, value_length=4) '123456 ... 77' >>> pad_msg("123", u"45", msg_length=5, value_length=3) u'123 . 45' |
Return line consisting of 'char' characters. >>> pad_line('*', 3) '***' >>> pad_line(length=10) '==========' |
Unzip given Return name of unpacked directory or None on error. |
Untar given Return name of unpacked directory or None on error. |
Unpack given egg to the Return name of unpacked directory or None on error. |
Make directory with parent directories as needed. Don't throw an exception if directory exists. |
Measure function execution time. Return (return value, time taken) tuple. >>> def fun(x): ... return x*2 >>> ret, time_taken = time_function(lambda: fun(5)) >>> ret 10 |
|
PAD_TEXT
|
PAD_VALUE
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 3.0alpha2 on Sat Aug 12 02:53:38 2006 | http://epydoc.sf.net |