def convert_str_to_key_value(string, separators=(':', '=')):
    """
    :param string: in 'foo:bar' or 'foo=bar' format
    :param separators:
    :return: (key, value)|(None, None)
    """
    sep = ''
    for s in separators:
        if s in string:
            sep = s
    if sep != '':
        array = [a.strip(' ') for a in string.split(sep)]
        return array[0], array[1]
    return None, None