* src/docgen/AbiWord2Doc.py: pychecker fixes

* src/docgen/HtmlDoc.py: pychecker fixes
* src/docgen/KwordDoc.py: pychecker fixes
* src/docgen/LaTeXDoc.py: pychecker fixes
* src/docgen/OpenOfficeDoc.py: pychecker fixes
* src/docgen/OpenSpreadSheet.py: pychecker fixes
* src/docgen/PSDrawDoc.py: pychecker fixes
* src/docgen/PdfDoc.py: pychecker fixes
* src/docgen/SvgDrawDoc.py: pychecker fixes
* src/plugins/Ancestors.py: pychecker fixes
* src/plugins/BookReport.py: pychecker fixes
* src/plugins/CustomBookText.py: pychecker fixes
* src/plugins/DescendReport.py: pychecker fixes
* src/plugins/DetAncestralReport.py: pychecker fixes
* src/plugins/DetDescendantReport.py: pychecker fixes
* src/plugins/FtmStyleAncestors.py: pychecker fixes
* src/plugins/IndivComplete.py: pychecker fixes
* src/plugins/ReadPkg.py: pychecker fixes
* src/plugins/RelCalc.py: pychecker fixes
* src/plugins/SimpleBookTitle.py: pychecker fixes
* src/plugins/TimeLine.py: pychecker fixes
* src/plugins/WriteCD.py: pychecker fixes
* src/plugins/WriteFtree.py: pychecker fixes
* src/plugins/rel_de.py: pychecker fixes
* src/GenericFilter.py: pychecker fixes
* src/RelLib.py: pychecker fixes
* src/Report.py: pychecker fixes
* src/SelectPerson.py: pychecker fixes
* src/gramps_main.py: pychecker fixes


svn: r2634
This commit is contained in:
Don Allingham 2004-01-13 05:05:39 +00:00
parent 3186adda5d
commit 730e6fc24a
31 changed files with 102 additions and 137 deletions

View File

