Gramps 4.x File Organization

From Gramps
Revision as of 22:37, 1 June 2014 by Sam888 (Talk | contribs) (gramps/gramps/plugins/import/: name changed to importer)

Jump to: navigation, search

Gramps was originally written as a GTK application intended to only be used in a graphical environment. Over time, support has been added for other user interfaces (CLI and web). In order to reduce unnecessary dependencies between the various interfaces, from Gramps 4.x onwards the software architecture has been organized into 5 main categories of code - each in their own directory.

The descriptions below provide the general purpose and scope of each category.

Contents

gramps/

This is the top level Gramps folder, in it you will find Gramps' source code. There are a lot of sub-folders, which are explained in the following sections.

In most folders, there is an __init.py__ file. You may find some explanations there about the package.

gramps/data/

You will find here various data files used by gramps : manpages, icons...

gramps/debian/

You will find here various files used by Debian?

gramps/docs/

You will find here various files used to generate Gramps Developer Documentation? Sphinx..

gramps/example/

You will find here various example genealogy data-files files used by Gramps eg: csv, GEDCOM, Gramps XML....

gramps/help/

You will find here help?

gramps/images/

You will find here various image files eg: icons, webstuff?

gramps/mac/

You will find here various files used by mac?

gramps/po/

You will find here the translation files.

gramps/scripts/

You will find here the script files.

gramps/test/

You will find here the script files eg:GrampsLogger

gramps/windows/

You will find here various files used by MS-Windows eg: builder, nsis?

gramps/gramps/

This folder contains the core of Gramps' source code.

gramps/gramps/gen/

This directory contains the core components of Gramps.

It defines genealogy objects (Person, Place, Note...), database classes, generic plugins, and database access :

  • gramps/gramps/gen/db : Gramps Database Handling
  • gramps/gramps/gen/lib : The core library of Gramps objects
  • gramps/gramps/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...
  • gramps/gramps/gen/utils : Common utilities for Gramps code (progress monitor dialog, database utilities, callbacks between UI and database code)

Note:The gramps/gramps/gen/ directory shall not have any dependencies on the other top level source directories (gramps/gramps/gui/, gramps/gramps/cli/, gramps/gramps/webapp/, etc). The gramps/gramps/gen/ directory also shall not have any dependencies on the gtk library.

Note:The word "gen" was chosen because it is short for "general" and "generic" which is a good way to describe code in this directory because it doesn't depend on or require a specific user interface. "gen" is also short for "genealogy" which is also an appropriate term for the code in this directory because it implements the "business logic" that makes Gramps a genealogy application.

gramps/gramps/gen/datehandler/

The datehandler directory contains the code for handling dates in different locales.

gramps/gramps/gen/db/

The db directory contains the code for manipulating the Gramps database.

gramps/gramps/gen/display/

The display directory contains business logic for displaying database objects in textual form. For example, localized date display and name display code.

gramps/gramps/gen/filters/

The filters directory contains the code for filtering objects.

gramps/gramps/gen/filters/rules/

The rules directory contains the code for rules used by the filters. The rules are divided into sub-directories according to primary object type:

  • gramps/gramps/gen/filters/rules/citation
  • gramps/gramps/gen/filters/rules/event
  • gramps/gramps/gen/filters/rules/family
  • gramps/gramps/gen/filters/rules/media
  • gramps/gramps/gen/filters/rules/note
  • gramps/gramps/gen/filters/rules/person
  • gramps/gramps/gen/filters/rules/place
  • gramps/gramps/gen/filters/rules/repository
  • gramps/gramps/gen/filters/rules/source

gramps/gramps/gen/lib/

The lib directory contains the classes for the database objects.

gramps/gramps/gen/merge/

The merge directory contains the classes for merging database objects.

gramps/gramps/gen/mime/

The mime directory contains the code for handling mime types in Gramps.

gramps/gramps/gen/plug/

The plug directory contains the core logic for registering and running plugins. It also contains any utility classes used by plugins.

gramps/gramps/gen/plug/report/

This directory contains the base class for reports, constants, and basic utilities.

gramps/gramps/gen/proxy/

This directory contains classes to provide proxy access to the Gramps database.

gramps/gramps/gen/simple/

This directory contains classes to provide simple access the Gramps database and reports.

gramps/gramps/gen/utils/

This directory contains utility functions.

gramps/gramps/gui/

This directory contains the code for the desktop graphical user interface. Any file that imports GTK or glade should live in this directory or a subdirectory of this directory.

gramps/gramps/gui/editors/

This directory contains the code for the object editors used in the GUI.

gramps/gramps/gui/editors/displaytabs/

This directory contains the code for the tabs used in the GUI editors.

gramps/gramps/gui/filters/

This directory contains the code for the GUI filter interface.

gramps/gramps/gui/filters/sidebar/

This directory contains the code for the GUI sidebar filters.

gramps/gramps/gui/glade/

This directory contains Glade user interface definition files.

gramps/gramps/gui/logger/

This directory contains the code for GUI error logging and reporting.

gramps/gramps/gui/merge/

This directory contains the code for merging objects in the GUI.

gramps/gramps/gui/plug/

The gui.plug directory contains windows, dialogs, and tools that the plugins will use.

gramps/gramps/gui/plug/export/

This directory contains the GUI code for running export plugins.

