Check in the metadata class that custom field names begin with '#'

This commit is contained in:
Charles Haley 2010-09-11 09:21:29 +01:00
parent 035e1c66be
commit 4f01b09ded

View File

@ -156,6 +156,9 @@ class Metadata(object):
the key name not the label the key name not the label
''' '''
if field is not None: if field is not None:
if not field.startswith('#'):
raise AttributeError(
'Custom field name %s must begin with \'#\''%repr(field))
if metadata is None: if metadata is None:
traceback.print_stack() traceback.print_stack()
metadata = copy.deepcopy(metadata) metadata = copy.deepcopy(metadata)