'utility: return the header of a .po file as a dictionary'

def get_header(self, data):

    headers = {}
    for line in data.split('\n'):
        if ((not line) or line.startswith(('#', 'msgid', 'msgstr'))):
            continue
        line = line.strip('"')
        (key, val) = line.split(':', 1)
        headers[key] = val.strip()
    return headers