@ -1,3 +1,34 @@
2004-01-12 Don Allingham <dallingham@users.sourceforge.net>
* src/docgen/AbiWord2Doc.py: pychecker fixes
* src/docgen/HtmlDoc.py: pychecker fixes
* src/docgen/KwordDoc.py: pychecker fixes
* src/docgen/LaTeXDoc.py: pychecker fixes
* src/docgen/OpenOfficeDoc.py: pychecker fixes
* src/docgen/OpenSpreadSheet.py: pychecker fixes
* src/docgen/PSDrawDoc.py: pychecker fixes
* src/docgen/PdfDoc.py: pychecker fixes
* src/docgen/SvgDrawDoc.py: pychecker fixes
* src/plugins/Ancestors.py: pychecker fixes
* src/plugins/BookReport.py: pychecker fixes
* src/plugins/CustomBookText.py: pychecker fixes
* src/plugins/DescendReport.py: pychecker fixes
* src/plugins/DetAncestralReport.py: pychecker fixes
* src/plugins/DetDescendantReport.py: pychecker fixes
* src/plugins/FtmStyleAncestors.py: pychecker fixes
* src/plugins/IndivComplete.py: pychecker fixes
* src/plugins/ReadPkg.py: pychecker fixes
* src/plugins/RelCalc.py: pychecker fixes
* src/plugins/SimpleBookTitle.py: pychecker fixes
* src/plugins/TimeLine.py: pychecker fixes
* src/plugins/WriteCD.py: pychecker fixes
* src/plugins/WriteFtree.py: pychecker fixes
* src/plugins/rel_de.py: pychecker fixes
* src/GenericFilter.py: pychecker fixes
* src/RelLib.py: pychecker fixes
* src/Report.py: pychecker fixes
* src/SelectPerson.py: pychecker fixes
* src/gramps_main.py: pychecker fixes
2004-01-12 Alex Roitman <shura@alex.neuro.umn.edu>
* src/PlaceView.py (on_delete_clicked): Use list's copy to avoid
modifying the real EventList (closes # 875332).

View File

@ -814,7 +814,7 @@ class IsParentOfFilterMatch(Rule):
return self.map.has_key(p.getId())
def init_list(self,p):
if fam in p.getMainParents():
for fam in p.getMainParents():
for parent in [fam.getFather (), fam.getMother ()]:
if parent:
self.map[parent.getId()] = 1

View File

@ -2742,7 +2742,7 @@ class GrampsDB:
return self.sourceTable.keys()
def sortbysource(self,f,s):
return cmp(self.sourceTable[f][3],self.placTable[s][3])
return cmp(self.sourceTable[f][3],self.sourceTable[s][3])
def sortSourceKeys(self):
keys = self.sourceTable.keys()

View File

@ -26,6 +26,7 @@
import RelLib
import GrampsCfg
from gettext import gettext as _
#-------------------------------------------------------------------------
#

View File

@ -198,6 +198,7 @@ class BareReportDialog:
# Save info about who the report is about.
self.option_store = options
self.style_name = "default"
self.db = database
self.person = person
self.output_notebook = None
@ -641,10 +642,6 @@ class BareReportDialog:
"""Not used in bare report dialogs. Override in the subclass."""
pass
def setup_paper_frame(self):
"""Not used in bare report dialogs. Override in the subclass."""
pass
def setup_output_notebook(self):
"""Not used in bare report dialogs. Override in the subclass."""
pass
@ -1388,12 +1385,12 @@ class TemplateParser(handler.ContentHandler):
try:
parser = make_parser()
spath = const.template_dir
parser.setContentHandler(TemplateParser(_template_map,spath))
parser.parse("file://%s/templates.xml" % spath)
gspath = const.template_dir
parser.setContentHandler(TemplateParser(_template_map,gspath))
parser.parse("file://%s/templates.xml" % gspath)
parser = make_parser()
spath = os.path.expanduser("~/.gramps/templates")
parser.setContentHandler(TemplateParser(_template_map,spath))
parser.parse("file://%s/templates.xml" % spath)
gspath = os.path.expanduser("~/.gramps/templates")
parser.setContentHandler(TemplateParser(_template_map,gspath))
parser.parse("file://%s/templates.xml" % gspath)
except (IOError,OSError,SAXParseException):
pass

View File

@ -43,8 +43,6 @@ import RelLib
import const
import Utils
import ListModel
import GrampsCfg
from RelLib import Person
#-------------------------------------------------------------------------
#

View File

@ -37,6 +37,7 @@ import BaseDoc
import Errors
import Plugins
import ImgManip
import grampslib
from latin_utf8 import latin_to_utf8
from gettext import gettext as _
@ -177,12 +178,10 @@ class AbiWordDoc(BaseDoc.BaseDoc):
self.f.close()
if self.print_req:
import grampslib
apptype = 'application/x-abiword'
prog = grampslib.default_application_command(apptype)
app = grampslib.default_application_command(apptype)
os.environ["FILE"] = self.filename
os.system ('%s "$FILE" &' % prog)
os.system ('%s "$FILE" &' % app)
def add_photo(self,name,pos,x_cm,y_cm):
@ -314,7 +313,6 @@ class AbiWordDoc(BaseDoc.BaseDoc):
print_label = None
try:
import grampslib
import Utils
prog = grampslib.default_application_command("application/x-abiword")

View File

@ -33,6 +33,7 @@ import const
import Errors
import BaseDoc
import QuestionDialog
import grampslib
from gettext import gettext as _
@ -257,7 +258,7 @@ class HtmlDoc(BaseDoc.BaseDoc):
msg = m[1]
self.file_header = '%s<TITLE>%s</TITLE>%s\n' % (m[0],msg,m[2])
else:
self.file_header = top
self.file_header = self.top
self.file_header = self.process_line(self.file_header)
def build_style_declaration(self):
@ -334,12 +335,10 @@ class HtmlDoc(BaseDoc.BaseDoc):
self.write_support_files()
if self.print_req:
import grampslib
apptype = 'text/html'
prog = grampslib.default_application_command(apptype)
app = grampslib.default_application_command(apptype)
os.environ["FILE"] = self.filename
os.system ('%s "$FILE" &' % prog)
os.system ('%s "$FILE" &' % app)
def write_support_files(self):
if self.map:
@ -473,7 +472,6 @@ class HtmlDoc(BaseDoc.BaseDoc):
print_label = None
try:
import grampslib
import Utils
prog = grampslib.default_application_command("text/html")

View File

@ -27,11 +27,14 @@ import time
import string
import cStringIO
import gzip
import os
import Errors
from TarFile import TarFile
import Plugins
import ImgManip
import grampslib
from gettext import gettext as _
def points(val):
@ -260,18 +263,10 @@ class KwordDoc(BaseDoc.BaseDoc):
self.m.close()
if self.print_req:
import grampslib
apptype = 'application/x-kword'
prog = grampslib.default_application_command(apptype)
app = grampslib.default_application_command(apptype)
os.environ["FILE"] = self.filename
os.system ('%s "$FILE" &' % prog)
def start_page(self,orientation=None):
pass
def end_page(self):
pass
os.system ('%s "$FILE" &' % app)
def start_paragraph(self,style_name,leader=None):
self.format_list = []
@ -492,7 +487,6 @@ class KwordDoc(BaseDoc.BaseDoc):
print_label = None
try:
import grampslib
import Utils
prog = grampslib.default_application_command("application/x-kword")

View File

@ -238,10 +238,6 @@ class LaTeXDoc(BaseDoc.BaseDoc):
self.f.write('\n\\end{document}\n')
self.f.close()
def start_page(self,orientation=None):
"""Nothing needs to be done to start a page"""
pass
def end_page(self):
"""Issue a new page command"""
self.f.write('\\newpage')

View File

@ -43,6 +43,7 @@ import const
import Plugins
import ImgManip
import FontScale
import grampslib
#-------------------------------------------------------------------------
#
@ -51,6 +52,9 @@ import FontScale
#-------------------------------------------------------------------------
from gettext import gettext as _
_apptype = 'application/vnd.sun.xml.writer'
#-------------------------------------------------------------------------
#
# OpenOfficeDoc
@ -361,12 +365,9 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
self._write_meta_file()
self._write_zip()
if self.print_req:
import grampslib
apptype = 'application/vnd.sun.xml.writer'
prog = grampslib.default_application_command(apptype)
app = grampslib.default_application_command(_apptype)
os.environ["FILE"] = self.filename
os.system ('%s "$FILE" &' % prog)
os.system ('%s "$FILE" &' % app)
def add_photo(self,name,pos,x_cm,y_cm):
@ -826,8 +827,6 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
self.f.write('</text:span>\n</text:p>\n</draw:text-box>\n')
def draw_path(self,style,path):
stype = self.draw_styles[style]
minx = 9e12
miny = 9e12
maxx = 0
@ -861,8 +860,6 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
self.f.write('"/>\n')
def draw_line(self,style,x1,y1,x2,y2):
box_style = self.draw_styles[style]
self.f.write('<draw:line draw:style="%s" '% style)
self.f.write('svg:x1="%.3fcm" ' % x1)
self.f.write('svg:y1="%.3fcm" ' % y1)
@ -899,7 +896,6 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
def draw_bar(self,style,x,y,x2,y2):
box_style = self.draw_styles[style]
para_name = box_style.get_paragraph_style()
self.f.write('<draw:rect text:anchor-type="paragraph" draw:style-name="')
self.f.write(style)
@ -974,20 +970,36 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
#--------------------------------------------------------------------------
print_label = None
try:
import grampslib
import Utils
apptype = 'application/vnd.sun.xml.writer'
prog = grampslib.default_application_command(apptype)
prog = grampslib.default_application_command(_apptype)
if Utils.search_for(prog):
print_label = _("Open in OpenOffice.org")
except:
pass
Plugins.register_text_doc(_("OpenOffice.org Writer"),OpenOfficeDoc,1,1,1,
".sxw",print_label)
Plugins.register_book_doc(_("OpenOffice.org Writer"),OpenOfficeDoc,1,1,1,".sxw")
Plugins.register_text_doc(
_("OpenOffice.org Writer"),
OpenOfficeDoc,
1,
1,
1,
".sxw",
print_label)
Plugins.register_draw_doc(_("OpenOffice.org Draw"),OpenOfficeDoc,1,1,".sxd",
print_label);
Plugins.register_book_doc(
_("OpenOffice.org Writer"),
OpenOfficeDoc,
1,
1,
1,
".sxw")
Plugins.register_draw_doc(
_("OpenOffice.org Draw"),
OpenOfficeDoc,
1,
1,
".sxd",
print_label);

View File

@ -39,6 +39,9 @@ from SpreadSheetDoc import *
from latin_utf8 import latin_to_utf8
import const
from gettext import gettext as _
import Errors
#-------------------------------------------------------------------------
#
# OpenSpreadSheet

View File

@ -126,16 +126,10 @@ class PSDrawDoc(BaseDoc.BaseDoc):
if self.print_req:
run_print_dialog (self.filename)
def start_paragraph(self,style_name):
pass
def end_paragraph(self):
pass
def write_text(self,text):
pass
def start_page(self,orientation=None):
def start_page(self):
self.page = self.page + 1
self.f.write("%%Page:")
self.f.write("%d %d\n" % (self.page,self.page))

View File

@ -30,6 +30,7 @@ import Plugins
import Errors
import ImgManip
import FontScale
import grampslib
from gettext import gettext as _
_H = 'Helvetica'
@ -178,12 +179,10 @@ class PdfDoc(BaseDoc.BaseDoc):
DisplayTrace.DisplayTrace()
if self.print_req:
import grampslib
apptype = 'application/pdf'
prog = grampslib.default_application_command(apptype)
app = grampslib.default_application_command(apptype)
os.environ["FILE"] = self.filename
os.system ('%s "$FILE" &' % prog)
os.system ('%s "$FILE" &' % app)
def page_break(self):
self.story.append(PageBreak())
@ -351,10 +350,7 @@ class PdfDoc(BaseDoc.BaseDoc):
text = text.replace('&lt;/super&gt;','</super></font>')
self.text = self.text + text.replace('\n','<br>')
def print_report(self):
return run_print_dialog (self.filename)
def start_page(self,orientation=None):
def start_page(self):
x = self.get_usable_width()*cm
y = self.get_usable_height()*cm
self.drawing = reportlab.graphics.shapes.Drawing(x,y)
@ -524,7 +520,6 @@ class PdfDoc(BaseDoc.BaseDoc):
self.drawing.add(s)
def center_print(self,lines,font,x,y,w,h):
l = len(lines)
size = font.get_size()
start_y = (y + h/2.0 + l/2.0 + l) - ((l*size) + ((l-1)*0.2))/2.0
@ -537,7 +532,7 @@ class PdfDoc(BaseDoc.BaseDoc):
for text in lines:
s = reportlab.graphics.shapes.String(start_x*cm,
start_y*cm,
str(line),
str(text),
fontName=fnt,
fontSize=size,
strokeColor=sc,
@ -546,7 +541,6 @@ class PdfDoc(BaseDoc.BaseDoc):
start_y = start_y - size*1.2
def left_print(self,lines,font,x,y):
l = len(lines)
size = font.get_size()
start_y = y
start_x = x
@ -581,7 +575,6 @@ def make_color(c):
print_label = None
try:
import grampslib
import Utils
prog = grampslib.default_application_command("application/pdf")

View File

@ -61,16 +61,7 @@ class SvgDrawDoc(BaseDoc.BaseDoc):
def close(self):
pass
def start_paragraph(self,style_name):
pass
def end_paragraph(self):
pass
def write_text(self,text):
pass
def start_page(self,orientation=None):
def start_page(self):
self.page = self.page + 1
if self.page != 1:
name = "%s-%d.svg" % (self.root,self.page)

View File

@ -434,7 +434,7 @@ class Gramps:
self.back.set_sensitive(0)
self.forward.set_sensitive(0)
except:
self.clear_history
self.clear_history()
self.gomenuitem.remove_submenu()
self.gomenuitem.set_submenu(gomenu)
@ -526,7 +526,7 @@ class Gramps:
self.fwdbtn.set_sensitive(1)
self.forward.set_sensitive(1)
except:
self.clear_history
self.clear_history()
else:
self.backbtn.set_sensitive(0)
self.back.set_sensitive(0)
@ -552,7 +552,7 @@ class Gramps:
self.backbtn.set_sensitive(1)
self.back.set_sensitive(1)
except:
self.clear_history
self.clear_history()
else:
self.fwdbtn.set_sensitive(0)
self.forward.set_sensitive(0)
@ -1613,7 +1613,7 @@ class Gramps:
def update_after_merge(self,person,old_id):
if person:
self.people_view.remove_from_person_list(person.getId(),old_id)
self.db.buildPersonDisplay(person.getId(),original_id)
self.db.buildPersonDisplay(person.getId(),old_id)
self.people_view.redisplay_person_list(person)
self.update_display(0)

View File

@ -498,10 +498,6 @@ class ComprehensiveAncestorsReport (Report.Report):
def parents_of (self, person):
gender = person.getGender ()
if gender == RelLib.Person.female:
childof = '. ' + _("She is the daughter of ")
else:
childof = '. ' + _("He is the son of ")
family = person.getMainParents ()
ret = '. '

View File

@ -32,7 +32,6 @@
#
#-------------------------------------------------------------------------
import os
import string
#-------------------------------------------------------------------------
#
@ -526,7 +525,6 @@ class BookListDisplay:
iter = self.blist.add([name])
if iter:
self.blist.selection.select_iter(iter)
path = self.blist.model.get_path(iter)
def on_booklist_ok_clicked(self,obj):
"""Returns selected book. Saves the current list into xml file."""
@ -901,7 +899,6 @@ class BookReportDialog(Report.ReportDialog):
"""
def __init__(self,database,person,book):
import BaseDoc
Report.BareReportDialog.__init__(self,database,person)
self.book = book
self.database = database
@ -1082,9 +1079,8 @@ def get_xpm_image():
#
#
#------------------------------------------------------------------------
from Plugins import register_report
register_report(
Plugins.register_report(
report,
_("Book Report"),
category=_("Books"),

View File

@ -22,15 +22,6 @@
# largely based on the SimpleBookTitle.py by Don Allingham
#
#------------------------------------------------------------------------
#
# python modules
#
#------------------------------------------------------------------------
import os
import string
import cStringIO
#------------------------------------------------------------------------
#
# gramps modules
@ -38,14 +29,11 @@ import cStringIO
#------------------------------------------------------------------------
import Report
import BaseDoc
import RelLib
import Errors
from QuestionDialog import ErrorDialog
from gettext import gettext as _
import gtk
import gnome
import gnome.ui
#------------------------------------------------------------------------
#

View File

@ -27,7 +27,6 @@
#------------------------------------------------------------------------
import os
import sort
import string
#------------------------------------------------------------------------
#

View File

@ -24,9 +24,7 @@
import RelLib
import os
import sort
import Errors
import string
from gettext import gettext as _
from QuestionDialog import ErrorDialog

View File

@ -24,9 +24,7 @@
import RelLib
import os
import sort
import Errors
import string
from QuestionDialog import ErrorDialog
from gettext import gettext as _

View File

@ -26,7 +26,6 @@
#
#------------------------------------------------------------------------
import os
import string
import cStringIO
#------------------------------------------------------------------------

View File

@ -26,7 +26,6 @@
#
#------------------------------------------------------------------------
import os
import string
#------------------------------------------------------------------------
#
@ -173,7 +172,7 @@ class IndivComplete(Report.Report):
self.d.start_row()
self.d.start_cell('IDS-NormalCell',2)
format = self.person.getNoteFormat()
self.doc.write_note(note,format,'IDS-Normal')
self.d.write_note(note,format,'IDS-Normal')
self.d.end_cell()
self.d.end_row()
@ -644,6 +643,7 @@ def write_book_item(database,person,doc,options,newpage=0):
except:
import DisplayTrace
DisplayTrace.DisplayTrace()
return None
#------------------------------------------------------------------------
#

View File

@ -30,7 +30,6 @@ from gettext import gettext as _
import gtk
import const
import os
import time
from QuestionDialog import ErrorDialog, WarningDialog
import TarFile

View File

@ -34,8 +34,6 @@ import os
# GNOME libraries
#
#-------------------------------------------------------------------------
from gtk import *
from gnome.ui import *
import gtk.glade
#-------------------------------------------------------------------------
@ -44,7 +42,6 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import RelLib
import Utils
import ListModel
import Plugins
@ -156,9 +153,8 @@ class RelCalc:
#
#
#-------------------------------------------------------------------------
from Plugins import register_tool
register_tool(
Plugins.register_tool(
runTool,
_("Relationship calculator"),
category=_("Utilities"),

View File

@ -25,7 +25,6 @@
#
#------------------------------------------------------------------------
import os
import string
#------------------------------------------------------------------------
#
@ -34,7 +33,6 @@ import string
#------------------------------------------------------------------------
import Report
import BaseDoc
import RelLib
import Errors
from QuestionDialog import ErrorDialog
from gettext import gettext as _
@ -43,8 +41,6 @@ import Utils
import AddMedia
import gtk
import gnome
import gnome.ui
#------------------------------------------------------------------------
#

View File

@ -46,7 +46,6 @@ import gtk
import Utils
import Report
import BaseDoc
import BaseDoc
import GenericFilter
import Errors
import Date

View File

@ -27,7 +27,6 @@
# standard python modules
#
#-------------------------------------------------------------------------
import time
import os
from cStringIO import StringIO
@ -50,7 +49,6 @@ import WriteXML
import Utils
import const
import QuestionDialog
import RelImage
import ImgManip
from gettext import gettext as _

View File

@ -27,7 +27,6 @@
# standard python modules
#
#-------------------------------------------------------------------------
import time
import os
from cStringIO import StringIO
@ -45,8 +44,6 @@ import gnome
# GRAMPS modules
#
#-------------------------------------------------------------------------
import WriteXML
import TarFile
import Utils
import GenericFilter
import Errors

View File

@ -33,8 +33,8 @@
#-------------------------------------------------------------------------
import RelLib
import GrampsCfg
from Relationship import apply_filter as getallancestors
from gettext import gettext as _
#-------------------------------------------------------------------------
#