easybuild.tools.convert module

This module implements all supported formats and their converters

author:Stijn De Weirdt (Ghent University)
exception easybuild.tools.convert.AllowedValueError

Bases: exceptions.ValueError

Specific type of error for non-allowed keys in DictOf classes.

class easybuild.tools.convert.Convert(obj)

Bases: vsc.utils.wrapper.Wrapper

Convert casts a string passed via the initialisation to a Convert (sub)class instance,
mainly for typechecking and printing purposes.
SEPARATOR = None
class easybuild.tools.convert.DictOfStrings(obj, separator_dict=None, separator_key_value=None, allowed_keys=None, raise_allowed=False)

Bases: easybuild.tools.convert.Convert

Convert string to dictionary with string values key/value pairs are separated via SEPARATOR_DICT key and value are separated via SEPARATOR_KEY_VALUE

ALLOWED_KEYS = None
KEYLESS_ENTRIES = []
SEPARATOR_DICT = ';'
SEPARATOR_KEY_VALUE = ':'
class easybuild.tools.convert.ListOfStrings(obj, separator_list=None)

Bases: easybuild.tools.convert.Convert

Convert str to list of strings

SEPARATOR_LIST = ','
class easybuild.tools.convert.ListOfStringsAndDictOfStrings(obj)

Bases: easybuild.tools.convert.Convert

Returns a list of strings and with last element a dict

ALLOWED_KEYS = None
SEPARATOR_DICT = ';'
SEPARATOR_KEY_VALUE = ':'
SEPARATOR_LIST = ','
easybuild.tools.convert.get_convert_class(class_name)

Return the Convert class with specified class name class_name