Fix #7459: Bug/error when copying and deleting from one library to another. Problem arose because field_metadata modified a class_level (static) attribute.

This commit is contained in:
Charles Haley 2010-11-27 11:30:52 +00:00
parent 6d07dc5850
commit a5cadce603

View File

@ -3,6 +3,7 @@ Created on 25 May 2010
@author: charles
'''
import copy
from calibre.utils.ordered_dict import OrderedDict
from calibre.utils.config import tweaks
@ -86,7 +87,7 @@ class FieldMetadata(dict):
# Builtin metadata {{{
_field_metadata = [
_field_metadata_prototype = [
('authors', {'table':'authors',
'column':'name',
'link_column':'author',
@ -322,6 +323,7 @@ class FieldMetadata(dict):
]
def __init__(self):
self._field_metadata = copy.deepcopy(self._field_metadata_prototype)
self._tb_cats = OrderedDict()
self._search_term_map = {}
self.custom_label_to_key_map = {}