Changes

Jump to: navigation, search

Getting started with Gramps development

476 bytes added, 19:12, 30 September 2012
no edit summary
=== Other ===
[http://kate-editor.org/ Kate] works well as a general editor for Python. It also recognises 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" 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.
(If you have a favourite Editor and want to share it : describe how to set it up here.)
To test that you did all well, you may want to run GRAMPS from your downloaded svn tree. This is explained in the [[Brief introduction to SVN]] but here are the quick steps :
cd ~/gramps-trunk
./autogen.sh make python src/grampssetup.pybuild
These lines will not For the internationalization piece to work before , you need to have installed some build-dependenciesthe translation tools. You obviously also need subversion and friends. On Debian, just run (as root) - ('''Only if Debian installs Gramps 4.0+ as Gramps version!):
apt-get build-dep gramps
 
On Fedora 8 - 10, you will need:
yum install gnomeintltool gettext subversion rcs === Option 1: run from source repo ===Here, we use the code in gramps-common intltool glib2trunk to run Gramps. This means that compiled python files will be stored there. This is not ideal, but the easiest way to develop Gramps, as changes are immediately picked up by the code. Copy the const.py file created in build to your source directory if you want to use your source directory to work with Gramps: cp build/lib.linux-x86_64-2.7/gramps/gen/const.py gramps/gen/const.py python Gramps.py That is it. If you installed some dependencies of Gramps in non-default positions, you need to indicate with PYTHONPATH where then can be found, and with LD_LIBRARY_PATH where link libraries can be found. Eg, if you install GTK and spell checking from source too, you will need something like: PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python Gramps.py === Option 2: use the build code ===Here, we use the code build in gramps-trunk/build to run Gramps. For this, do cd ~/gramps-trunk/build/lib.linux-x86_64-2.7/ python -c 'from gramps.grampsapp import main; main()' Again, it might be needed to set with PYTHONPATH where dependencies can be found, and with LD_LIBRARY_PATH link libraries, see option 1. If you point your PYTHONPATH to the build directory, you can actually run Gramps from a random directory. Like this:  cd PYTHONPATH=~/gramps-trunk/build/lib.linux-x86_64-2.7/ python -c 'from gramps.grampsapp import main; main()' So, more general: cd PYTHONPATH=~/gramps-trunk/build/lib.linux-x86_64-2.7/:/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python -c 'from gramps.grampsapp import main; main()' If the build directory is in your PYTHONPATH, you can also just execute the grampsapp.py module. So this will work too: cd ~/gramps-trunk/build/lib.linux-x86_64-2.7/gramps PYTHONPATH=~/gramps-trunk/build/lib.linux-x86_64-2.7/ python grampsapp.py or again more generally PYTHONPATH=~/gramps-trunk/build/lib.linux-devel gnomex86_64-doc2.7/:/usr/local/lib/python2.7/site-utils gcc emacs gettext subversion make rcspackages/ LD_LIBRARY_PATH=/usr/local/lib python grampsapp.py '''Note''': at the time of writing, only the last, so using grampsapp.py works, as not all imports in Gramps have been converted to relative or absolute imports. This conversion will be finished by end of 2012 however.
= Browse the source code =
{{out of date|[[GEPS 008: File Organization]] has been finished}}
== data ==
You will find here various data files used by gramps : manpages, icons...
== src gramps ==In this folder, you will find GRAMPSGramps' source code. There are a lot of subfolders, which are explained in the folowing sections.
In most folders, there is an __init.py__ file. You may find some explanations there about the package.
=== srcgramps/gen ===This is GRAMPSGramps' core. It defines database classes genealogy objects (Person, Place, Note...), database classes, generic plugins, and database access :* '''srcgramps/gen/db''' : GRAMPS Database Handling* '''srcgramps/gen/lib''' : The core library of GRAMPS objects* '''srcgramps/gen/proxy''' : Proxy class for the GRAMPS databases. This is a very powerful tool used to propose a filtered view of the database : Objects which are not marked private, (not) living persons...* '''srcgramps/gen/utils''' : Common utilities for GRAMPS code (progess monitor dialog, database utilities, callbacks between UI and database code)
=== other ===
* src/BasicUtils : Basic functions to be called from other Gramps code
* src/Config : This package implements access to GRAMPS configuration. It provides the choice between different storage backends.
* src/data : Data for Gramps ('''What is the difference with the root data folder ?''')
* src/DataViews : Gramps Main Views (PersonView, FamilyList...)
* src/DateHandler : Class handling language-specific selection for date parser and displayer.
* src/DisplayModels : ??
* src/DisplayTabs : ??
* src/docgen: Gramps Document Generator (for reports)
* src/Editors: Editors for the different Gramps Objects (Person, Place...)
* src/FilterEditor: Filter Editor
* src/Filters: Package providing filtering framework for GRAMPS
* src/glade: UI designed with glade. There are few UIs designed with glades. I suppose the other are hard-coded.
: src/glade/catalog/README will give you tips on how to run glade tuned to Gramps source locations and using the proper preferences compatible with Gramps code base.
* src/GrampsDbUtils: This package implements additions to the the GrampsDb database.
* src/GrampsLocale: locale workaround for some OSes
* src/GrampsLogger: This package implements some extensions to the standard Python logging module that support a consistent logging and bug reporting framework for Gramps.
* src/images: images for Gramps.
* src/Merge: Merge functions
* src/Mime: Mime types handling
* src/Models
* src/plugins
** src/plugins/docgen
** src/plugins/drawreport
** src/plugins/export
** src/plugins/gramplet
** src/plugins/graph
** src/plugins/lib
** src/plugins/mapservices
** src/plugins/quickview
** src/plugins/rel
** src/plugins/textreport
** src/plugins/tool
** src/plugins/webreport
* src/PluginUtils
* src/ReportBase
* src/Selectors
* src/Simple: Provides a simplified database access interface to the Gramps database.
* src/test
* src/widgets
Further information about files can be found in [[GEPS 008: File Organization]]. Please note that GEPS 008 is a change proposal and does not reflect the actual source tree.

Navigation menu