Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New [RemoveTagTool] addon [gramps50] #211

Merged

Conversation

Mattkmmr
Copy link
Member

@Mattkmmr Mattkmmr commented Jun 19, 2019

The Remove Tag Tool addon allows users to remove a tag from a group of objects e.g. persons, events, media. More information (=Wiki Article)

@sam-m888
Copy link
Member

sam-m888 commented Jul 4, 2019

Thanks for the addon, a very useful addition.

While testing I've come across the following two errors that lock Gramps up and requires you to use task manager etc to kill gramps. The first happens if you create a new empty family tree and attempt to use the tool, the other happens if you attempt to run the tool on an existing family tree that has no Tags at all or if you repeatably remove the tags with the tool one by one until none are left.


On an Empty Family Tree the tool fails to start at all:

2019-07-04 10:41:23.670: WARNING: _enumeratedlist.py: line 143: Value '0' not found for option 'Remove Tag'
2019-07-04 10:41:23.671: WARNING: _enumeratedlist.py: line 144: Valid values: []
2019-07-04 10:41:23.677: ERROR: tool.py: line 257: Failed to start tool.
Traceback (most recent call last):
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug\tool.py", line 253, in gui_tool
callback = callback)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_windows.py", line 1060, in init
options_class, name, callback)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_windows.py", line 765, in init
self.add_user_options()
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_windows.py", line 1044, in add_user_options
add_gui_options(self)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_guioptions.py", line 2025, in add_gui_options
dialog.uistate, dialog.track)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_guioptions.py", line 2004, in make_gui_option
widget = widget(option, dbstate, uistate, track, override)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_guioptions.py", line 786, in init
self.__initialize_family(override)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_guioptions.py", line 820, in __initialize_family
person = self.__dbstate.db.get_person_from_handle(person_handle)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\plugins\db\bsddb\read.py", line 691, in get_person_from_handle
return self._get_from_handle(handle, Person, self.person_map)
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\plugins\db\bsddb\read.py", line 683, in _get_from_handle
raise HandleError('Handle %s not found' % handle)
gramps.gen.errors.HandleError: Handle not found


On a family tree with no Tags you get the following:

2019-07-04 10:38:32.316: WARNING: _enumeratedlist.py: line 143: Value '1' not found for option 'Remove Tag'
2019-07-04 10:38:32.317: WARNING: _enumeratedlist.py: line 144: Valid values: []
2019-07-04 10:39:03.152: WARNING: _enumeratedlist.py: line 143: Value '1' not found for option 'Remove Tag'
2019-07-04 10:39:03.152: WARNING: _enumeratedlist.py: line 144: Valid values: []
2019-07-04 10:39:11.884: ERROR: grampsapp.py: line 143: Unhandled exception
Traceback (most recent call last):
File "C:\Program Files (x86)\GrampsAIO32-5.0.1\gramps\gui\plug_windows.py", line 805, in on_ok_clicked
self.run() # activate results tab
File "C:\Users\me\Documents\gramps-test-profile\gramps\gramps50\plugins\RemoveTagTool\RemoveTagTool.py", line 287, in run
self.__get_menu_options()
File "C:\Users\me\Documents\gramps-test-profile\gramps\gramps50\plugins\RemoveTagTool\RemoveTagTool.py", line 323, in __get_menu_options
self.menu_opt_handling("person", 'pers_filter')
File "C:\Users\me\Documents\gramps-test-profile\gramps\gramps50\plugins\RemoveTagTool\RemoveTagTool.py", line 365, in menu_opt_handling
self.__remove_from(objects, category)
File "C:\Users\me\Documents\gramps-test-profile\gramps\gramps50\plugins\RemoveTagTool\RemoveTagTool.py", line 384, in __remove_from
if self.tag_handle in Object.get_tag_list():
AttributeError: 'RemoveTagWindow' object has no attribute 'tag_handle'

@Mattkmmr
Copy link
Member Author

Mattkmmr commented Jul 4, 2019

@sam-m888 Thank you for testing. The issues should be resolved now, if you find more errors let me know.

@sam-m888 sam-m888 merged commit 95f910e into gramps-project:maintenance/gramps50 Jul 5, 2019
@sam-m888
Copy link
Member

sam-m888 commented Jul 5, 2019

Works for me, unable to find any obvious errors.

Thank you

sam-m888 added a commit that referenced this pull request Jul 5, 2019
@Mattkmmr Mattkmmr deleted the remove-tag-tool branch July 20, 2019 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants