diff --git a/gramps2/src/docgen/AbiWord2Doc.py b/gramps2/src/docgen/AbiWord2Doc.py index 6efc7c820..10261eedb 100644 --- a/gramps2/src/docgen/AbiWord2Doc.py +++ b/gramps2/src/docgen/AbiWord2Doc.py @@ -28,7 +28,7 @@ Provides a TextDoc based interface to the AbiWord document format. #------------------------------------------------------------------------- import base64 -import TextDoc +import BaseDoc import Errors import Plugins import ImgManip @@ -41,14 +41,14 @@ from gettext import gettext as _ # Class Definitions # #------------------------------------------------------------------------- -class AbiWordDoc(TextDoc.TextDoc): - """AbiWord document generator. Inherits from the TextDoc generic +class AbiWordDoc(BaseDoc.BaseDoc): + """AbiWord document generator. Inherits from the BaseDoc generic document interface class.""" def __init__(self,styles,type,template,orientation): """Initializes the AbiWordDoc class, calling the __init__ routine - of the parent TextDoc class""" - TextDoc.TextDoc.__init__(self,styles,type,template,orientation) + of the parent BaseDoc class""" + BaseDoc.BaseDoc.__init__(self,styles,type,template,orientation) self.f = None self.level = 0 self.new_page = 0 @@ -96,7 +96,7 @@ class AbiWordDoc(TextDoc.TextDoc): # page size section self.f.write('\n') self.f.write('') font = style.get_font() self.f.write('\n' % (pad,pad)) - if p.get_alignment() == TextDoc.PARA_ALIGN_CENTER: + if p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER: self.f.write('\n') - elif p.get_alignment() == TextDoc.PARA_ALIGN_JUSTIFY: + elif p.get_alignment() == BaseDoc.PARA_ALIGN_JUSTIFY: self.f.write('\n') - elif p.get_alignment() == TextDoc.PARA_ALIGN_RIGHT: + elif p.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT: self.f.write('\n') else: self.f.write('\n') @@ -191,7 +191,7 @@ class KwordDoc(TextDoc.TextDoc): font = p.get_font() self.f.write('\n') - if font.get_type_face==TextDoc.FONT_SANS_SERIF: + if font.get_type_face==BaseDoc.FONT_SANS_SERIF: self.f.write('\n') else: self.f.write('\n') @@ -269,7 +269,7 @@ class KwordDoc(TextDoc.TextDoc): self.style_name = style_name self.p = self.style_list[self.style_name] self.font = self.p.get_font() - if self.font.get_type_face() == TextDoc.FONT_SERIF: + if self.font.get_type_face() == BaseDoc.FONT_SERIF: self.font_face = "Arial" else: self.font_face = "Times New Roman" @@ -305,11 +305,11 @@ class KwordDoc(TextDoc.TextDoc): pad = points(self.p.get_padding())/2 self.f.write('\n' % (pad,pad)) - if self.p.get_alignment() == TextDoc.PARA_ALIGN_CENTER: + if self.p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER: self.f.write('\n') - elif self.p.get_alignment() == TextDoc.PARA_ALIGN_JUSTIFY: + elif self.p.get_alignment() == BaseDoc.PARA_ALIGN_JUSTIFY: self.f.write('\n') - elif self.p.get_alignment() == TextDoc.PARA_ALIGN_RIGHT: + elif self.p.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT: self.f.write('\n') else: self.f.write('\n') diff --git a/gramps2/src/docgen/LaTeXDoc.py b/gramps2/src/docgen/LaTeXDoc.py index bab1f8ea3..d106bdfd0 100644 --- a/gramps2/src/docgen/LaTeXDoc.py +++ b/gramps2/src/docgen/LaTeXDoc.py @@ -35,7 +35,7 @@ import string # gramps modules # #------------------------------------------------------------------------ -import TextDoc +import BaseDoc import Plugins import ImgManip import Errors @@ -65,8 +65,8 @@ class TexFont: # LaTeXDon # #------------------------------------------------------------------------ -class LaTeXDoc(TextDoc.TextDoc): - """LaTeX document interface class. Derived from TextDoc""" +class LaTeXDoc(BaseDoc.BaseDoc): + """LaTeX document interface class. Derived from BaseDoc""" def open(self,filename): """Opens the specified file, making sure that it has the @@ -90,7 +90,7 @@ class LaTeXDoc(TextDoc.TextDoc): options = "12pt" - if self.orientation == TextDoc.PAPER_LANDSCAPE: + if self.orientation == BaseDoc.PAPER_LANDSCAPE: options = options + ",landscape" # Paper selections are somewhat limited on a stock installation. @@ -176,7 +176,7 @@ class LaTeXDoc(TextDoc.TextDoc): thisstyle.font_beg = thisstyle.font_beg + "\\hfill" # Establish font face and shape - if font.get_type_face() == TextDoc.FONT_SANS_SERIF: + if font.get_type_face() == BaseDoc.FONT_SANS_SERIF: thisstyle.font_beg = thisstyle.font_beg + "\\sffamily" thisstyle.font_end = "\\rmfamily" + thisstyle.font_end if font.get_bold(): diff --git a/gramps2/src/docgen/PdfDoc.py b/gramps2/src/docgen/PdfDoc.py index f9ea18284..17eaba147 100644 --- a/gramps2/src/docgen/PdfDoc.py +++ b/gramps2/src/docgen/PdfDoc.py @@ -23,7 +23,7 @@ # gramps modules # #------------------------------------------------------------------------ -import TextDoc +import BaseDoc import Plugins import Errors import ImgManip @@ -64,7 +64,7 @@ class GrampsDocTemplate(BaseDocTemplate): # # #------------------------------------------------------------------------ -class PdfDoc(TextDoc.TextDoc): +class PdfDoc(BaseDoc.BaseDoc): def open(self,filename): if filename[-4:] != ".pdf": @@ -99,7 +99,7 @@ class PdfDoc(TextDoc.TextDoc): pdf_style.fontSize = font.get_size() pdf_style.bulletFontSize = font.get_size() - if font.get_type_face() == TextDoc.FONT_SERIF: + if font.get_type_face() == BaseDoc.FONT_SERIF: if font.get_bold(): if font.get_italic(): pdf_style.fontName = "Times-BoldItalic" @@ -133,11 +133,11 @@ class PdfDoc(TextDoc.TextDoc): pdf_style.bulletIndent = first align = style.get_alignment() - if align == TextDoc.PARA_ALIGN_RIGHT: + if align == BaseDoc.PARA_ALIGN_RIGHT: pdf_style.alignment = TA_RIGHT - elif align == TextDoc.PARA_ALIGN_LEFT: + elif align == BaseDoc.PARA_ALIGN_LEFT: pdf_style.alignment = TA_LEFT - elif align == TextDoc.PARA_ALIGN_CENTER: + elif align == BaseDoc.PARA_ALIGN_CENTER: pdf_style.alignment = TA_CENTER else: pdf_style.alignment = TA_JUSTIFY @@ -239,7 +239,7 @@ class PdfDoc(TextDoc.TextDoc): p = self.my_para f = p.get_font() - if f.get_type_face() == TextDoc.FONT_SANS_SERIF: + if f.get_type_face() == BaseDoc.FONT_SANS_SERIF: if f.get_bold(): fn = 'Helvetica-Bold' else: @@ -265,9 +265,9 @@ class PdfDoc(TextDoc.TextDoc): self.tblstyle.append(('LINEABOVE', loc, loc, 1, black)) if self.my_table_style.get_bottom_border(): self.tblstyle.append(('LINEBELOW', loc, loc, 1, black)) - if p.get_alignment() == TextDoc.PARA_ALIGN_LEFT: + if p.get_alignment() == BaseDoc.PARA_ALIGN_LEFT: self.tblstyle.append(('ALIGN', loc, loc, 'LEFT')) - elif p.get_alignment() == TextDoc.PARA_ALIGN_RIGHT: + elif p.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT: self.tblstyle.append(('ALIGN', loc, loc, 'RIGHT')) else: self.tblstyle.append(('ALIGN', loc, loc, 'CENTER')) diff --git a/gramps2/src/docgen/RTFDoc.py b/gramps2/src/docgen/RTFDoc.py index dad1900d8..cdc79d21b 100644 --- a/gramps2/src/docgen/RTFDoc.py +++ b/gramps2/src/docgen/RTFDoc.py @@ -20,10 +20,10 @@ #------------------------------------------------------------------------ # -# Load the base TextDoc class +# Load the base BaseDoc class # #------------------------------------------------------------------------ -import TextDoc +import BaseDoc import Plugins import ImgManip import Errors @@ -48,7 +48,7 @@ def twips(cm): # use style sheets. Instead it writes raw formatting. # #------------------------------------------------------------------------ -class RTFDoc(TextDoc.TextDoc): +class RTFDoc(BaseDoc.BaseDoc): #-------------------------------------------------------------------- # @@ -140,7 +140,7 @@ class RTFDoc(TextDoc.TextDoc): size = f.get_size()*2 bgindex = self.color_map[p.get_background_color()] fgindex = self.color_map[f.get_color()] - if f.get_type_face() == TextDoc.FONT_SERIF: + if f.get_type_face() == BaseDoc.FONT_SERIF: self.font_type = '\\f0\\fs%d\\cf%d\\cb%d' % (size,fgindex,bgindex) else: self.font_type = '\\f1\\fs%d\\cf%d\\cb%d' % (size,fgindex,bgindex) @@ -155,14 +155,14 @@ class RTFDoc(TextDoc.TextDoc): if not self.in_table: self.f.write('\\pard') - if p.get_alignment() == TextDoc.PARA_ALIGN_RIGHT: + if p.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT: self.f.write('\\qr') - elif p.get_alignment() == TextDoc.PARA_ALIGN_CENTER: + elif p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER: self.f.write('\\qc') self.f.write('\\ri%d' % twips(p.get_right_margin())) self.f.write('\\li%d' % twips(p.get_left_margin())) self.f.write('\\fi%d' % twips(p.get_first_indent())) - if p.get_alignment() == TextDoc.PARA_ALIGN_JUSTIFY: + if p.get_alignment() == BaseDoc.PARA_ALIGN_JUSTIFY: self.f.write('\\qj') if p.get_padding(): self.f.write('\\sa%d' % twips(p.get_padding()/2.0)) diff --git a/gramps2/src/plugins/FanChart.py b/gramps2/src/plugins/FanChart.py index f7f43d022..e4b14fa31 100644 --- a/gramps2/src/plugins/FanChart.py +++ b/gramps2/src/plugins/FanChart.py @@ -211,7 +211,6 @@ class FanChart: def circle_1(self,center,y,size): (xc,yc) = self.doc.draw_wedge("c1", center, y, size, 180, 360) - print center, y, xc, yc self.doc.rotate_text("c1n", self.get_info(self.map[0]), xc, yc ,0) def circle_2(self,center,y,size):