* src/plugins/FanChart.py: remove print statement
* src/docgen/RTFDoc.py: change from TextDoc to BaseDoc * src/docgen/PdfDoc.py: change from TextDoc to BaseDoc * src/docgen/LaTeXDoc.py: change from TextDoc to BaseDoc * src/docgen/KwordDoc.py: change from TextDoc to BaseDoc * src/docgen/HtmlDoc.py: change from TextDoc to BaseDoc * src/docgen/AbiWordDoc.py: change from TextDoc to BaseDoc * src/docgen/AbiWord2Doc.py: change from TextDoc to BaseDoc svn: r2036
This commit is contained in:
parent
3d80f515b2
commit
5f736636a3
@ -28,7 +28,7 @@ Provides a TextDoc based interface to the AbiWord document format.
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
import TextDoc
|
import BaseDoc
|
||||||
import Errors
|
import Errors
|
||||||
import Plugins
|
import Plugins
|
||||||
import ImgManip
|
import ImgManip
|
||||||
@ -41,14 +41,14 @@ from gettext import gettext as _
|
|||||||
# Class Definitions
|
# Class Definitions
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class AbiWordDoc(TextDoc.TextDoc):
|
class AbiWordDoc(BaseDoc.BaseDoc):
|
||||||
"""AbiWord document generator. Inherits from the TextDoc generic
|
"""AbiWord document generator. Inherits from the BaseDoc generic
|
||||||
document interface class."""
|
document interface class."""
|
||||||
|
|
||||||
def __init__(self,styles,type,template,orientation):
|
def __init__(self,styles,type,template,orientation):
|
||||||
"""Initializes the AbiWordDoc class, calling the __init__ routine
|
"""Initializes the AbiWordDoc class, calling the __init__ routine
|
||||||
of the parent TextDoc class"""
|
of the parent BaseDoc class"""
|
||||||
TextDoc.TextDoc.__init__(self,styles,type,template,orientation)
|
BaseDoc.BaseDoc.__init__(self,styles,type,template,orientation)
|
||||||
self.f = None
|
self.f = None
|
||||||
self.level = 0
|
self.level = 0
|
||||||
self.new_page = 0
|
self.new_page = 0
|
||||||
@ -96,7 +96,7 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
# page size section
|
# page size section
|
||||||
self.f.write('<pagesize ')
|
self.f.write('<pagesize ')
|
||||||
self.f.write('pagetype="%s" ' % self.paper.get_name())
|
self.f.write('pagetype="%s" ' % self.paper.get_name())
|
||||||
if self.orientation == TextDoc.PAPER_PORTRAIT:
|
if self.orientation == BaseDoc.PAPER_PORTRAIT:
|
||||||
self.f.write('orientation="portrait" ')
|
self.f.write('orientation="portrait" ')
|
||||||
else:
|
else:
|
||||||
self.f.write('orientation="landscape" ')
|
self.f.write('orientation="landscape" ')
|
||||||
@ -118,11 +118,11 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
self.f.write('<s type="P" name="%s" basedon="" followedby="" props="' % style_name)
|
self.f.write('<s type="P" name="%s" basedon="" followedby="" props="' % style_name)
|
||||||
self.f.write('margin-top:%.4fin; ' % (float(style.get_padding())/2.54))
|
self.f.write('margin-top:%.4fin; ' % (float(style.get_padding())/2.54))
|
||||||
self.f.write('margin-bottom:%.4fin; ' % (float(style.get_padding())/2.54))
|
self.f.write('margin-bottom:%.4fin; ' % (float(style.get_padding())/2.54))
|
||||||
if style.get_alignment() == TextDoc.PARA_ALIGN_RIGHT:
|
if style.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT:
|
||||||
self.f.write('text-align:right;')
|
self.f.write('text-align:right;')
|
||||||
elif style.get_alignment() == TextDoc.PARA_ALIGN_LEFT:
|
elif style.get_alignment() == BaseDoc.PARA_ALIGN_LEFT:
|
||||||
self.f.write('text-align:left;')
|
self.f.write('text-align:left;')
|
||||||
elif style.get_alignment() == TextDoc.PARA_ALIGN_CENTER:
|
elif style.get_alignment() == BaseDoc.PARA_ALIGN_CENTER:
|
||||||
self.f.write('text-align:center;')
|
self.f.write('text-align:center;')
|
||||||
else:
|
else:
|
||||||
self.f.write('text-align:justify;')
|
self.f.write('text-align:justify;')
|
||||||
@ -135,7 +135,7 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
self.f.write(' text-indent:%.4fin;' % indent)
|
self.f.write(' text-indent:%.4fin;' % indent)
|
||||||
font = style.get_font()
|
font = style.get_font()
|
||||||
self.f.write(' font-family:')
|
self.f.write(' font-family:')
|
||||||
if font.get_type_face() == TextDoc.FONT_SANS_SERIF:
|
if font.get_type_face() == BaseDoc.FONT_SANS_SERIF:
|
||||||
self.f.write('Arial; ')
|
self.f.write('Arial; ')
|
||||||
else:
|
else:
|
||||||
self.f.write('Times New Roman; ')
|
self.f.write('Times New Roman; ')
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
"""
|
"""
|
||||||
Provides a TextDoc based interface to the AbiWord document format.
|
Provides a BaseDoc based interface to the AbiWord document format.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -29,7 +29,7 @@ Provides a TextDoc based interface to the AbiWord document format.
|
|||||||
import os
|
import os
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
import TextDoc
|
import BaseDoc
|
||||||
from latin_utf8 import latin_to_utf8
|
from latin_utf8 import latin_to_utf8
|
||||||
import string
|
import string
|
||||||
import Plugins
|
import Plugins
|
||||||
@ -42,14 +42,14 @@ from gettext import gettext as _
|
|||||||
# Class Definitions
|
# Class Definitions
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class AbiWordDoc(TextDoc.TextDoc):
|
class AbiWordDoc(BaseDoc.BaseDoc):
|
||||||
"""AbiWord document generator. Inherits from the TextDoc generic
|
"""AbiWord document generator. Inherits from the BaseDoc generic
|
||||||
document interface class."""
|
document interface class."""
|
||||||
|
|
||||||
def __init__(self,styles,type,template,orientation):
|
def __init__(self,styles,type,template,orientation):
|
||||||
"""Initializes the AbiWordDoc class, calling the __init__ routine
|
"""Initializes the AbiWordDoc class, calling the __init__ routine
|
||||||
of the parent TextDoc class"""
|
of the parent BaseDoc class"""
|
||||||
TextDoc.TextDoc.__init__(self,styles,type,template,orientation)
|
BaseDoc.BaseDoc.__init__(self,styles,type,template,orientation)
|
||||||
self.f = None
|
self.f = None
|
||||||
self.level = 0
|
self.level = 0
|
||||||
self.new_page = 0
|
self.new_page = 0
|
||||||
@ -79,7 +79,7 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
self.f.write('version="0.9.6.1" fileformat="1.0">\n')
|
self.f.write('version="0.9.6.1" fileformat="1.0">\n')
|
||||||
self.f.write('<pagesize ')
|
self.f.write('<pagesize ')
|
||||||
self.f.write('pagetype="%s" ' % self.paper.get_name())
|
self.f.write('pagetype="%s" ' % self.paper.get_name())
|
||||||
if self.orientation == TextDoc.PAPER_PORTRAIT:
|
if self.orientation == BaseDoc.PAPER_PORTRAIT:
|
||||||
self.f.write('orientation="portrait" ')
|
self.f.write('orientation="portrait" ')
|
||||||
else:
|
else:
|
||||||
self.f.write('orientation="landscape" ')
|
self.f.write('orientation="landscape" ')
|
||||||
@ -158,11 +158,11 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
self.f.write('<p props="')
|
self.f.write('<p props="')
|
||||||
self.f.write('margin-top:%.4fin; ' % (float(style.get_padding())/2.54))
|
self.f.write('margin-top:%.4fin; ' % (float(style.get_padding())/2.54))
|
||||||
self.f.write('margin-bottom:%.4fin; ' % (float(style.get_padding())/2.54))
|
self.f.write('margin-bottom:%.4fin; ' % (float(style.get_padding())/2.54))
|
||||||
if style.get_alignment() == TextDoc.PARA_ALIGN_RIGHT:
|
if style.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT:
|
||||||
self.f.write('text-align:right;')
|
self.f.write('text-align:right;')
|
||||||
elif style.get_alignment() == TextDoc.PARA_ALIGN_LEFT:
|
elif style.get_alignment() == BaseDoc.PARA_ALIGN_LEFT:
|
||||||
self.f.write('text-align:left;')
|
self.f.write('text-align:left;')
|
||||||
elif style.get_alignment() == TextDoc.PARA_ALIGN_CENTER:
|
elif style.get_alignment() == BaseDoc.PARA_ALIGN_CENTER:
|
||||||
self.f.write('text-align:center;')
|
self.f.write('text-align:center;')
|
||||||
else:
|
else:
|
||||||
self.f.write('text-align:justify;')
|
self.f.write('text-align:justify;')
|
||||||
@ -176,7 +176,7 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
self.f.write('">')
|
self.f.write('">')
|
||||||
font = style.get_font()
|
font = style.get_font()
|
||||||
self.f.write('<c props="font-family:')
|
self.f.write('<c props="font-family:')
|
||||||
if font.get_type_face() == TextDoc.FONT_SANS_SERIF:
|
if font.get_type_face() == BaseDoc.FONT_SANS_SERIF:
|
||||||
self.f.write('Arial;')
|
self.f.write('Arial;')
|
||||||
else:
|
else:
|
||||||
self.f.write('Times New Roman;')
|
self.f.write('Times New Roman;')
|
||||||
@ -203,7 +203,7 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
self.current_style = style
|
self.current_style = style
|
||||||
font = style.get_font()
|
font = style.get_font()
|
||||||
self.cdata = '<c props="font-family:'
|
self.cdata = '<c props="font-family:'
|
||||||
if font.get_type_face() == TextDoc.FONT_SANS_SERIF:
|
if font.get_type_face() == BaseDoc.FONT_SANS_SERIF:
|
||||||
self.cdata = self.cdata + 'Arial;'
|
self.cdata = self.cdata + 'Arial;'
|
||||||
else:
|
else:
|
||||||
self.cdata = self.cdata + 'Times New Roman;'
|
self.cdata = self.cdata + 'Times New Roman;'
|
||||||
@ -245,7 +245,7 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
def start_bold(self):
|
def start_bold(self):
|
||||||
font = self.current_style.get_font()
|
font = self.current_style.get_font()
|
||||||
self.f.write('</c><c props="font-family:')
|
self.f.write('</c><c props="font-family:')
|
||||||
if font.get_type_face() == TextDoc.FONT_SANS_SERIF:
|
if font.get_type_face() == BaseDoc.FONT_SANS_SERIF:
|
||||||
self.f.write('Arial;')
|
self.f.write('Arial;')
|
||||||
else:
|
else:
|
||||||
self.f.write('Times New Roman;')
|
self.f.write('Times New Roman;')
|
||||||
@ -263,7 +263,7 @@ class AbiWordDoc(TextDoc.TextDoc):
|
|||||||
def end_bold(self):
|
def end_bold(self):
|
||||||
font = self.current_style.get_font()
|
font = self.current_style.get_font()
|
||||||
self.f.write('</c><c props="font-family:')
|
self.f.write('</c><c props="font-family:')
|
||||||
if font.get_type_face() == TextDoc.FONT_SANS_SERIF:
|
if font.get_type_face() == BaseDoc.FONT_SANS_SERIF:
|
||||||
self.f.write('Arial;')
|
self.f.write('Arial;')
|
||||||
else:
|
else:
|
||||||
self.f.write('Times New Roman;')
|
self.f.write('Times New Roman;')
|
||||||
|
@ -29,7 +29,7 @@ import ImgManip
|
|||||||
import TarFile
|
import TarFile
|
||||||
import const
|
import const
|
||||||
import Errors
|
import Errors
|
||||||
import TextDoc
|
import BaseDoc
|
||||||
|
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
|
||||||
@ -74,10 +74,10 @@ _bottom = [
|
|||||||
# HtmlDoc
|
# HtmlDoc
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class HtmlDoc(TextDoc.TextDoc):
|
class HtmlDoc(BaseDoc.BaseDoc):
|
||||||
|
|
||||||
def __init__(self,styles,type,template,orientation,source=None):
|
def __init__(self,styles,type,template,orientation,source=None):
|
||||||
TextDoc.TextDoc.__init__(self,styles,TextDoc.PaperStyle("",0,0),template,None)
|
BaseDoc.BaseDoc.__init__(self,styles,BaseDoc.PaperStyle("",0,0),template,None)
|
||||||
self.year = time.localtime(time.time())[0]
|
self.year = time.localtime(time.time())[0]
|
||||||
self.ext = '.html'
|
self.ext = '.html'
|
||||||
if source == None:
|
if source == None:
|
||||||
@ -116,7 +116,7 @@ class HtmlDoc(TextDoc.TextDoc):
|
|||||||
self.ext = val
|
self.ext = val
|
||||||
|
|
||||||
def set_owner(self,owner):
|
def set_owner(self,owner):
|
||||||
TextDoc.TextDoc.set_owner(self,owner)
|
BaseDoc.BaseDoc.set_owner(self,owner)
|
||||||
self.copyright = 'Copyright © %d %s' % (self.year,self.owner)
|
self.copyright = 'Copyright © %d %s' % (self.year,self.owner)
|
||||||
|
|
||||||
def set_image_dir(self,dirname):
|
def set_image_dir(self,dirname):
|
||||||
@ -295,7 +295,7 @@ class HtmlDoc(TextDoc.TextDoc):
|
|||||||
italic = 'font-style:italic; '
|
italic = 'font-style:italic; '
|
||||||
if font.get_bold():
|
if font.get_bold():
|
||||||
bold = 'font-weight:bold; '
|
bold = 'font-weight:bold; '
|
||||||
if font.get_type_face() == TextDoc.FONT_SANS_SERIF:
|
if font.get_type_face() == BaseDoc.FONT_SANS_SERIF:
|
||||||
family = '"Helvetica","Arial","sans-serif"'
|
family = '"Helvetica","Arial","sans-serif"'
|
||||||
else:
|
else:
|
||||||
family = '"Times New Roman","Times","serif"'
|
family = '"Times New Roman","Times","serif"'
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
import TextDoc
|
import BaseDoc
|
||||||
from latin_utf8 import latin_to_utf8
|
from latin_utf8 import latin_to_utf8
|
||||||
|
|
||||||
import time
|
import time
|
||||||
@ -40,7 +40,7 @@ def points(val):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class KwordDoc(TextDoc.TextDoc):
|
class KwordDoc(BaseDoc.BaseDoc):
|
||||||
|
|
||||||
def open(self,filename):
|
def open(self,filename):
|
||||||
self.photo_list = []
|
self.photo_list = []
|
||||||
@ -99,7 +99,7 @@ class KwordDoc(TextDoc.TextDoc):
|
|||||||
|
|
||||||
self.f.write('width="%d" ' % points(self.width))
|
self.f.write('width="%d" ' % points(self.width))
|
||||||
self.f.write('height="%d" ' % points(self.height))
|
self.f.write('height="%d" ' % points(self.height))
|
||||||
if self.orientation == TextDoc.PAPER_PORTRAIT:
|
if self.orientation == BaseDoc.PAPER_PORTRAIT:
|
||||||
self.f.write('orientation="0" ')
|
self.f.write('orientation="0" ')
|
||||||
else:
|
else:
|
||||||
self.f.write('orientation="1" ')
|
self.f.write('orientation="1" ')
|
||||||
@ -174,11 +174,11 @@ class KwordDoc(TextDoc.TextDoc):
|
|||||||
|
|
||||||
pad = points(p.get_padding())/2
|
pad = points(p.get_padding())/2
|
||||||
self.f.write('<OFFSETS before="%d" after="%d"/>\n' % (pad,pad))
|
self.f.write('<OFFSETS before="%d" after="%d"/>\n' % (pad,pad))
|
||||||
if p.get_alignment() == TextDoc.PARA_ALIGN_CENTER:
|
if p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER:
|
||||||
self.f.write('<FLOW value="center"/>\n')
|
self.f.write('<FLOW value="center"/>\n')
|
||||||
elif p.get_alignment() == TextDoc.PARA_ALIGN_JUSTIFY:
|
elif p.get_alignment() == BaseDoc.PARA_ALIGN_JUSTIFY:
|
||||||
self.f.write('<FLOW value="justify"/>\n')
|
self.f.write('<FLOW value="justify"/>\n')
|
||||||
elif p.get_alignment() == TextDoc.PARA_ALIGN_RIGHT:
|
elif p.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT:
|
||||||
self.f.write('<FLOW value="right"/>\n')
|
self.f.write('<FLOW value="right"/>\n')
|
||||||
else:
|
else:
|
||||||
self.f.write('<FLOW value="left"/>\n')
|
self.f.write('<FLOW value="left"/>\n')
|
||||||
@ -191,7 +191,7 @@ class KwordDoc(TextDoc.TextDoc):
|
|||||||
|
|
||||||
font = p.get_font()
|
font = p.get_font()
|
||||||
self.f.write('<FORMAT>\n')
|
self.f.write('<FORMAT>\n')
|
||||||
if font.get_type_face==TextDoc.FONT_SANS_SERIF:
|
if font.get_type_face==BaseDoc.FONT_SANS_SERIF:
|
||||||
self.f.write('<FONT name="helvetica"/>\n')
|
self.f.write('<FONT name="helvetica"/>\n')
|
||||||
else:
|
else:
|
||||||
self.f.write('<FONT name="times"/>\n')
|
self.f.write('<FONT name="times"/>\n')
|
||||||
@ -269,7 +269,7 @@ class KwordDoc(TextDoc.TextDoc):
|
|||||||
self.style_name = style_name
|
self.style_name = style_name
|
||||||
self.p = self.style_list[self.style_name]
|
self.p = self.style_list[self.style_name]
|
||||||
self.font = self.p.get_font()
|
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"
|
self.font_face = "Arial"
|
||||||
else:
|
else:
|
||||||
self.font_face = "Times New Roman"
|
self.font_face = "Times New Roman"
|
||||||
@ -305,11 +305,11 @@ class KwordDoc(TextDoc.TextDoc):
|
|||||||
pad = points(self.p.get_padding())/2
|
pad = points(self.p.get_padding())/2
|
||||||
self.f.write('<OFFSETS before="%d" after="%d"/>\n' % (pad,pad))
|
self.f.write('<OFFSETS before="%d" after="%d"/>\n' % (pad,pad))
|
||||||
|
|
||||||
if self.p.get_alignment() == TextDoc.PARA_ALIGN_CENTER:
|
if self.p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER:
|
||||||
self.f.write('<FLOW value="center"/>\n')
|
self.f.write('<FLOW value="center"/>\n')
|
||||||
elif self.p.get_alignment() == TextDoc.PARA_ALIGN_JUSTIFY:
|
elif self.p.get_alignment() == BaseDoc.PARA_ALIGN_JUSTIFY:
|
||||||
self.f.write('<FLOW value="justify"/>\n')
|
self.f.write('<FLOW value="justify"/>\n')
|
||||||
elif self.p.get_alignment() == TextDoc.PARA_ALIGN_RIGHT:
|
elif self.p.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT:
|
||||||
self.f.write('<FLOW value="right"/>\n')
|
self.f.write('<FLOW value="right"/>\n')
|
||||||
else:
|
else:
|
||||||
self.f.write('<FLOW value="left"/>\n')
|
self.f.write('<FLOW value="left"/>\n')
|
||||||
|
@ -35,7 +35,7 @@ import string
|
|||||||
# gramps modules
|
# gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import TextDoc
|
import BaseDoc
|
||||||
import Plugins
|
import Plugins
|
||||||
import ImgManip
|
import ImgManip
|
||||||
import Errors
|
import Errors
|
||||||
@ -65,8 +65,8 @@ class TexFont:
|
|||||||
# LaTeXDon
|
# LaTeXDon
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class LaTeXDoc(TextDoc.TextDoc):
|
class LaTeXDoc(BaseDoc.BaseDoc):
|
||||||
"""LaTeX document interface class. Derived from TextDoc"""
|
"""LaTeX document interface class. Derived from BaseDoc"""
|
||||||
|
|
||||||
def open(self,filename):
|
def open(self,filename):
|
||||||
"""Opens the specified file, making sure that it has the
|
"""Opens the specified file, making sure that it has the
|
||||||
@ -90,7 +90,7 @@ class LaTeXDoc(TextDoc.TextDoc):
|
|||||||
|
|
||||||
options = "12pt"
|
options = "12pt"
|
||||||
|
|
||||||
if self.orientation == TextDoc.PAPER_LANDSCAPE:
|
if self.orientation == BaseDoc.PAPER_LANDSCAPE:
|
||||||
options = options + ",landscape"
|
options = options + ",landscape"
|
||||||
|
|
||||||
# Paper selections are somewhat limited on a stock installation.
|
# Paper selections are somewhat limited on a stock installation.
|
||||||
@ -176,7 +176,7 @@ class LaTeXDoc(TextDoc.TextDoc):
|
|||||||
thisstyle.font_beg = thisstyle.font_beg + "\\hfill"
|
thisstyle.font_beg = thisstyle.font_beg + "\\hfill"
|
||||||
|
|
||||||
# Establish font face and shape
|
# 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_beg = thisstyle.font_beg + "\\sffamily"
|
||||||
thisstyle.font_end = "\\rmfamily" + thisstyle.font_end
|
thisstyle.font_end = "\\rmfamily" + thisstyle.font_end
|
||||||
if font.get_bold():
|
if font.get_bold():
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
# gramps modules
|
# gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import TextDoc
|
import BaseDoc
|
||||||
import Plugins
|
import Plugins
|
||||||
import Errors
|
import Errors
|
||||||
import ImgManip
|
import ImgManip
|
||||||
@ -64,7 +64,7 @@ class GrampsDocTemplate(BaseDocTemplate):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class PdfDoc(TextDoc.TextDoc):
|
class PdfDoc(BaseDoc.BaseDoc):
|
||||||
|
|
||||||
def open(self,filename):
|
def open(self,filename):
|
||||||
if filename[-4:] != ".pdf":
|
if filename[-4:] != ".pdf":
|
||||||
@ -99,7 +99,7 @@ class PdfDoc(TextDoc.TextDoc):
|
|||||||
pdf_style.fontSize = font.get_size()
|
pdf_style.fontSize = font.get_size()
|
||||||
pdf_style.bulletFontSize = 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_bold():
|
||||||
if font.get_italic():
|
if font.get_italic():
|
||||||
pdf_style.fontName = "Times-BoldItalic"
|
pdf_style.fontName = "Times-BoldItalic"
|
||||||
@ -133,11 +133,11 @@ class PdfDoc(TextDoc.TextDoc):
|
|||||||
pdf_style.bulletIndent = first
|
pdf_style.bulletIndent = first
|
||||||
|
|
||||||
align = style.get_alignment()
|
align = style.get_alignment()
|
||||||
if align == TextDoc.PARA_ALIGN_RIGHT:
|
if align == BaseDoc.PARA_ALIGN_RIGHT:
|
||||||
pdf_style.alignment = TA_RIGHT
|
pdf_style.alignment = TA_RIGHT
|
||||||
elif align == TextDoc.PARA_ALIGN_LEFT:
|
elif align == BaseDoc.PARA_ALIGN_LEFT:
|
||||||
pdf_style.alignment = TA_LEFT
|
pdf_style.alignment = TA_LEFT
|
||||||
elif align == TextDoc.PARA_ALIGN_CENTER:
|
elif align == BaseDoc.PARA_ALIGN_CENTER:
|
||||||
pdf_style.alignment = TA_CENTER
|
pdf_style.alignment = TA_CENTER
|
||||||
else:
|
else:
|
||||||
pdf_style.alignment = TA_JUSTIFY
|
pdf_style.alignment = TA_JUSTIFY
|
||||||
@ -239,7 +239,7 @@ class PdfDoc(TextDoc.TextDoc):
|
|||||||
|
|
||||||
p = self.my_para
|
p = self.my_para
|
||||||
f = p.get_font()
|
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():
|
if f.get_bold():
|
||||||
fn = 'Helvetica-Bold'
|
fn = 'Helvetica-Bold'
|
||||||
else:
|
else:
|
||||||
@ -265,9 +265,9 @@ class PdfDoc(TextDoc.TextDoc):
|
|||||||
self.tblstyle.append(('LINEABOVE', loc, loc, 1, black))
|
self.tblstyle.append(('LINEABOVE', loc, loc, 1, black))
|
||||||
if self.my_table_style.get_bottom_border():
|
if self.my_table_style.get_bottom_border():
|
||||||
self.tblstyle.append(('LINEBELOW', loc, loc, 1, black))
|
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'))
|
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'))
|
self.tblstyle.append(('ALIGN', loc, loc, 'RIGHT'))
|
||||||
else:
|
else:
|
||||||
self.tblstyle.append(('ALIGN', loc, loc, 'CENTER'))
|
self.tblstyle.append(('ALIGN', loc, loc, 'CENTER'))
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Load the base TextDoc class
|
# Load the base BaseDoc class
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import TextDoc
|
import BaseDoc
|
||||||
import Plugins
|
import Plugins
|
||||||
import ImgManip
|
import ImgManip
|
||||||
import Errors
|
import Errors
|
||||||
@ -48,7 +48,7 @@ def twips(cm):
|
|||||||
# use style sheets. Instead it writes raw formatting.
|
# 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
|
size = f.get_size()*2
|
||||||
bgindex = self.color_map[p.get_background_color()]
|
bgindex = self.color_map[p.get_background_color()]
|
||||||
fgindex = self.color_map[f.get_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)
|
self.font_type = '\\f0\\fs%d\\cf%d\\cb%d' % (size,fgindex,bgindex)
|
||||||
else:
|
else:
|
||||||
self.font_type = '\\f1\\fs%d\\cf%d\\cb%d' % (size,fgindex,bgindex)
|
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:
|
if not self.in_table:
|
||||||
self.f.write('\\pard')
|
self.f.write('\\pard')
|
||||||
if p.get_alignment() == TextDoc.PARA_ALIGN_RIGHT:
|
if p.get_alignment() == BaseDoc.PARA_ALIGN_RIGHT:
|
||||||
self.f.write('\\qr')
|
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('\\qc')
|
||||||
self.f.write('\\ri%d' % twips(p.get_right_margin()))
|
self.f.write('\\ri%d' % twips(p.get_right_margin()))
|
||||||
self.f.write('\\li%d' % twips(p.get_left_margin()))
|
self.f.write('\\li%d' % twips(p.get_left_margin()))
|
||||||
self.f.write('\\fi%d' % twips(p.get_first_indent()))
|
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')
|
self.f.write('\\qj')
|
||||||
if p.get_padding():
|
if p.get_padding():
|
||||||
self.f.write('\\sa%d' % twips(p.get_padding()/2.0))
|
self.f.write('\\sa%d' % twips(p.get_padding()/2.0))
|
||||||
|
@ -211,7 +211,6 @@ class FanChart:
|
|||||||
|
|
||||||
def circle_1(self,center,y,size):
|
def circle_1(self,center,y,size):
|
||||||
(xc,yc) = self.doc.draw_wedge("c1", center, y, size, 180, 360)
|
(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)
|
self.doc.rotate_text("c1n", self.get_info(self.map[0]), xc, yc ,0)
|
||||||
|
|
||||||
def circle_2(self,center,y,size):
|
def circle_2(self,center,y,size):
|
||||||
|
Loading…
Reference in New Issue
Block a user