diff --git a/configure.in b/configure.in index 07f6ccfc5..acb426635 100644 --- a/configure.in +++ b/configure.in @@ -165,6 +165,8 @@ src/gen/db/Makefile src/gen/lib/Makefile src/gen/utils/Makefile src/gen/plug/Makefile +src/gen/plug/docbackend/Makefile +src/gen/plug/docgen/Makefile src/gen/plug/menu/Makefile src/data/Makefile src/data/templates/Makefile diff --git a/po/POTFILES.in b/po/POTFILES.in index 031bac253..7d7b5fa82 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -7,7 +7,6 @@ src/ansel_utf8.py src/ArgHandler.py src/Assistant.py src/AutoComp.py -src/BaseDoc.py src/Bookmarks.py src/ColumnOrder.py src/const.py @@ -394,7 +393,7 @@ src/PluginUtils/_Tool.py src/gen/utils/dbutils.py src/gen/utils/progressmon.py src/gen/plug/__init__.py -src/gen/plug/_docgen.py +src/gen/plug/_docgenplugin.py src/gen/plug/_export.py src/gen/plug/_import.py src/gen/plug/_manager.py @@ -418,6 +417,11 @@ src/gen/plug/menu/_string.py src/gen/plug/menu/_style.py src/gen/plug/menu/_surnamecolor.py src/gen/plug/menu/_text.py +src/gen/plug/docgen/basedoc.py +src/gen/plug/docbackend/__init__.py +src/gen/plug/docbackend/cairobackend.py +src/gen/plug/docbackend/docbackend.py +src/gen/plug/docbackend/latexbackend.py # ReportBase package diff --git a/src/Makefile.am b/src/Makefile.am index 0a5e8da3d..acaa50dd9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,7 +36,6 @@ gdir_PYTHON = \ ArgHandler.py\ Assistant.py\ AutoComp.py\ - BaseDoc.py\ Bookmarks.py\ ColumnOrder.py\ const.py\ diff --git a/src/gen/plug/Makefile.am b/src/gen/plug/Makefile.am index 3f9f29fd1..d512a0f09 100644 --- a/src/gen/plug/Makefile.am +++ b/src/gen/plug/Makefile.am @@ -4,13 +4,15 @@ # If not using GNU make, then list all .py files individually SUBDIRS = \ + docbackend\ + docgen\ menu pkgdatadir = $(datadir)/@PACKAGE@/gen/plug pkgdata_PYTHON = \ __init__.py \ - _docgen.py \ + _docgenplugin.py \ _export.py \ _import.py \ _manager.py \ diff --git a/src/gen/plug/docbackend/Makefile.am b/src/gen/plug/docbackend/Makefile.am new file mode 100644 index 000000000..c972a622a --- /dev/null +++ b/src/gen/plug/docbackend/Makefile.am @@ -0,0 +1,25 @@ +# This is the src/gen/plug/menu level Makefile for Gramps +# We could use GNU make's ':=' syntax for nice wildcard use, +# but that is not necessarily portable. +# If not using GNU make, then list all .py files individually + +pkgdatadir = $(datadir)/@PACKAGE@/gen/plug/docbackend + +pkgdata_PYTHON = \ + __init__.py \ + cairobackend.py \ + docbackend.py \ + latexbackend.py + +pkgpyexecdir = @pkgpyexecdir@/gen/plug/docbackend +pkgpythondir = @pkgpythondir@/gen/plug/docbackend + + +# Clean up all the byte-compiled files +MOSTLYCLEANFILES = *pyc *pyo + +GRAMPS_PY_MODPATH = "../../../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgdata_PYTHON)); diff --git a/src/gen/plug/docgen/Makefile.am b/src/gen/plug/docgen/Makefile.am new file mode 100644 index 000000000..2c5898f47 --- /dev/null +++ b/src/gen/plug/docgen/Makefile.am @@ -0,0 +1,23 @@ +# This is the src/gen/plug/menu level Makefile for Gramps +# We could use GNU make's ':=' syntax for nice wildcard use, +# but that is not necessarily portable. +# If not using GNU make, then list all .py files individually + +pkgdatadir = $(datadir)/@PACKAGE@/gen/plug/docgen + +pkgdata_PYTHON = \ + __init__.py \ + basedoc.py + +pkgpyexecdir = @pkgpyexecdir@/gen/plug/docgen +pkgpythondir = @pkgpythondir@/gen/plug/docgen + + +# Clean up all the byte-compiled files +MOSTLYCLEANFILES = *pyc *pyo + +GRAMPS_PY_MODPATH = "../../../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgdata_PYTHON)); diff --git a/src/gen/plug/docgen/__init__.py b/src/gen/plug/docgen/__init__.py new file mode 100644 index 000000000..5f665376a --- /dev/null +++ b/src/gen/plug/docgen/__init__.py @@ -0,0 +1,30 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2009 B. Malengier +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# $Id: __init__.py 10055 2008-02-18 20:07:09Z acraphae $ + +""" +The docgen package providing the API the document generating plugins can use. +A docgen plugin should fully implement this api for TextDoc or DrawDoc +""" + +from basedoc import BaseDoc, PaperSize, PaperStyle, FontStyle, ParagraphStyle,\ + TableStyle, TableCellStyle, StyleSheetList, StyleSheet,\ + SheetParser, GraphicsStyle, TextDoc, IndexMark, DrawDoc, GVDoc