Moved key maps to dbconst
This commit is contained in:
parent
5115cd13e4
commit
e7dc1a7bc4
@ -29,7 +29,7 @@ import base64
|
|||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
from gramps.gen.db import DbReadBase, DbWriteBase, DbTxn
|
from gramps.gen.db import DbReadBase, DbWriteBase, DbTxn, KEY_TO_NAME_MAP
|
||||||
from gramps.gen.utils.callback import Callback
|
from gramps.gen.utils.callback import Callback
|
||||||
from gramps.gen.updatecallback import UpdateCallback
|
from gramps.gen.updatecallback import UpdateCallback
|
||||||
from gramps.gen.db import (PERSON_KEY,
|
from gramps.gen.db import (PERSON_KEY,
|
||||||
@ -41,8 +41,7 @@ from gramps.gen.db import (PERSON_KEY,
|
|||||||
PLACE_KEY,
|
PLACE_KEY,
|
||||||
REPOSITORY_KEY,
|
REPOSITORY_KEY,
|
||||||
NOTE_KEY,
|
NOTE_KEY,
|
||||||
TAG_KEY,
|
TAG_KEY)
|
||||||
KEY_TO_NAME_MAP)
|
|
||||||
|
|
||||||
from gramps.gen.utils.id import create_id
|
from gramps.gen.utils.id import create_id
|
||||||
from gramps.gen.lib.researcher import Researcher
|
from gramps.gen.lib.researcher import Researcher
|
||||||
@ -1147,12 +1146,12 @@ class DictionaryDb(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
self.emit("tag-add", ([tag.handle],))
|
self.emit("tag-add", ([tag.handle],))
|
||||||
self.tag_map[tag.handle] = tag
|
self.tag_map[tag.handle] = tag
|
||||||
|
|
||||||
def commit_media_object(self, obj, transaction, change_time=None):
|
def commit_media_object(self, media, transaction, change_time=None):
|
||||||
if commit.handle in self.commit_map:
|
if media.handle in self.media_map:
|
||||||
self.emit("commit-update", ([commit.handle],))
|
self.emit("media-update", ([media.handle],))
|
||||||
else:
|
else:
|
||||||
self.emit("commit-add", ([commit.handle],))
|
self.emit("media-add", ([media.handle],))
|
||||||
self.media_map[obj.handle] = obj
|
self.media_map[media.handle] = media
|
||||||
|
|
||||||
def get_gramps_ids(self, obj_key):
|
def get_gramps_ids(self, obj_key):
|
||||||
key2table = {
|
key2table = {
|
||||||
|
@ -68,7 +68,7 @@ from gramps.gen.display.name import displayer as name_displayer
|
|||||||
from gramps.gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, SOURCE_KEY,
|
from gramps.gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, SOURCE_KEY,
|
||||||
EVENT_KEY, MEDIA_KEY, PLACE_KEY,
|
EVENT_KEY, MEDIA_KEY, PLACE_KEY,
|
||||||
REPOSITORY_KEY, NOTE_KEY, TAG_KEY,
|
REPOSITORY_KEY, NOTE_KEY, TAG_KEY,
|
||||||
CITATION_KEY)
|
CITATION_KEY, CLASS_TO_KEY_MAP)
|
||||||
from gramps.gen.updatecallback import UpdateCallback
|
from gramps.gen.updatecallback import UpdateCallback
|
||||||
from gramps.version import VERSION
|
from gramps.version import VERSION
|
||||||
from gramps.gen.config import config
|
from gramps.gen.config import config
|
||||||
|
Loading…
Reference in New Issue
Block a user