The function was deprecated in 8b39b80 (2012-11-15) but the deprecated
comment was somehow removed in 3ef1c02 (2013-11-12). The function won't
work anymore due to cmp not existing in python 3.
This makes EditPrimary an abstract class using abc.ABCMeta and marks
EditPrimary.empty_object as an abstract method. This moves the error
raised by forgetting to implement empty_object from when something
unsupported is done with its return (like .serialize()) to invocation
time, and provides a more obvious error.
DictionaryDb had a bug where the same tag could end up in the name
mapping multiple times. This was most easily seen when loading a gramps
xml into a DictionaryDb, where an extra entry with the tag name of ''
would be created and would ultimately be referencing the last-created
Tag (also referenced by its proper tag name). This change makes sure
that when editing a tag, any existing references in the name mapping are
deleted before adding.
After finding a bug in a filter that caused it to return incomplete
results in master (not yet patched), I decided to develop tests for the
filter rules. This first batch is all listed person filter rules that
either take no parameters or take a single ID parameter. I originally
wanted to use the smaller data.gramps instead of example.gramps, but
there were more unrepresented edge cases that wouldn't allow for testing
all filters (e.g. disconnected individuals).
All test values are based on what Gramps currently returns, with some
efforts made to try to verify the results. If the example.gramps file
changes, these tests will likely have to be updated. I tried to
cross-version validate them with v4.1, but the implementation of
DictionaryDb is too incomplete and many tests fail for unrelated
reasons.
I can never remember which category filters are in when making a new
rule. This change adds a filter entry above the treeview. As you type,
filters that do not contain the search text (case insensitively) are
made not visible. Categories are always visible, but will no longer
expand if all of their child nodes are hidden.
These issues were all found while trying to use the "Calculate Previews"
feature of the export wizard.
gen/proxy/referencedbyselection.py: ProxyDbBase need not define the
writable functions (add_*, commit_*, del_*) in its __tables. ProxyDbBase
doesn't have methods for add_person, etc, so this was causing an
AttributeError
gen/proxy/referencedbyselection.py: Add some handle checks to prevent
lookups on None handles
gen/proxy/proxybase.py: remove redundant test
If focusing on the relationship view with an empty tree loaded, an
uncaught exception was raised by attempting to call
get_person_from_handle with a None handle:
Traceback (most recent call last):
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/gui/viewmanager.py", line 1011, in view_changed
self.__change_page(page_num)
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/gui/viewmanager.py", line 1024, in __change_page
self.active_page.set_active()
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/gui/views/navigationview.py", line 154, in set_active
PageView.set_active(self)
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/gui/views/pageview.py", line 304, in set_active
self.build_tree()
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/plugins/view/relview.py", line 205, in build_tree
self.redraw()
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/plugins/view/relview.py", line 465, in redraw
self.change_person(None)
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/plugins/view/relview.py", line 470, in change_person
return self._change_person(obj)
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/plugins/view/relview.py", line 500, in _change_person
person = self.dbstate.db.get_person_from_handle(obj)
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/plugins/database/bsddb_support/read.py", line 723, in get_person_from_handle
return self.get_from_handle(handle, Person, self.person_map)
File "dev/gramps/installed/lib64/python3.4/site-packages/gramps/plugins/database/bsddb_support/write.py", line 2113, in get_from_handle
raise HandleError('Handle is None')
gramps.gen.errors.HandleError: Handle is None