From 842379e6db5761dc9b3115a2c14466333b6c1c63 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 21 May 2014 21:58:24 +0100 Subject: [PATCH] Revert [27453a] and [9d6049] Fix broken proxies and make proxies read-only. --- gramps/gen/db/dictionary.py | 10 ---------- gramps/gen/db/write.py | 16 ---------------- gramps/gen/proxy/living.py | 10 ---------- gramps/gen/proxy/private.py | 10 ---------- gramps/gen/proxy/proxybase.py | 4 ---- gramps/gen/proxy/referencedbyselection.py | 10 ---------- 6 files changed, 60 deletions(-) diff --git a/gramps/gen/db/dictionary.py b/gramps/gen/db/dictionary.py index 0bfb112ce..3bc9e6ae0 100644 --- a/gramps/gen/db/dictionary.py +++ b/gramps/gen/db/dictionary.py @@ -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) diff --git a/gramps/gen/db/write.py b/gramps/gen/db/write.py index 10e3ca685..6975f4ae6 100644 --- a/gramps/gen/db/write.py +++ b/gramps/gen/db/write.py @@ -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) diff --git a/gramps/gen/proxy/living.py b/gramps/gen/proxy/living.py index ed4c43d6d..68620ad5a 100644 --- a/gramps/gen/proxy/living.py +++ b/gramps/gen/proxy/living.py @@ -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): diff --git a/gramps/gen/proxy/private.py b/gramps/gen/proxy/private.py index 2b0875ef2..4f02ce2c5 100644 --- a/gramps/gen/proxy/private.py +++ b/gramps/gen/proxy/private.py @@ -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): diff --git a/gramps/gen/proxy/proxybase.py b/gramps/gen/proxy/proxybase.py index 8057978ed..229ca7a30 100644 --- a/gramps/gen/proxy/proxybase.py +++ b/gramps/gen/proxy/proxybase.py @@ -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 diff --git a/gramps/gen/proxy/referencedbyselection.py b/gramps/gen/proxy/referencedbyselection.py index 47914f396..29345d05e 100644 --- a/gramps/gen/proxy/referencedbyselection.py +++ b/gramps/gen/proxy/referencedbyselection.py @@ -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):