jube2.util package

jube2.util package

Submodules

jube2.util.output module

ASCII and string output generators

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

A more encoding friendly ElementTree.tostring method

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

Return formated value

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

Show a simple loading animation

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

Create an ASCII boxed version of text.

jube2.util.output.text_line()[source]

Return a horizonal ASCII line

jube2.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

jube2.util.util module

Utility functions, constants and classes

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

Bases: object

Allow comparison of different datatypes

property value
class jube2.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 jube2.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

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

Read environment var JUBE_GROUP_NAME and return group id

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

Do some consistency checks

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

Convert value to given type

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

Evaluate a bool expression

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

Return the highest id found in directory ‘base_dir’.

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

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

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

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

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

Return path for ‘id_number’ in ‘base_dir’.

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

Return current time string

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

Return timestamps dictionary

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

Generate a serialization of dependent steps.

Return a list with a possible order of execution.

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

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

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

cmd will be evaluated with given script language

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

Substitute templates given by parameter_dict inside of text

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

Set all timestamps for given arg_names to now

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

Check if tag_string contains only valid tags

jube2.util.yaml_converter module

YAML to XML converter

class jube2.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'], '/benchmark': ['benchmark', 'parameterset', 'fileset', 'substituteset', 'patternset', 'selection', 'include-path', 'check_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']}
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