Error building a listing for a new "Historical Context" gramplet

Hi
I am developing a gramplet, which will show a historical timeline based on a CSV text file.
I am struggling with GTK and Python, since I am new to these.
However I have something that I think is working.
But trying to do the listing gives me a strange error:

python3 make.py gramps52 listing HistTime
Missing or invalid localedir ‘/home/kmi/grampsdev/gramps/build/mo’

Any ideas?

2 Likes

Not really. Do you have some code on GitHub?

1 Like

I haven’t push any code yet, since I am trying to follow the guidelines on the wiki.
But the problem is not in my code, since the make script complains about $GRAMPSPATH/build/mo
I have cloned the gramps, addon and addon-source from github, and made my gramplet in the addons-source tree.
the tgz is created and put in the download directory

OK, I think I found it:

https://gramps-project.org/wiki/index.php?title=Addons_development#List_your_addon_in_the_Gramps_Plugin_Manager

This paragraph starts with a warning, which says that Gramps must have been built, and your error message suggests that it hasn’t, because it can’t find the gramps/build/mo directory.

I have 2 guesses

  1. Try doing a ‘compile’ before ‘listing’. The comments in make.py say this creates the mo file.

  2. Manually move the build/mo folder from the source to GRAMPSPATH. Example on my Mac:

  • My source is in: /Users/gary/gtk/source/gramps-gramps-5.2.2
  • GRAMPSPATH is /Users/gary/gtk/inst/bin

I had to manually move the po folder to get translations to work. Maybe this is similar. This is after doing a local build.

1 Like

Do you have a screenshot you can share?

Is it anything like the one @Nick-Hall is making but has not released?

Sure.
Here it is. In Danish. Currently I also have an US file, but it only contains the presidents.

2 Likes

Thanks. The compile didn’t help. I don’t have a build directory anywhere, so I am not sure what to put in the mo directory. And the gramplet works fine with translations, so I don’t understand a s…

Here is my README.md as it looks right now:

HistTimeLine gramplet

Gramplet to display historical events with the year they happened, and optionally the year they ended.

The gramplet works on the person and the relations view.
The data for the gramplet comes from a CSV file, which can be edited with a normal editor.
The Format is:
from;to;event;link to event
example:
1789;1797;George Washington;https://en.wikipedia.org/wiki/George\_Washington

The file name is _data.txt e.g. da_DK_data.txt for Denmark
Currently only two files are provided, da_DK_data.txt and en_US_data.txt which simply is a list of American presidents.

I have added all the danish census’es to the Danish data file. To avoid looking of this you can go into the settings for the person list, and make a filter. If you check the “use filter” checkbox, the historical list will not display the events starting with the text you hav added. In my case the text is “Folketælling”

1 Like

I think you are right. When will I learn to read?
Just compiled, and now the listing does not complain.
Thanks

As you can see, it is nothing so ambitious as @Nick-Hall project.
I wanted to se what happened during my ancestors lifetime, and at the same time wanted to get my hands dirty regarding Python, GTK+ and gramps development.

3 Likes

Well, in this case, I can understand that you missed it, because it’s far down the wiki page, and not where it should be, like in paragraph 3.1, where it tells you to get a local copy of Gramps and the add-ons. That’s where it also should tell you that you need to build Gramps from that local copy too.

I normally don’t read much of the wiki, because the texts are long and tend to get outdated for lots of reasons, including the fact that they’re trying to cover many versions, where the readme can focus on the current version as it sits in the repository. And in most cases, that readme is the only thing that I really read.

3 Likes

Interesting!

You might want to look at the code for the SuperTool’s Help feature.

He does something similar but builds from a JSON rather than from a CSV file. This enhancement recently evolved and and the user docs have not been revised.

His table creates a hotlinked table entry rather than have the URL. And it has dynamic tab creation.

I like that you separated English and Danish world history lists. But (like help_url targeting lacks) it seems as though there should be a structured system of fallbacks for different cultural biases. Perhaps @Nick-Hall and @kku can give their opinions on how to standardize that bias.

Will take a look at that.
And I agree, there should be a fallback to some kind of generic world history.
So what do I do to get someone take a look, and give feedback before the gramplet is published? Or should we discuss that in another thread?

If you haven’t set up your own GitHub repository but are using the desktop GitHub application, you could set the .gpr.py status to EXPERIMENTAL or BETA. Then coordinate with @GaryGriffin to make a Pull Request to publish it to the Addon Manager.

(Use EXPERIMENTAL when the addon is still in the stage where you’re accepting design feedback. Use BETA when it is in a bug report & repair stage.)

Thanks.
I have several projects on github, so I will put my gramplet there.

2 Likes

May I suggest that you support TWO files? One that comes standardly and a user file.

That way customizations will not be overwritten when you publish updates.

What a great idea!
I will certanly implement that

1 Like

Please include a version identifier in the User file’s filename. So if the file format evolves, you can recognize old data format, convert it and retire the old file.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.