Rename PSDrawDoc to PsDoc, reduce .py file count.

Follow-up to code review, see the bug# 6883.

svn: r22808
This commit is contained in:
Vassilii Khachaturov 2013-08-06 19:57:52 +00:00
parent 19ca766ee4
commit 18ba120115
7 changed files with 21 additions and 81 deletions

View File

@ -235,7 +235,7 @@ src/plugins/docgen/GtkPrint.py
src/plugins/docgen/HtmlDoc.py src/plugins/docgen/HtmlDoc.py
src/plugins/docgen/LaTeXDoc.py src/plugins/docgen/LaTeXDoc.py
src/plugins/docgen/ODFDoc.py src/plugins/docgen/ODFDoc.py
src/plugins/docgen/PSDrawDoc.py src/plugins/docgen/cairodoc.py
src/plugins/docgen/RTFDoc.py src/plugins/docgen/RTFDoc.py
src/plugins/docgen/SvgDrawDoc.py src/plugins/docgen/SvgDrawDoc.py

View File

@ -283,9 +283,6 @@ src/Merge/test/merge_ref_test.py
# plugins gpr directory # plugins gpr directory
src/plugins/sidebar/sidebar.gpr.py src/plugins/sidebar/sidebar.gpr.py
# plugins/docgen directory
src/plugins/docgen/PdfDoc.py
# plugins/lib directory # plugins/lib directory
src/plugins/lib/libformatting.py src/plugins/lib/libformatting.py
src/plugins/lib/libgrampsxml.py src/plugins/lib/libgrampsxml.py

View File

@ -13,8 +13,7 @@ pkgpython_PYTHON = \
HtmlDoc.py \ HtmlDoc.py \
LaTeXDoc.py \ LaTeXDoc.py \
ODFDoc.py \ ODFDoc.py \
PdfDoc.py \ cairodoc.py \
PSDrawDoc.py \
RTFDoc.py \ RTFDoc.py \
SvgDrawDoc.py SvgDrawDoc.py

View File

@ -1,35 +0,0 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2013 Vassilii Khachaturov
#
# 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$
"""PS output generator based on Cairo.
"""
import sys
import cairo
from _cairodoc import CairoDocgen
class PSDrawDoc(CairoDocgen):
"""Render the document into PS file using Cairo.
"""
EXT = 'ps'
def create_cairo_surface(self, fobj, width_in_points, height_in_points):
return cairo.PSSurface(fobj, width_in_points, height_in_points)

View File

@ -1,34 +0,0 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2013 Vassilii Khachaturov
#
# 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$
"""PDF output generator based on Cairo.
"""
import sys
import cairo
from _cairodoc import CairoDocgen
class PdfDoc(CairoDocgen):
"""Render the document into PDF file using Cairo.
"""
def create_cairo_surface(self, fobj, width_in_points, height_in_points):
return cairo.PDFSurface(fobj, width_in_points, height_in_points)

View File

@ -291,3 +291,16 @@ def write_index(index, doc):
doc.end_cell() doc.end_cell()
doc.end_row() doc.end_row()
doc.end_table() doc.end_table()
class PdfDoc(CairoDocgen):
"""Render the document into PDF file using Cairo.
"""
def create_cairo_surface(self, fobj, width_in_points, height_in_points):
return cairo.PDFSurface(fobj, width_in_points, height_in_points)
class PsDoc(CairoDocgen):
"""Render the document into PS file using Cairo.
"""
EXT = 'ps'
def create_cairo_surface(self, fobj, width_in_points, height_in_points):
return cairo.PSSurface(fobj, width_in_points, height_in_points)

View File

@ -131,10 +131,10 @@ plg = newplugin()
plg.id = 'pdfdoc' plg.id = 'pdfdoc'
plg.name = _('PDF document') plg.name = _('PDF document')
plg.description = _("Generates documents in PDF format (.pdf).") plg.description = _("Generates documents in PDF format (.pdf).")
plg.version = '1.0' plg.version = '1.1'
plg.gramps_target_version = '3.4' plg.gramps_target_version = '3.4'
plg.status = STABLE plg.status = STABLE
plg.fname = 'PdfDoc.py' plg.fname = 'cairodoc.py'
plg.ptype = DOCGEN plg.ptype = DOCGEN
plg.basedocclass = 'PdfDoc' plg.basedocclass = 'PdfDoc'
plg.paper = True plg.paper = True
@ -143,7 +143,7 @@ plg.extension = "pdf"
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# PSDrawDoc docgen # PsDoc docgen
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -151,12 +151,12 @@ plg = newplugin()
plg.id = 'psdrawdoc' plg.id = 'psdrawdoc'
plg.name = _('PostScript') plg.name = _('PostScript')
plg.description = _("Generates documents in PostScript format (.ps).") plg.description = _("Generates documents in PostScript format (.ps).")
plg.version = '2.0' plg.version = '2.1'
plg.gramps_target_version = '3.4' plg.gramps_target_version = '3.4'
plg.status = STABLE plg.status = STABLE
plg.fname = 'PSDrawDoc.py' plg.fname = 'cairodoc.py'
plg.ptype = DOCGEN plg.ptype = DOCGEN
plg.basedocclass = 'PSDrawDoc' plg.basedocclass = 'PsDoc'
plg.paper = True plg.paper = True
plg.style = True plg.style = True
plg.extension = "ps" plg.extension = "ps"