jube.util package

jube.util package

Submodules

jube.util.output module

ASCII and string output generators

jube.util.output.element_tree_tostring(element, encoding=None)[source]

A more encoding friendly ElementTree.tostring method

jube.util.output.format_value(format_string, value)[source]

Return formated value

jube.util.output.print_loading_bar(current_cnt, all_cnt, wait_cnt=0, error_cnt=0)[source]

Show a simple loading animation

jube.util.output.text_boxed(text)[source]

Create an ASCII boxed version of text.

jube.util.output.text_line(char='#')[source]

Return a horizonal ASCII line

jube.util.output.text_table(entries_ext, use_header_line=False, indent=1, align_right=True, auto_linebreak=True, colw=None, style='pretty', separator=None, transpose=False)[source]

Create a ASCII based table. entries must contain a list of lists, use_header_line can be used to mark the first entry as title.

Return the ASCII table

jube.util.util module

Utility functions, constants and classes

class jube.util.util.CompType(value)[source]

Bases: object

Allow comparison of different datatypes

property value
class jube.util.util.Queue[source]

Bases: object

Queue based on collections.dequeue

empty()[source]

Return True if the queue is empty, False otherwise

get_nowait()[source]

Dequeues (i.e., removes) the item from the right side of this queue and returns this item.

Raises

IndexError

If this queue is empty.

put(item)[source]

Add this item to the left of this queue.

put_first(item)[source]

Add this item to the left of this queue.

class jube.util.util.WorkStat[source]

Bases: object

Workpackage queuing handler

empty()[source]

Check if work queue is empty

get()[source]

Get some workpackage from work queue

push_back(wp)[source]

push element to the first position of the queue

put(workpackage)[source]

Add some workpackage to queue

update_queues(last_workpackage)[source]

Check if a workpackage can move from waiting to work queue

jube.util.util.check_and_get_benchmark_outpath()[source]

Read environment var JUBE_BENCHMARK_OUTPATH and return outpath

jube.util.util.check_and_get_group_id()[source]

Read environment var JUBE_GROUP_NAME and return group id

jube.util.util.check_and_get_verbose_level()[source]

Read environment var JUBE_VERBOSE and return verbose level

jube.util.util.consistency_check(benchmark)[source]

Do some consistency checks

jube.util.util.convert_type(name, value_type, value, stop=True)[source]

Convert value to given type

jube.util.util.ensure_list(element)[source]
jube.util.util.eval_bool(cmd)[source]

Evaluate a bool expression

jube.util.util.expand_dollar_count(text)[source]
jube.util.util.get_current_id(base_dir)[source]

Return the highest id found in directory ‘base_dir’.

jube.util.util.get_tree_element(node, tag_path=None, attribute_dict=None)[source]

Can be used instead of node.find(.//tag_path[@attrib=value])

jube.util.util.get_tree_elements(node, tag_path=None, attribute_dict=None)[source]

Can be used instead of node.findall(.//tag_path[@attrib=value])

jube.util.util.id_dir(base_dir, id_number)[source]

Return path for ‘id_number’ in ‘base_dir’.

jube.util.util.now_str()[source]

Return current time string

jube.util.util.read_timestamps(path)[source]

Return timestamps dictionary

jube.util.util.resolve_depend(depend_dict)[source]

Generate a serialization of dependent steps.

Return a list with a possible order of execution.

jube.util.util.safe_split(text, separator)[source]

Like split for non-empty separator, list with text otherwise.

jube.util.util.script_evaluation(cmd, script_type)[source]

cmd will be evaluated with given script language

jube.util.util.substitution(text, substitution_dict)[source]

Substitute templates given by parameter_dict inside of text

jube.util.util.update_timestamps(path, *args)[source]

Set all timestamps for given arg_names to now

jube.util.util.valid_tags(tag_string, tags)[source]

Check if tag_string contains only valid tags

jube.util.yaml_converter module

YAML to XML converter

class jube.util.yaml_converter.YAML_Converter(path, include_path=None, tags=None)[source]

Bases: object

YAML to XML converter

allowed_tags = {'/': ['benchmark', 'parameterset', 'comment', 'step', 'fileset', 'substituteset', 'analyser', 'result', 'patternset', 'selection', 'include-path', 'check_tags', 'tags'], '/benchmark': ['benchmark', 'parameterset', 'fileset', 'substituteset', 'patternset', 'selection', 'include-path', 'check_tags', 'tags'], 'analyse': ['file'], 'analyser': ['use', 'analyse'], 'benchmark': ['parameterset', 'comment', 'step', 'fileset', 'substituteset', 'analyser', 'result', 'patternset'], 'database': ['key'], 'fileset': ['link', 'copy', 'prepare'], 'include-path': ['path'], 'parameterset': ['parameter'], 'patternset': ['pattern'], 'result': ['use', 'table', 'syslog', 'database'], 'selection': ['not', 'only', 'tag'], 'step': ['use', 'do'], 'substituteset': ['iofile', 'sub'], 'syslog': ['key'], 'table': ['column'], 'tags': ['check_tags', 'tag']}
close()[source]

Close converted file

static create_headtags(data, parent_node, include_pathes)[source]

Search for the headtags in given dictionary

static create_tag(new_node_name, data, parent_node)[source]

Create the Subtag name, search for known tags and set the given attributes

static is_parseable_yaml_file(filename)[source]
read()[source]

Read data of converted file