Add Tag class to CallbackManager

svn: r21726
This commit is contained in:
Nick Hall 2013-03-23 22:26:25 +00:00
parent 8bbc216d17
commit 70f4ed3b32

View File

@ -48,6 +48,7 @@ SOURCEKEY = 'source'
CITATIONKEY = 'citation' CITATIONKEY = 'citation'
REPOKEY = 'repository' REPOKEY = 'repository'
NOTEKEY = 'note' NOTEKEY = 'note'
TAGKEY = 'tag'
ADD = '-add' ADD = '-add'
UPDATE = '-update' UPDATE = '-update'
@ -55,7 +56,7 @@ DELETE = '-delete'
REBUILD = '-rebuild' REBUILD = '-rebuild'
KEYS = [PERSONKEY, FAMILYKEY, EVENTKEY, PLACEKEY, MEDIAKEY, SOURCEKEY, KEYS = [PERSONKEY, FAMILYKEY, EVENTKEY, PLACEKEY, MEDIAKEY, SOURCEKEY,
CITATIONKEY, REPOKEY, NOTEKEY] CITATIONKEY, REPOKEY, NOTEKEY, TAGKEY]
METHODS = [ADD, UPDATE, DELETE, REBUILD] METHODS = [ADD, UPDATE, DELETE, REBUILD]
METHODS_LIST = [ADD, UPDATE, DELETE] METHODS_LIST = [ADD, UPDATE, DELETE]
@ -70,6 +71,7 @@ SOURCECLASS = 'Source'
CITATIONCLASS = 'Citation' CITATIONCLASS = 'Citation'
REPOCLASS = 'Repository' REPOCLASS = 'Repository'
NOTECLASS = 'Note' NOTECLASS = 'Note'
TAGCLASS = 'Tag'
CLASS2KEY = { CLASS2KEY = {
PERSONCLASS: PERSONKEY, PERSONCLASS: PERSONKEY,
@ -80,7 +82,8 @@ CLASS2KEY = {
SOURCECLASS: SOURCEKEY, SOURCECLASS: SOURCEKEY,
CITATIONCLASS: CITATIONKEY, CITATIONCLASS: CITATIONKEY,
REPOCLASS: REPOKEY, REPOCLASS: REPOKEY,
NOTECLASS: NOTEKEY NOTECLASS: NOTEKEY,
TAGCLASS: TAGKEY
} }
def _return(*args): def _return(*args):
@ -123,6 +126,7 @@ class CallbackManager(object):
CITATIONKEY: [], CITATIONKEY: [],
REPOKEY: [], REPOKEY: [],
NOTEKEY: [], NOTEKEY: [],
TAGKEY: [],
} }
#no custom callbacks to do #no custom callbacks to do
self.custom_signal_keys = [] self.custom_signal_keys = []
@ -206,6 +210,7 @@ class CallbackManager(object):
CITATIONKEY: [], CITATIONKEY: [],
REPOKEY: [], REPOKEY: [],
NOTEKEY: [], NOTEKEY: [],
TAGKEY: [],
} }
def register_callbacks(self, callbackdict): def register_callbacks(self, callbackdict):
@ -343,6 +348,7 @@ def directhandledict(baseobj):
CITATIONKEY: [], CITATIONKEY: [],
REPOKEY: [], REPOKEY: [],
NOTEKEY: [], NOTEKEY: [],
TAGKEY: [],
} }
for classn, handle in baseobj.get_referenced_handles(): for classn, handle in baseobj.get_referenced_handles():
handles[CLASS2KEY[classn]].append(handle) handles[CLASS2KEY[classn]].append(handle)
@ -363,6 +369,7 @@ def handledict(baseobj):
CITATIONKEY: [], CITATIONKEY: [],
REPOKEY: [], REPOKEY: [],
NOTEKEY: [], NOTEKEY: [],
TAGKEY: [],
} }
for classn, handle in baseobj.get_referenced_handles_recursively(): for classn, handle in baseobj.get_referenced_handles_recursively():
handles[CLASS2KEY[classn]].append(handle) handles[CLASS2KEY[classn]].append(handle)