tmt/utils.py
def variables_to_dictionary(variables):
    """
    Convert shell-like variables into a dictionary

    Accepts single string or list of strings. Allowed forms are:
    'X=1'
    'X=1 Y=2 Z=3'
    ['X=1', 'Y=2', 'Z=3']
    ['X=1 Y=2 Z=3', 'A=1 B=2 C=3']
    'TXT="Some text with spaces in it"'
    """
    if not isinstance(variables, list):
        variables = [variables]
    result = dict()
    for variable in variables:
        if variable is None:
            continue
        for var in shlex.split(variable):
            matched = re.match("([^=]+)=(.*)", var)
            if not matched:
                raise GeneralError("Invalid parameter {0}".format(var))
            name, value = matched.groups()
            result[name] = value
    return result

    Convert shell-like variables into a dictionary

    Accepts single string or list of strings. Allowed forms are:
    'X=1'
    'X=1 Y=2 Z=3'
    ['X=1', 'Y=2', 'Z=3']
    ['X=1 Y=2 Z=3', 'A=1 B=2 C=3']
    'TXT="Some text with spaces in it"'
    
Convert shell-like variables into a dictionary
Accepts single string or list of strings.
Convert shell - like variables into a dictionary Accepts single string or list of strings .
def variables_to_dictionary(variables):
    if not isinstance(variables, list):
        variables = [variables]
    result = dict()
    for variable in variables:
        if variable is None:
            continue
        for var in shlex.split(variable):
            matched = re.match("([^=]+)=(.*)", var)
            if not matched:
                raise GeneralError("Invalid parameter {0}".format(var))
            name, value = matched.groups()
            result[name] = value
    return result
def variables_to_dictionary ( variables ) : if not isinstance ( variables , list ) : variables = [ variables ] result = dict ( ) for variable in variables : if variable is None : continue for var in shlex . split ( variable ) : matched = re . match ( "([^=]+)=(.*)" , var ) if not matched : raise GeneralError ( "Invalid parameter {0}" . format ( var ) ) name , value = matched . groups ( ) result [ name ] = value return result
Convert shell-like variables into a dictionary
Accepts single string or list of strings.
Convert shell - like variables into a dictionary Accepts single string or list of strings .
"""
    Convert shell-like variables into a dictionary

    Accepts single string or list of strings. Allowed forms are:
    'X=1'
    'X=1 Y=2 Z=3'
    ['X=1', 'Y=2', 'Z=3']
    ['X=1 Y=2 Z=3', 'A=1 B=2 C=3']
    'TXT="Some text with spaces in it"'
    """
variables