I like that the addon is writing a separate WebSearch .ini file. But wonder if the folder in gramps/gramps52/plugins is “survivable” enough?
Perhaps it should make a folder somewhere in the gramps set of folders instead? And search that location for additional (custom) CSV and JSON to augment the distribution copies.
This would allow custom files survive an uninstall/re-install cycle of the addon via the Plugin Manager of an upgrade to a new major release of Gramps. On the flip side, if corrupted .ini and/or custom files are the problem that a person is troubleshooting, that would make uninstall/re-install ineffective when trying to fix the cause. Hmmmm. That’s a judgement you’ll have to decide.
Regarding future proofing… I have a gut feeling that Gramps .ini files should log the Gramps Version and plugin version. But the core module managing this data does not support that. Sooner or later that lack will bite us when a saved preference/configuration cannot be backward compatible.
And again agree. I think I can add one additional UI setting with path to addational data (csv and json). If filename is the same - then we should use users’ files instead of native. These files will be safe when the gramplet is updating
Close but was thinking that the test might be more simple with versioning. Such as if you had a complete configuration redesign with version 0.36.0, the test .ini versioning. If the ini’s gramps version is <5.0.0 or it’s WebSearch version is < 0.36.0 then flush the .ini totally. If you only re-use a path attribute from versions before 1.0.0, discard the earlier version .ini attributes that don’t have those attribute names.
In the past, I’ve accidentally used the uninstall in the Plugin Manager Enhanced instead of the Hide. And lost my tweaks to that addon. (Because Uninstall does not move the file to the Trash, it deletes.)
So when @Urchello leverages a different folder somewhere in the parentage of gramps/gramps52/plugins/WebSearch, I will feel more secure.
Gramps builds a list of constants that define where things are stored. USER_PLUGINS defines where plugins are stored regardless of OS. Check out gramps\gen\const.py
user@user-desktop:~/.local/share/gramps/WebSearch$ ls
csv json
If a user-defined file exists in this location, it will automatically override the default version with the same file name.
And one more UI icon (can be disabled in settings) is added for links which are loaded from the USER_DATA directory
I had to confirm which folder that was. When I moved my-links.csv file there there was no recognition of the file. After searching your code files, I finally found out you created a user’s version of the WebSearch folder structure. My file is now recognized
I dont understand which variables to use: given, middle, surname,… Also, do you mean seach on the homepage only? It would be great if you give me a search link with some testing search data.