mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Check in the metadata class that custom field names begin with '#'
This commit is contained in:
parent
035e1c66be
commit
4f01b09ded
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user