def _parse_line(line):
    """If line is in the form Tag=value[#Comment] returns a (tag, value)
    tuple, otherwise returns None."""
    non_comment = line.split('#')[0].strip()
    if len(non_comment) > 0:
        tag_value = [x.strip() for x in non_comment.split('=')]
        if len(tag_value) != 2:
            raise Exception("Line '" + line + "' not understood")
        return (tag_value[0], tag_value[1])
    return None