Revert [27453a] and [9d6049]

Fix broken proxies and make proxies read-only.
This commit is contained in:
Nick Hall 2014-05-21 21:58:24 +01:00
parent 0319dc7490
commit 7bbbafe377
6 changed files with 0 additions and 60 deletions

View File

@ -119,7 +119,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_person_handles,
"add_func": self.add_person,
"commit_func": self.commit_person,
"remove_func": self.remove_person,
})
self._tables['Family'].update(
{
@ -130,7 +129,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_family_handles,
"add_func": self.add_family,
"commit_func": self.commit_family,
"remove_func": self.remove_family,
})
self._tables['Source'].update(
{
@ -141,7 +139,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_source_handles,
"add_func": self.add_source,
"commit_func": self.commit_source,
"remove_func": self.remove_source,
})
self._tables['Citation'].update(
{
@ -152,7 +149,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_citation_handles,
"add_func": self.add_citation,
"commit_func": self.commit_citation,
"remove_func": self.remove_citation,
})
self._tables['Event'].update(
{
@ -163,7 +159,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_event_handles,
"add_func": self.add_event,
"commit_func": self.commit_event,
"remove_func": self.remove_event,
})
self._tables['Media'].update(
{
@ -174,7 +169,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_media_object_handles,
"add_func": self.add_object,
"commit_func": self.commit_media_object,
"remove_func": self.remove_object,
})
self._tables['Place'].update(
{
@ -185,7 +179,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_place_handles,
"add_func": self.add_place,
"commit_func": self.commit_place,
"remove_func": self.remove_place,
})
self._tables['Repository'].update(
{
@ -196,7 +189,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_repository_handles,
"add_func": self.add_repository,
"commit_func": self.commit_repository,
"remove_func": self.remove_repository,
})
self._tables['Note'].update(
{
@ -207,7 +199,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_note_handles,
"add_func": self.add_note,
"commit_func": self.commit_note,
"remove_func": self.remove_note,
})
self._tables['Tag'].update(
{
@ -218,7 +209,6 @@ class DictionaryDb(DbWriteBase, DbReadBase):
"handles_func": self.get_tag_handles,
"add_func": self.add_tag,
"commit_func": self.commit_tag,
"remove_func": self.remove_tag,
})
# skip GEDCOM cross-ref check for now:
self.set_feature("skip-check-xref", True)

View File

