'Helper function to parse blocks of GNTP headers into a dictionary
@param data:
@return: Dictionary of headers'

def parse_dict(self, data):

    dict = {}
    for line in data.split('\r\n'):
        match = re.match('([\\w-]+):(.+)', line)
        if (not match):
            continue
        key = match.group(1).strip()
        val = match.group(2).strip()
        dict[key] = val
    return dict
