Gramps addons-source vs gramps

Sorry for asking this question. What is the difference between the gramps repo and the gramps addons-source repo. I am trying to enhance a couple of reports (in gramps>plugins>textreports) that are deployed in the standard download installer. Which one should I fork and clone? who should I submit a PR to, once I finish testing my works. Thanks.

Hi,

thanks for planning to contribute!

addons-source is for third-party addons, see Addons development - Gramps for details. If the report you want to improve is in the gramps repo itself, it is a core plugin, so you need to directly work on gramps, not addons-source.

You fork the Gramps code to your Github repositories. Then you can clone your fork down to your desktop.

You create a branch on your clone to take all the modifications and when complete, you send it back to the Gramps repository’s maintenance\gramps52 branch as a Pull Request.

If you are doing more than one report do each one separately as their own pull request.

All reports deployed by the standard download installer are in the gramps repo.

Are you planning to do the development in Windows 11? I see that in your profle.

I sometimes find it difficult to work in the core. And publishing of updates to the core are few and far between. Also, the core plugins are in a protected or hidden folder for some OSes.

If you want to limit your beta testers to those who can “build from source”, then you can contribute to the core. Personally, whether working on either core or addon, I like to fork the plug-in to a new, uniquely named instance. (You’ll want to break the plug-in’s registration data out of a collated .gpr.py file to fork core plug-ins.) Forked addons let Gramps run the variants in parallel. This makes testing for unintended differences easier.

How can you tell which plug-ins are core (built-ins) and which are addons? The Plugin Manager Enhanced addon marks addons with asterisks in the status column. Clicking the Info button shows the full paths for the module. (When Gramps is in debug mode, the Info is shown and there is an extra Edit button that opens the registered fname Python module in the editor associated with .py extension files.)

Thanks, David. I will be working with Gramps only.

Thanks, Enno, for the clarification.

As for the development platform, a few years ago I got so excited when MS Visual Studio announced support for Python since VS was my choice platform. I gave up very quickly after facing insurmountable GTK issues with Windows.

Right now, my fallback method is the old way of changing the report Python code a piece at a time and running. Without the benefits of IntelliSense, or a full knowledge of the object model, I had to search through all files to see which properties would be of interest and just try and try until it seemed to work. I just wish the GTK dependency could somehow be handled globally by platform-specific codes. I know it is a huge order to undertake.

All my proposed changes will be localized for each report in its Python file, even though, at some time I was tempted to refactor some code in the gpr code, I do not want any risks to destroy this beautiful app.

And thank everyone for answering my post. Happy Thanksgiving, to any of you who celebrate this festy day.

1 Like

I switched from Windows to ubuntu in 2010, and now do all my genealogy work on LMDE 6, which is short for Linux Mint Debian Edition. It’s faster than Windows on the same hardware, and with GTK already on board, debugging Gramps works great with Visual Studio Code. I even use that to hack Gramps XML files with small programs written in C#, which is the language that I had to learn for my last job. And that’s possible, because there’s also Gtk#, and Microsoft supports essential parts of .NET on most Linux versions.

We have a build process for Windows too, which I tried to build the Windows AIO version and installer, but I don’t know how well that integrates with the Visual Studio program on Windows. The process is based on MSYS and MinGW, and the description on the wiki should be enough to give it a try, if you can live with bash.

I would like to hear more about Gtk# and hope someday there will be a way (or some files) to pip into the visual studio environment for the project. I was testing using the gramps folder as a vs project but failed to make any progress.

Back to the PR subject, if I am making changes to 3 reports, does it matter if I make just 1 branch 3, then make 3 different Pulls (1 per report). Or do I have to strictly make 1 branch for 1 pull?

Make a separate branch for each change please.

OK. Thanks for a quick reply.

@dave.khuon

If I can add a caveat to Nick’s reply - if any of the changes are interdependent it may make sense to put them all in the same PR. The idea of keeping PRs separate is to review, test and accept/reject them independently.

2 Likes

I got all my changed files back to their individual branch. How long do I have to wait before I push from my branch to my fork: Pull Request? Is there any intervening administrative process?

For my case, these 3 report changes are independent.

2 Likes

No need to wait and no admin process. Here’s what I typically do:

Once I make changes locally I spend some time testing by copying the files to my Gramps installation to ensure that everything works as expected. Then commit the code to my local branch, and push it up to my fork. Once I do that, I start the process of creating a PR on GitHub and review the diffs carefully one more time before actually creating it. When the PR is created, others can review it in the Gramps repo. Collect feedback and make changes in your code if needed and repeat the cycle.

1 Like

The Pedigree view is a code example of using the Colors preferences to adapt backdrop colors for “Male”, “Female”, “Other” and “Unknown” genders with Alive/Dead variants.

Is there a code example of using the Genealogical Symbols preferences in a Report or a View?

I tried changing the father of the Home Person in the Example.gramps tree to “Other” and then ran the Reports → Graphical Reports → Ancestor Tree on the Home Person
But the report generation went boom:

181206942: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/viewmanager.py", line 1754, in <lambda>
    return lambda x, y: run_plugin(pdata, dbstate, uistate)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/viewmanager.py", line 1725, in run_plugin
    report(
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_reportdialog.py", line 749, in report
    dialog = dialog_class(dbstate, uistate, options_class, name, trans_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_drawreportdialog.py", line 101, in __init__
    DocReportDialog.__init__(self, dbstate, uistate, opt, name, translated_name)
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_docreportdialog.py", line 76, in __init__
    ReportDialog.__init__(
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_reportdialog.py", line 112, in __init__
    self.init_interface()
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_docreportdialog.py", line 92, in init_interface
    ReportDialog.init_interface(self)
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_reportdialog.py", line 195, in init_interface
    self.setup_init()
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_reportdialog.py", line 462, in setup_init
    self.target_fileentry = FileEntry(hid, _("Save As"), parent=self.window)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_fileentry.py", line 46, in __init__
    self.set_filename(defname)
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gui/plug/report/_fileentry.py", line 94, in set_filename
    self.__base_path = get_curr_dir()
                       ^^^^^^^^^^^^^^
  File "/home/districtsupport/.local/lib/python3.11/site-packages/gramps/gen/constfunc.py", line 177, in get_curr_dir
    return os.getcwd()
           ^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory

The pedigree view also uses symbols.

But that chart has no symbols for Gender… only for Birth, Death, and Relationship