Commit Graph
16 Commits
Author SHA1 Message Date
Tom Samstag b6f9fbca9a remove gramps.gen.simple.by_date
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.
2017-01-01 11:46:04 -08:00
Tom Samstag ab79b26bec make EditPrimary, empty_object abstract
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.
2016-05-09 23:23:39 -07:00
Tom Samstag ea78dff2f2 make tag name map fix more readable
I think this version of the fix is more readable
2016-03-29 09:03:24 -07:00
Tom Samstag 607d4889d6 fix the name map of tags in DictionaryDb
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.
2016-03-29 08:32:18 -07:00
Tom Samstag ebbbe6b436 Initial batch of tests of filter rules
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.
2016-03-27 14:11:49 -07:00
Tom Samstag b96645084a add a filter to the tree of rule filters
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.
2016-03-14 00:05:13 -07:00
Tom Samstag 4b32841dd4 fix some crashes in export preview
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
2016-03-03 00:11:17 -08:00
Tom Samstag 4ff2cf30e2 fix handling of a None handle 2016-01-01 09:46:20 -08:00
Tom Samstag 92c2ddc33e remove unnecessary pass statements 2015-12-31 00:24:07 -08:00
Tom Samstag e9eedee5c6 change tabs to spaces 2015-12-31 00:08:42 -08:00
Tom Samstag 602ad1bc53 not x is None -> x is not None 2015-12-31 00:03:22 -08:00
Tom Samstag de8d8370e3 fixing else clauses on loops 2015-12-30 22:46:57 -08:00
Tom Samstag 4053d84a5f fix a raising of NotImplemented
It may not have caused any issues, but changing this from raising
NotImplemented to a NotImplementedError. Explanation about why this is
important at:
http://mouadino.appspot.com/notimpelementederror-vs-notimplemented-in-python/
2015-12-30 22:09:13 -08:00
Tom Samstag 4ac6d346f4 fixes for None handle errors: single-parent family
Fixes for Person lookups with None handles, related to the use of a
single-parent family
2015-12-29 10:42:00 -08:00
Tom Samstag c5daf38878 Fix for a None handle lookup in relview
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
2015-12-26 23:56:53 -08:00
Tom Samstag 62a95c936b add database plugins to package_core
Make sure the database addon and the bsddb_support code is installed.
Without this, Gramps crashes on startup.
2015-12-18 17:06:30 -08:00