@ -299,7 +299,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_person_handles,
"add_func": self.add_person,
"commit_func": self.commit_person,
"remove_func": self.remove_person,
})
self._tables['Family'].update(
{
@ -310,7 +309,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_family_handles,
"add_func": self.add_family,
"commit_func": self.commit_family,
"remove_func": self.remove_family,
})
self._tables['Source'].update(
{
@ -321,7 +319,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_source_handles,
"add_func": self.add_source,
"commit_func": self.commit_source,
"remove_func": self.remove_source,
})
self._tables['Citation'].update(
{
@ -332,7 +329,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_citation_handles,
"add_func": self.add_citation,
"commit_func": self.commit_citation,
"remove_func": self.remove_citation,
})
self._tables['Event'].update(
{
@ -343,7 +339,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_event_handles,
"add_func": self.add_event,
"commit_func": self.commit_event,
"remove_func": self.remove_event,
})
self._tables['Media'].update(
{
@ -354,7 +349,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_media_object_handles,
"add_func": self.add_object,
"commit_func": self.commit_media_object,
"remove_func": self.remove_object,
})
self._tables['Place'].update(
{
@ -365,7 +359,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_place_handles,
"add_func": self.add_place,
"commit_func": self.commit_place,
"remove_func": self.remove_place,
})
self._tables['Repository'].update(
{
@ -376,7 +369,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_repository_handles,
"add_func": self.add_repository,
"commit_func": self.commit_repository,
"remove_func": self.remove_repository,
})
self._tables['Note'].update(
{
@ -387,7 +379,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_note_handles,
"add_func": self.add_note,
"commit_func": self.commit_note,
"remove_func": self.remove_note,
})
self._tables['Tag'].update(
{
@ -398,7 +389,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_tag_handles,
"add_func": self.add_tag,
"commit_func": self.commit_tag,
"remove_func": self.remove_tag,
})
self.secondary_connected = False
@ -2448,12 +2438,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"""
return DbTxn
def remove_from_database(self, item, transaction):
"""
Remove the item from the database.
"""
self._tables[item.__class__.__name__]["remove_func"](item.handle, transaction)
def _mkname(path, name):
return os.path.join(path, name + DBEXT)

View File

@ -96,7 +96,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Person,
"cursor_func": self.get_person_cursor,
"handles_func": self.get_person_handles,
"remove_func": self.remove_person,
})
self._tables['Family'].update(
{
@ -105,7 +104,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Family,
"cursor_func": self.get_family_cursor,
"handles_func": self.get_family_handles,
"remove_func": self.remove_family,
})
self._tables['Source'].update(
{
@ -114,7 +112,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Source,
"cursor_func": self.get_source_cursor,
"handles_func": self.get_source_handles,
"remove_func": self.remove_source,
})
self._tables['Citation'].update(
{
@ -123,7 +120,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Citation,
"cursor_func": self.get_citation_cursor,
"handles_func": self.get_citation_handles,
"remove_func": self.remove_citation,
})
self._tables['Event'].update(
{
@ -132,7 +128,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Event,
"cursor_func": self.get_event_cursor,
"handles_func": self.get_event_handles,
"remove_func": self.remove_event,
})
self._tables['Media'].update(
{
@ -141,7 +136,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": MediaObject,
"cursor_func": self.get_media_cursor,
"handles_func": self.get_media_object_handles,
"remove_func": self.remove_object,
})
self._tables['Place'].update(
{
@ -150,7 +144,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Place,
"cursor_func": self.get_place_cursor,
"handles_func": self.get_place_handles,
"remove_func": self.remove_place,
})
self._tables['Repository'].update(
{
@ -159,7 +152,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Repository,
"cursor_func": self.get_repository_cursor,
"handles_func": self.get_repository_handles,
"remove_func": self.remove_repository,
})
self._tables['Note'].update(
{
@ -168,7 +160,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Note,
"cursor_func": self.get_note_cursor,
"handles_func": self.get_note_handles,
"remove_func": self.remove_note,
})
self._tables['Tag'].update(
{
@ -177,7 +168,6 @@ class LivingProxyDb(ProxyDbBase):
"class_func": Tag,
"cursor_func": self.get_tag_cursor,
"handles_func": self.get_tag_handles,
"remove_func": self.remove_tag,
})
def get_person_from_handle(self, handle):

View File

@ -63,7 +63,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Person,
"cursor_func": self.get_person_cursor,
"handles_func": self.get_person_handles,
"remove_func": self.remove_person,
})
self._tables['Family'].update(
{
@ -72,7 +71,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Family,
"cursor_func": self.get_family_cursor,
"handles_func": self.get_family_handles,
"remove_func": self.remove_family,
})
self._tables['Source'].update(
{
@ -81,7 +79,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Source,
"cursor_func": self.get_source_cursor,
"handles_func": self.get_source_handles,
"remove_func": self.remove_source,
})
self._tables['Citation'].update(
{
@ -90,7 +87,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Citation,
"cursor_func": self.get_citation_cursor,
"handles_func": self.get_citation_handles,
"remove_func": self.remove_citation,
})
self._tables['Event'].update(
{
@ -99,7 +95,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Event,
"cursor_func": self.get_event_cursor,
"handles_func": self.get_event_handles,
"remove_func": self.remove_event,
})
self._tables['Media'].update(
{
@ -108,7 +103,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": MediaObject,
"cursor_func": self.get_media_cursor,
"handles_func": self.get_media_object_handles,
"remove_func": self.remove_object,
})
self._tables['Place'].update(
{
@ -117,7 +111,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Place,
"cursor_func": self.get_place_cursor,
"handles_func": self.get_place_handles,
"remove_func": self.remove_place,
})
self._tables['Repository'].update(
{
@ -126,7 +119,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Repository,
"cursor_func": self.get_repository_cursor,
"handles_func": self.get_repository_handles,
"remove_func": self.remove_repository,
})
self._tables['Note'].update(
{
@ -135,7 +127,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Note,
"cursor_func": self.get_note_cursor,
"handles_func": self.get_note_handles,
"remove_func": self.remove_note,
})
self._tables['Tag'].update(
{
@ -144,7 +135,6 @@ class PrivateProxyDb(ProxyDbBase):
"class_func": Tag,
"cursor_func": self.get_tag_cursor,
"handles_func": self.get_tag_handles,
"remove_func": self.remove_tag,
})
def get_person_from_handle(self, handle):

View File

@ -472,10 +472,6 @@ class ProxyDbBase(DbReadBase):
setattr(self, name, attr)
return attr
if sname[0] == 'remove':
# Default behaviour: lookup attribute in parent object
return getattr(self.db, name)
# if a write-method:
if (name in DbWriteBase.__dict__ and
not name.startswith("__") and

View File

@ -88,7 +88,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Person,
"cursor_func": self.get_person_cursor,
"handles_func": self.get_person_handles,
"remove_func": self.remove_person,
})
self._tables['Family'].update(
{
@ -97,7 +96,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Family,
"cursor_func": self.get_family_cursor,
"handles_func": self.get_family_handles,
"remove_func": self.remove_family,
})
self._tables['Source'].update(
{
@ -106,7 +104,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Source,
"cursor_func": self.get_source_cursor,
"handles_func": self.get_source_handles,
"remove_func": self.remove_source,
})
self._tables['Citation'].update(
{
@ -115,7 +112,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Citation,
"cursor_func": self.get_citation_cursor,
"handles_func": self.get_citation_handles,
"remove_func": self.remove_citation,
})
self._tables['Event'].update(
{
@ -124,7 +120,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Event,
"cursor_func": self.get_event_cursor,
"handles_func": self.get_event_handles,
"remove_func": self.remove_event,
})
self._tables['Media'].update(
{
@ -133,7 +128,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": MediaObject,
"cursor_func": self.get_media_cursor,
"handles_func": self.get_media_object_handles,
"remove_func": self.remove_object,
})
self._tables['Place'].update(
{
@ -142,7 +136,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Place,
"cursor_func": self.get_place_cursor,
"handles_func": self.get_place_handles,
"remove_func": self.remove_place,
})
self._tables['Repository'].update(
{
@ -151,7 +144,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Repository,
"cursor_func": self.get_repository_cursor,
"handles_func": self.get_repository_handles,
"remove_func": self.remove_repository,
})
self._tables['Note'].update(
{
@ -160,7 +152,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Note,
"cursor_func": self.get_note_cursor,
"handles_func": self.get_note_handles,
"remove_func": self.remove_note,
})
self._tables['Tag'].update(
{
@ -169,7 +160,6 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"class_func": Tag,
"cursor_func": self.get_tag_cursor,
"handles_func": self.get_tag_handles,
"remove_func": self.remove_tag,
})
def queue_object(self, obj_type, handle, reference=True):