Table Of Contents

This Page

Utilities

utils

FunkLoad common utils.

$Id: utils.py 24649 2005-08-29 14:20:19Z bdelbosc $

class funkload.utils.BaseFilter

Base filter.

class funkload.utils.Data(content_type, data)

Simple “sentinel” class that lets us identify user data and content type in POST

funkload.utils.close_logger(name)

Close the logger.

funkload.utils.create_daemon()

Detach a process from the controlling terminal and run it in the background as a daemon.

funkload.utils.extract_token(text, tag_start, tag_end)

Extract a token from text, using the first occurence of tag_start and ending with tag_end. Return None if tags are not found.

funkload.utils.get_default_logger(log_to, log_path=None, level=10, name='FunkLoad')

Get a logger.

funkload.utils.get_version()

Retrun the FunkLoad package version.

funkload.utils.get_virtualenv_script()

returns the path of the virtualenv.py script that is installed in the system. if it doesn’t exist returns None.

funkload.utils.green_str(text)

Return green text.

funkload.utils.is_html(text)

Simple check that return True if the text is an html page.

funkload.utils.is_valid_html(html=None, file_path=None, accept_warning=False)

Ask tidy if the html is valid.

Return a tuple (status, errors)

funkload.utils.mmn_decode(meta_method_name)

Decode a meta method name.

funkload.utils.mmn_encode(method_name, cycle, cvus, thread_id)

Encode a extra information into a method_name.

funkload.utils.mmn_is_bench(meta_method_name)

Is it a meta method name ?.

funkload.utils.package_tests(module_file)

this function will basically allow you to create a tarball of the current working directory (of tests) for transport over to a remote machine. It uses a few heuristics to avoid packaging log files.

funkload.utils.recording()

A semaphore to tell the running threads when to begin recording.

funkload.utils.red_str(text)

Return red text.

funkload.utils.set_recording_flag(value)

Enable recording.

funkload.utils.thread_sleep(seconds=0)

Sleep seconds.

funkload.utils.trace(message)

Simple print to stdout

Not thread safe.

class funkload.utils.truncate(length=40, extra='...')

Middle truncate string up to length.

funkload.utils.xmlrpc_get_credential(host, port, group=None)

Get credential thru xmlrpc credential_server.

funkload.utils.xmlrpc_get_seq(host, port)

Get credential thru xmlrpc credential_server.

funkload.utils.xmlrpc_list_credentials(host, port, group=None)

Get list of users thru xmlrpc credential_server.

funkload.utils.xmlrpc_list_groups(host, port)

Get list of groups thru xmlrpc credential_server.