Difference between revisions of "GEPS 008: File Organization"

From Gramps
Jump to: navigation, search
Line 1: Line 1:
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, the software architecture is being organized into 5 main categories of code - each in their own directory. The descriptions below provide the general purpose and scope of each category. Not all code in the source tree conforms to this architecture yet. However, new code should attempt to move the source in a direction that conforms to this organization. Moving to this architecture is an ongoing process and a work in progress.  
+
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, the software architecture is being organized into 5 main categories of code - each in their own directory.  
 +
 
 +
The descriptions below provide the general purpose and scope of each category. Not all code in the source tree conforms to this architecture yet.  
 +
 
 +
However, new code should attempt to move the source in a direction that conforms to this organization. ''Moving to this architecture is an ongoing process and a work in progress.''
  
 
Related Gramps Bug(s):
 
Related Gramps Bug(s):

Revision as of 20:17, 17 May 2012

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, the software architecture is being organized into 5 main categories of code - each in their own directory.

The descriptions below provide the general purpose and scope of each category. Not all code in the source tree conforms to this architecture yet.

However, new code should attempt to move the source in a direction that conforms to this organization. Moving to this architecture is an ongoing process and a work in progress.

Related Gramps Bug(s):

root package: gramps

If we plan to ever move to Python 2.7/3.x, creating a root package "gramps" and using absolute imports will simplify that transition.

  mkdir gramps
  touch gramps/__init__.py
  mv src/* gramps  
  mv gramps src

-- Terrel Shumway

src/gen/

This directory contains the core components of Gramps. The src/gen/ directory shall not have any dependencies on the other top level source directories (src/gui/, src/cli/, src/web/, etc). The src/gen/ directory also shall not have any dependencies on the gtk library.

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.

src/gen/db/

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

src/gen/display/

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

src/gen/lib/

The lib directory contains the classes for the database objects.

src/gen/plug/

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

src/gen/plug/report/

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

src/gen/filters/

The filters directory contains the code for filtering objects.

src/gen/mime/

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

src/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.

src/gui/plug/

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

src/gui/plug/report

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

src/gui/views/

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

src/gui/views/treemodels/

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

src/gui/views/selectors/

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

src/gui/editors/

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

src/gui/editors/displaytabs/

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

src/gui/merge/

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

src/gui/widgets/

This directory contains widgets used by the GUI

src/cli/

This directory contains the code for the command line interface.

src/web/

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

src/plugins/

This directory contains all the plugins for Gramps.

src/plugins/docgen/

This directory contains all the document generator plugins.

src/plugins/gramplet/

This directory contains all the gramplet plugins.

src/plugins/tool/

This directory contains all the tool plugins.

src/plugins/report/

This directory contains all the report plugins.