Parse an attribute string.

        Given a string with semicolon-separated key-value pairs, populate a
        dictionary with the given attributes.

def parse_attributes(self, attrstring):
        """
        Parse an attribute string.

        Given a string with semicolon-separated key-value pairs, populate a
        dictionary with the given attributes.
        """
        if attrstring in [None, '', '.']:
            return dict()

        attributes = dict()
        keyvaluepairs = attrstring.split(';')
        for kvp in keyvaluepairs:
            if kvp == '':
                continue
            key, value = kvp.split('=')
            if key == 'ID':
                assert ',' not in value
                attributes[key] = value
                continue
            values = value.split(',')
            valdict = dict((val, True) for val in values)
            attributes[key] = valdict
        return attributes