Open main menu

Gramps β

Changes

Getting started with Gramps development

1,061 bytes added, 00:27, 12 September 2023
m
no edit summary
{{man tip|Information The article is about setting up for full-scale development of the Gramps core program|For information about developing on a smaller scale visit:* [https://gramps.discourse.group/tag/hacks Specific Hacking discussions] * Tools for developing Gramps addonsat a micro scale: [[Addon:Isotammi_addons#SuperTool|SuperTool]], [[Addon:Python_Shell_Gramplet|Python Shell]]* [[Report-writing tutorial]]* [[Addons_development|If you are looking Addons development]]<br />For how to use the Gramps program or install addons visit:<br>* [[Portal:Using_GrampsUsing Gramps]]<br>* [[Third-party Addons]]}}
{{man warn|Warning:|This tutorial is a work in progress. Feel free to help and modify it.}}
{{stub}}This tutorial aims to help you in your first [https://en.wikipedia.org/wiki/Hacker_culture hacking] get started initially with Gramps development and shows you a general overview of what you need to know when working with the Grampssource code. It The following will help you setting up setup a development environment and explain where to find the files you need.
This tutorial assumes that you are using GNU/Linux (but it might help under another OS) and that you know the basics of Python programming language.
== Linux: Optional : set up a development environment ==
{{man warn|Warning:|It is highly recommended that you do not use your normal/usual environment for developing Gramps.<br />|Definitely do '''not''' work on your main Gramps family tree.<br />Doing so may result in data loss in your Gramps Family Tree !}}
If you run your development version of Gramps as the usual user, it will show all your usual Gramps family trees, so loading one by mistake is possible and a bug may result in losing productive data. To prevent this, you could use a [[GRAMPSHOME]] environment variable to create a separate folder for productive data, see [[Run Gramps from a portable drive]] for more information.
=== Chroot ===
You may also use a [https://wikipedia.org/wiki/Chroot <code>chroot </code>] to result in a similar separation as virtualbox.
If you use Ubuntu, you can set up the chroot environment following these instructions:
[https://help.ubuntu.com/community/BasicChroot Creating a basic Ubuntu chroot]
 
If you use Gramps in a chroot jail with another Linux distribution, please add information here.
{{stub}}
You should then have a working chroot environment in <code>/var/chroot </code> (or whichever location you chose).
Enter it with
sudo chroot /var/chroot
=== None of above ===
{{man warn|You have been warned!|At a minimum :* [[How to make a backup|Make a Gramps XML Backup]]* Prefix the name of your test family trees '<code>a_test</code>'a_test_nameeg:'<code>a_test_FamilyTreeName</code>'. By starting with <code>'a_test'</code> they will show at the top of the {{man label|Family Tree}} manager, and the word '''test''' makes it clear what they are created for.}}
== Mac OS X ==
[[Building_Gramps_AIO_cx_freeze-based]]
== Install a text editor ==
;{{man tip|Whichever editor you use, make |Make sure that it is set up so that the indent level is 4 spaces. Do not use the Tab character to indent.}}
The following is in alphabetic order. Choose the one text editor you liketo work with. If your favourite text Editor is not listed you can add it and describe how to set it up here.
=== Eclipse + PyDev ===
=== PyCharm ===
[https://www.jetbrains.com/pycharm/ PyCharm] is more powerful and out-of-the-box than Eclipse with pydev, although it is not Free Software like Eclipse is. Seems But seems to be recognizing more Python syntax and feels faster on my box. I unpacked the distribution, launched bin/pycharm.sh script, and it just worked. 'File » Open Directory' and selected the "Gramps/src" directory in my local checked out Git WD, and things work from there.
'Version Control » Update Project' automatically syncs up with the Git repository.
[http://scribes.sourceforge.net/ Scribes] is a text editor written in python and Gtk, that uniquely blends simplicity with well researched powerful functions.
=== Other ===(If you have a favourite Editor and want to share it : describe how to set it up here.) ====Kate====
[https://kate-editor.org/ Kate] works well as a general editor for Python. It also recognizes key words of Python and marks them in colours. Kate is a Linux KDE desktop program. Of course, it also works on gnome installations.
====Idle====
'''Idle''' is a handy simple editor that takes advantage of the interpreter features of Python. Often Idle comes with Python packages. Idle works well in Linux and other OS's, including the "dominant OS". If you install Windows version of Python, you will probably install from the same package Idle. One feature of Idle tends to confuse newcomers: Idle main window is NOT used for program writing, but for displaying the results. Notice that there is a Python tutorial, automagically installed with Idle on a Windows box. It is worth noting that the Tutorial gives quite extensive introduction into Python and is authored by the originator of Python: Guido van Rossum.
== Get the source tree ==
To get the source tree, you will need Git. Please have a look at read the dedicated tutorial [[Brief introduction to Git]] for details.
You can also use a graphical Git tool like "[https://git-scm.com/docs/gitk/ gitk(The Git repository browser)]" or "[https://git-scm.com/docs/git-gui/ git-gui( A portable graphical interface to Git)]".
'''This tutorial now assumes you have cloned the Gramps repository into a directory called "<code>~/Gramps"</code>. If not, you have to change this path when it is used below.'''
{{man warn|Warning:|Let it be clear that the settings directory <code>"~/.gramps/"</code> is a '''different''' hidden directory in your home-dir. Do not store anything there.''}}
== Run Gramps from the source ==
To run Gramps, type:
python Gramps.py
 
Dependencies
 
If you have an "GExiv2 Module Not Loaded" you should install it with
sudo apt install gir1.2-gexiv2-0.10
The same for the "osmGpsMap module not loaded, Geography functionality will not be available"
sudo apt install gir1.2-osmgpsmap-1.0
== Correct Translation in development ==
{{man warn|'''To check be checked if following is still current!'''}}{{stub}}
Warning: you will not be able to load translations on /usr/local/share/locale, because you will load /usr/share/locale, which could be translations for stable release (set on grampsapp.py).
You may generate a custom launcher by adding this line:
* [[Using database API]]
* [https://www.gramps-project.org/docs/ API Code Documentation] - Gramps current release.
* [[Devhelp]]- How to include [https://gramps-project.org/docs/ Gramps API] into the Devhelp index.
* [[Committing policies]]
5,421
edits