gramps/gramps/gui/plug/quick/

This directory contains the GUI code for running quick view plugins.

gramps/gramps/gui/plug/report/

This directory has the dialogs for running reports, such as selection criteria, file pickers, and paper sizes.

gramps/gramps/gui/selectors/

This directory contains the code for the object selection dialogs in the GUI.

gramps/gramps/gui/views/

This directory contains the code for the various graphical "views" in the GUI.

gramps/gramps/gui/views/treemodels/

This directory contains the code for the models used in the GUI.

gramps/gramps/gui/widgets/

This directory contains widgets used by the GUI

gramps/gramps/guiQML/

Experimental: This directory contains the experimental code for the QML graphical user interface.

gramps/gramps/cli/

This directory contains the code for the command line interface.

gramps/gramps/test/

This directory contains the code for testing the Gramps.

gramps/gramps/webapp/

This directory contains the code for the gramps-connect web interface.

gramps/gramps/plugins/

This directory contains all the plugins for Gramps.

gramps/gramps/plugins/docgen/

This directory contains all the document generator plugins.

gramps/gramps/plugins/drawreport/

This directory contains all the graphical report plugins.

gramps/gramps/plugins/export/

This directory contains all the export plugins.

gramps/gramps/plugins/gramplet/

This directory contains all the gramplet plugins.

gramps/gramps/plugins/graph/

This directory contains all the graph report plugins.

gramps/gramps/plugins/importer/

This directory contains all the import plugins.

gramps/gramps/plugins/lib/

This directory contains shared library code for Gramps plugins.

gramps/gramps/plugins/mapservices/

This directory contains all the map service plugins.

gramps/gramps/plugins/quickview/

This directory contains all the quickview plugins.

gramps/gramps/plugins/rel/

This directory contains the relationship calculator plugins.

gramps/gramps/plugins/sidebar/

This directory contains all the navigation sidebar plugins.

gramps/gramps/plugins/textreport/

This directory contains all the text report plugins.

gramps/gramps/plugins/tool/

This directory contains all the tool plugins.

gramps/gramps/plugins/view/

This directory contains all the view plugins.

gramps/gramps/plugins/webreport/

This directory contains all the web report plugins.

gramps/gramps/plugins/webstuff/

This directory contains plugins providing web resources.

Tree View

\GIT\GRAMPS\

+---data
|   +---css
|   |   \---swanky-purse
|   |       \---images
|   |
|   +---evidencestyle
|   |
|   +---images
|   |
|   +---javascript
|   |
|   +---jhtmlarea
|   |   +---images
|   |   +---scripts
|   |   \---style
|   |       \---jqueryui
|   |           \---ui-lightness
|   |               \---images
|   |
|   +---man
|   |   +---cs
|   |   +---fr
|   |   +---nl
|   |   +---pl
|   |   +---pt_BR
|   |   \---sv
|   |
|   \---templates
|       +---admin
|       \---registration
|
+---debian
|
+---docs
|   +---corecli
|   +---coregui
|   \---gen
|
+---example
|   +---csv
|   +---gedcom
|   \---gramps
|
+---help
|
+---images
|   +---16x16
|   |   \---source
|   |
|   +---22x22
|   +---48x48
|   +---scalable
|   \---webstuff
|
+---mac
|
+---po
|   \---test
|
+---scripts
|
+---test
|   \---GrampsLogger
|
+---windows
|   +---builder
|   \---nsis
|
+---gramps
    +---cli
    |   +---plug
    |   \---test
    +---gen
    |   +---datehandler
    |   |   \---test
    |   +---db
    |   |   \---test
    |   +---display
    |   +---filters
    |   |   \---rules
    |   |       +---citation
    |   |       +---event
    |   |       +---family
    |   |       +---media
    |   |       +---note
    |   |       +---person
    |   |       +---place
    |   |       +---repository
    |   |       \---source
    |   +---lib
    |   |   \---test
    |   +---merge
    |   |   \---test
    |   +---mime
    |   +---plug
    |   |   +---docbackend
    |   |   +---docgen
    |   |   +---menu
    |   |   \---report
    |   +---proxy
    |   +---simple
    |   +---test
    |   \---utils
    |       +---docgen
    |       \---test
    +---gui
    |   +---editors
    |   |   \---displaytabs
    |   +---filters
    |   |   \---sidebar
    |   +---glade
    |   |   \---catalog
    |   +---logger
    |   |   \---test
    |   +---merge
    |   +---plug
    |   |   +---export
    |   |   +---quick
    |   |   \---report
    |   +---selectors
    |   +---test
    |   +---views
    |   |   \---treemodels
    |   \---widgets
    +---guiQML
    |   +---qmlwidgets
    |   \---views
    +---plugins
    |   +---docgen
    |   +---drawreport
    |   +---export
    |   |   \---test
    |   +---gramplet
    |   +---graph
    |   +---importer
    |   |   \---test
    |   +---lib
    |   |   \---maps
    |   +---mapservices
    |   +---quickview
    |   +---rel
    |   +---sidebar
    |   +---textreport
    |   +---tool
    |   +---view
    |   +---webreport
    |   \---webstuff
    |       \---img
    +---test
    |   \---test
    \---webapp
        \---grampsdb
            +---sql
            +---templatetags
            \---view