* src/docgen/LPRDoc.py (draw_path,draw_bar): Fill, then stroke.
* src/DbPrompter.py: Change file filter name. * src/Report.py (doc_type_changed): Deal with empty extensions. * src/docgen/AsciiDoc.py (add_photo): Add method; (end_row): Inlcude last cell into proper formatting. * src/GedcomInfo.py: Properly import expat.ParserCreate class. * src/TipOfDay.py: Properly import expat.ParserCreate class. * src/RecentFiles.py: Properly import expat.ParserCreate class. * src/ReadXML.py: Properly import expat.* classes. * doc/gramps-manual/C/usage.xml: Update. * doc/gramps-manual/C/usage.xml: Update. * doc/xmldocs.make: Switch Makefile from CLEANFILES to DISTCLEANFILES. * src/Makefile.am: Add const.pyc and const.pyo to CLEANFILES. svn: r4051
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000 Donald N. Allingham
|
||||
# Copyright (C) 2000-2005 Donald N. Allingham
|
||||
#
|
||||
# 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
|
||||
@@ -18,6 +18,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
import const
|
||||
|
||||
ADOPT_NONE = 0
|
||||
@@ -50,7 +52,7 @@ SOURCE_REFS_YES = 1
|
||||
# XML parser
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import xml.parsers.expat
|
||||
from xml.parsers.expat import ParserCreate
|
||||
|
||||
class GedcomDescription:
|
||||
def __init__(self,name):
|
||||
@@ -190,7 +192,7 @@ class GedInfoParser:
|
||||
self.current = None
|
||||
|
||||
def parse(self,file):
|
||||
p = xml.parsers.expat.ParserCreate()
|
||||
p = ParserCreate()
|
||||
p.StartElementHandler = self.startElement
|
||||
p.ParseFile(file)
|
||||
|
||||
|
@@ -4,7 +4,7 @@ SUBDIRS = docgen plugins dates data po
|
||||
|
||||
# For intl. support, how do we compile?
|
||||
MOSTLYCLEANFILES =
|
||||
|
||||
CLEANFILES = const.pyc const.pyo
|
||||
# What are the PYTHON scripts for this package that need to be handled?
|
||||
#
|
||||
# We only want optimized byte-compiled (.pyo) versions, no .pyc
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2004 Donald N. Allingham
|
||||
# Copyright (C) 2000-2005 Donald N. Allingham
|
||||
#
|
||||
# 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
|
||||
@@ -29,7 +29,7 @@ import string
|
||||
import os
|
||||
import gtk
|
||||
import shutil
|
||||
import xml.parsers.expat
|
||||
from xml.parsers.expat import ExpatError, ParserCreate
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -125,7 +125,7 @@ def importData(database, filename, callback=None,cl=0,use_trans=True):
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return
|
||||
except xml.parsers.expat.ExpatError, msg:
|
||||
except ExpatError, msg:
|
||||
if cl:
|
||||
print "Error reading %s" % filename
|
||||
print "The file is probably either corrupt or not a valid GRAMPS database."
|
||||
@@ -538,7 +538,7 @@ class GrampsParser:
|
||||
self.trans = self.db.transaction_begin()
|
||||
else:
|
||||
self.trans = None
|
||||
p = xml.parsers.expat.ParserCreate()
|
||||
p = ParserCreate()
|
||||
p.StartElementHandler = self.startElement
|
||||
p.EndElementHandler = self.endElement
|
||||
p.CharacterDataHandler = self.characters
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2004 Donald N. Allingham
|
||||
# Copyright (C) 2004-2005 Donald N. Allingham
|
||||
#
|
||||
# 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
|
||||
@@ -30,7 +30,7 @@
|
||||
import os
|
||||
import fcntl
|
||||
import time
|
||||
import xml.parsers.expat
|
||||
from xml.parsers.expat import ParserCreate
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -285,7 +285,7 @@ class GnomeRecentParser:
|
||||
xml_file = open(os.path.expanduser(GNOME_FILENAME))
|
||||
fcntl.lockf(xml_file,fcntl.LOCK_SH)
|
||||
|
||||
p = xml.parsers.expat.ParserCreate()
|
||||
p = ParserCreate()
|
||||
p.StartElementHandler = self.startElement
|
||||
p.EndElementHandler = self.endElement
|
||||
p.CharacterDataHandler = self.characters
|
||||
@@ -345,7 +345,7 @@ class GrampsRecentParser:
|
||||
xml_file = open(os.path.expanduser(GRAMPS_FILENAME))
|
||||
fcntl.lockf(xml_file,fcntl.LOCK_SH)
|
||||
|
||||
p = xml.parsers.expat.ParserCreate()
|
||||
p = ParserCreate()
|
||||
p.StartElementHandler = self.startElement
|
||||
p.EndElementHandler = self.endElement
|
||||
p.CharacterDataHandler = self.characters
|
||||
|
@@ -1050,6 +1050,8 @@ class ReportDialog(BareReportDialog):
|
||||
ext_val = obj.get_ext()
|
||||
if ext_val:
|
||||
fname = spath + ext_val
|
||||
else:
|
||||
fname = spath
|
||||
self.target_fileentry.set_filename(fname)
|
||||
|
||||
# Does this report format use styles?
|
||||
|
@@ -25,7 +25,7 @@
|
||||
# standard python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import xml.parsers.expat
|
||||
from xml.parsers.expat import ParserCreate
|
||||
from random import Random
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -100,7 +100,7 @@ class TipParser:
|
||||
self.mylist = []
|
||||
xml_file = open(const.tipdata)
|
||||
self.tlist = []
|
||||
p = xml.parsers.expat.ParserCreate()
|
||||
p = ParserCreate()
|
||||
p.StartElementHandler = self.startElement
|
||||
p.EndElementHandler = self.endElement
|
||||
p.CharacterDataHandler = self.characters
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2004 Donald N. Allingham
|
||||
# Copyright (C) 2000-2005 Donald N. Allingham
|
||||
#
|
||||
# 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
|
||||
@@ -25,20 +25,18 @@
|
||||
# python modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import string
|
||||
import os
|
||||
import GrampsMime
|
||||
from gettext import gettext as _
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Load the base BaseDoc class
|
||||
# Gramps modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import BaseDoc
|
||||
import PluginMgr
|
||||
import Errors
|
||||
|
||||
from gettext import gettext as _
|
||||
import GrampsMime
|
||||
|
||||
LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER'
|
||||
_WIDTH_IN_CHARS = 72
|
||||
@@ -291,7 +289,7 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
||||
for cell in range(self.ncols):
|
||||
if self.cell_widths[cell]:
|
||||
blanks = ' '*self.cell_widths[cell] + '\n'
|
||||
if self.cell_lines[cell] < self.maxlines and cell < self.ncols - 1:
|
||||
if self.cell_lines[cell] < self.maxlines:
|
||||
self.cellpars[cell] = self.cellpars[cell] \
|
||||
+ blanks * (self.maxlines-self.cell_lines[cell])
|
||||
cell_text[cell] = self.cellpars[cell].split('\n')
|
||||
@@ -327,6 +325,13 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
||||
if self.cell_lines[self.cellnum] > self.maxlines:
|
||||
self.maxlines = self.cell_lines[self.cellnum]
|
||||
|
||||
def add_photo(self,name,pos,x,y):
|
||||
this_text = '(photo)'
|
||||
if self.in_cell:
|
||||
self.cellpars[self.cellnum] = self.cellpars[self.cellnum] + this_text
|
||||
else:
|
||||
self.f.write(this_text)
|
||||
|
||||
def write_note(self,text,format,style_name):
|
||||
if format == 1:
|
||||
for line in text.split('\n'):
|
||||
@@ -337,7 +342,7 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
||||
for line in text.split('\n\n'):
|
||||
self.start_paragraph(style_name)
|
||||
line = line.replace('\n',' ')
|
||||
line = string.join(string.split(line))
|
||||
line = ' '.join(line.split())
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
|
||||
|
Reference in New Issue
Block a user