From f26621be698379ffd284ee2627c7e3061af99ced Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 14 Oct 2002 00:39:26 +0000 Subject: [PATCH] Updated bug checks svn: r1138 --- gramps/TODO | 32 ++++++++++------ gramps/configure | 2 +- gramps/gramps.spec | 2 +- gramps/src/ChooseParents.py | 6 ++- gramps/src/ImgManip.py | 56 +++++++++++++++++++++------- gramps/src/TextDoc.py | 57 ++++++++++++++++++++++++++--- gramps/src/const.py | 2 +- gramps/src/docgen/RTFDoc.py | 47 +++++++++++++----------- gramps/src/gramps_main.py | 2 +- gramps/src/plugins/DescendReport.py | 2 +- 10 files changed, 148 insertions(+), 60 deletions(-) diff --git a/gramps/TODO b/gramps/TODO index 79168315c..2809e5e8d 100644 --- a/gramps/TODO +++ b/gramps/TODO @@ -1,19 +1,14 @@ -* Allow for multiple notes. A tabbed interface would be really useful, - since there are no titles for notes. Not all objects would necessarily - need multiple notes. Determine which ones should and shouldn't. +GRAMPS programming task list. These are tasks that would be nice if +someone would take over. + +Note that most of the development effort is targeted at GNOME 2. + * Drag and drop should display the icon we are dragging instead of just the default icon. Nautilus does this very effectively, and GTK has support for this. * Provide an "import" of a gramps package. Not too difficult to do this, since there is already a ReadTarFile class which will unpackage the file. Needs have an interface built around it. -* Catch uncaught exceptions at the top level, notifiy the user, and - store the results in a file that can be emailed. Have the start of - this with the gramps.err file, but most users don't realize that - this file has been created. Some type of notification is needed. -* Speed up the reading of the database. The python XML routines are not - as fast as I would like, and it can take a minute or so to read a - large database. This is way too slow. * Finish the generic load of revision control interfaces to allow a revision control plugin system. Most of the work is already done. * Extend the gramps package exporting to export to a ISO-9660 CD-ROM @@ -26,6 +21,19 @@ call to generate the zip file using the hard coded path of /usr/bin/zip. Python 2.0 provides a zip interface, so this may need to hold off until the move is made to Python 2.0. -* Sort all lists * Startup tips. -* And a whole lot more.... +* Captialize/Decapitalize names +* FIND by ID +* Better copy/paste handling +* Re-instate alternate names in the name list. This was dropped due to the + need to provide indexing tables to support ZODB. +* Provide an interface to GtkSpell, so that an integrated spelling checking + would be provided. +* Look at providing a backend interface to gnome-db, allowing real database + backends to be pluged into GRAMPS. Maybe replace the ZODB interface. +* Integrate gnome-print into GRAMPS. Currently an interface does not exist + to gnome-print in the gnome-python interface. This would allow print preview + and direct document printing. +* More report formats +* Look at integrating the layout engine from GraphViz, so that more complicated + layout schemes could be used. diff --git a/gramps/configure b/gramps/configure index 703603f74..4113a924a 100755 --- a/gramps/configure +++ b/gramps/configure @@ -1567,7 +1567,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -RELEASE=pl1 +RELEASE=pl2 VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" diff --git a/gramps/gramps.spec b/gramps/gramps.spec index 3a59828e8..bdd3c40de 100644 --- a/gramps/gramps.spec +++ b/gramps/gramps.spec @@ -1,5 +1,5 @@ %define ver 0.8.0 -%define rel pl1 +%define rel pl2 %define prefix /usr Summary: Genealogical Research and Analysis Management Programming System. diff --git a/gramps/src/ChooseParents.py b/gramps/src/ChooseParents.py index e955c98e5..d40b364d9 100644 --- a/gramps/src/ChooseParents.py +++ b/gramps/src/ChooseParents.py @@ -205,8 +205,10 @@ class ChooseParents: self.father_list.sort() self.mother_list.thaw() self.father_list.thaw() - self.father_list.moveto(self.father_list.selection[0],0) - self.mother_list.moveto(self.mother_list.selection[0],0) + if self.father_list.selection: + self.father_list.moveto(self.father_list.selection[0],0) + if self.mother_list.selection: + self.mother_list.moveto(self.mother_list.selection[0],0) if self.type == "Partners": self.mlabel.set_label(_("Parent")) diff --git a/gramps/src/ImgManip.py b/gramps/src/ImgManip.py index b9ac611a6..9f686476b 100644 --- a/gramps/src/ImgManip.py +++ b/gramps/src/ImgManip.py @@ -3,6 +3,24 @@ # # Copyright (C) 2000 Donald N. Allingham # +# Modified August 2002 by Gary Shao +# +# Changed reference to convert variable of Gramps const module to +# a string variable Convert. If Gramps system is present, this is +# set to the value of const.convert, else it is set to the fixed +# value "convert" +# NOTE: this means the module expects to be able to make a system +# call to a program called "convert" if the PIL module is not present. +# The convert program is part of the ImageMagick application, which +# should be installed prior to using this module if PIL is not +# available. +# +# Corrected a bug in the fmt_scale_data method of ImgManip class +# under the PIL case. Call to tostring method of image class +# requires that the format name be in lower case (it uses the +# format name internally to construct the name of the encoder +# function to call, which is in lower case). +# # 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 @@ -19,8 +37,15 @@ # import os -import const import string +import sys + +try: + import const +except: + Convert = "convert" +else: + Convert = const.convert #------------------------------------------------------------------------- # @@ -33,12 +58,16 @@ try: PIL.Image.init() no_pil = 0 except: - import popen2 - import GDK - import GTK - import gtk - import GdkImlib - no_pil = 1 + try: + import popen2 + import GDK + import GTK + import gtk + import GdkImlib + no_pil = 1 + except: + raise "ImgLibException", "Error: No imaging library available" + class ImgManip: def __init__(self,source): @@ -53,15 +82,15 @@ class ImgManip: def fmt_thumbnail(self,dest,width,height,cnv): w = int(width) h = int(height) - cmd = "%s -geometry %dx%d '%s' '%s:%s'" % (const.convert,w,h,self.src,cnv,dest) + cmd = "%s -geometry %dx%d '%s' '%s:%s'" % (Convert,w,h,self.src,cnv,dest) os.system(cmd) def fmt_convert(self,dest,cnv): - cmd = "%s '%s' '%s:%s'" % (const.convert,self.src,cnv,dest) + cmd = "%s '%s' '%s:%s'" % (Convert,self.src,cnv,dest) os.system(cmd) def fmt_data(self,cnv): - cmd = "%s '%s' '%s:-'" % (const.convert,self.src,cnv) + cmd = "%s '%s' '%s:-'" % (Convert,self.src,cnv) r,w = popen2.popen2(cmd) buf = r.read() r.close() @@ -69,7 +98,7 @@ class ImgManip: return buf def fmt_scale_data(self,x,y,cnv): - cmd = "%s -geometry %dx%d '%s' '%s:-'" % (const.convert,x,y,self.src,cnv) + cmd = "%s -geometry %dx%d '%s' '%s:-'" % (Convert,x,y,self.src,cnv) r,w = popen2.popen2(cmd) buf = r.read() r.close() @@ -114,7 +143,8 @@ class ImgManip: if im.mode != 'RGB': im.draft('RGB',im.size) im = im.convert("RGB") - return im.tostring(string.upper(pil),"RGB") + #return im.tostring(string.upper(pil),"RGB") + return im.tostring(pil,"RGB") def jpg_thumbnail(self,dest,width,height): self.fmt_thumbnail(dest,width,height,"jpeg") @@ -155,8 +185,6 @@ class ImgManip: if __name__ == "__main__": - import sys - img = ImgManip(sys.argv[1]) img.jpg_thumbnail("foo.jpg",50,50) img.png_thumbnail("foo.png",50,50) diff --git a/gramps/src/TextDoc.py b/gramps/src/TextDoc.py index c6b50d4e9..c67ba72d0 100644 --- a/gramps/src/TextDoc.py +++ b/gramps/src/TextDoc.py @@ -3,6 +3,37 @@ # # Copyright (C) 2000 Donald N. Allingham # +# Modified September 2002 by Gary Shao +# +# Added line_break() method to TextDoc class to allow breaking a line +# in a paragraph (in those document generators that support it). +# +# Added start_listing() and end_listing() methods to TextDoc class to +# allow displaying text blocks without automatic filling and justification. +# Creating a new listing element seems called for because many document +# generator implementation have to use a different mechanism for text +# that is not going to be automatically filled and justified than that +# used for normal paragraphs. Examples are
 tags in HTML, using
+#   the Verbatim environment in LaTeX, and using the Preformatted class
+#   in reportlab for generating PDF.
+#
+#   Added another option, FONT_MONOSPACE, for use as a font face. This
+#   calls for a fixed-width font (e.g. Courier). It is intended primarily
+#   for supporting the display of text where alignment by character position
+#   may be important, such as in code source or column-aligned data.
+#   Especially useful in styles for the new listing element discussed above.
+#
+#   Added start_italic() and end_italic() methods to TextDoc class to
+#   complement the emphasis of text in a paragraph by bolding with the
+#   ability to italicize segments of text in a paragraph.
+#
+#   Added the show_link() method to TextDoc to enable the creation of
+#   hyperlinks in HTML output. Only produces active links in HTML, while
+#   link will be represented as text in other generator output. (active
+#   links are technically possible in PDF documents, but the reportlab
+#   modules the PDF generator is based on does not support them at this
+#   time)
+#
 # 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
@@ -51,6 +82,7 @@ except:
 #-------------------------------------------------------------------------
 FONT_SANS_SERIF = 0
 FONT_SERIF = 1
+FONT_MONOSPACE = 2
 
 PAPER_PORTRAIT  = 0
 PAPER_LANDSCAPE = 1
@@ -600,7 +632,7 @@ class ParagraphStyle:
 
     def set_alignment(self,align):
         """
-        Sets the pargraph alignment.
+        Sets the paragraph alignment.
 
         align - PARA_ALIGN_LEFT, PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER, or
                 PARA_ALIGN_JUSTIFY
@@ -797,7 +829,7 @@ class StyleSheet:
         Adds a paragraph style to the style sheet.
 
         name - name of the ParagraphStyle
-        style - PargraphStyle instance to be added.
+        style - ParagraphStyle instance to be added.
         """
         self.style_list[name] = ParagraphStyle(style)
 
@@ -1006,6 +1038,10 @@ class TextDoc:
         "Closes the document"
         pass
 
+    def line_break(self):
+        "Forces a line break within a paragraph"
+	pass
+
     def page_break(self):
         "Forces a page break, creating a new page"
         pass
@@ -1016,12 +1052,23 @@ class TextDoc:
     def end_bold(self):
         pass
 
+    def start_listing(self,style_name):
+        """
+	Starts a new listing block, using the specified style name.
+
+        style_name - name of the ParagraphStyle to use for the block.
+	"""
+        pass
+
+    def end_listing(self):
+        pass
+
     def start_paragraph(self,style_name,leader=None):
         """
-        Starts a new pargraph, using the specified style name.
+        Starts a new paragraph, using the specified style name.
 
-        style_name - name of the PargraphStyle to use for the paragraph.
-        leader     - Leading text for a pargraph. Typically ssed for numbering.
+        style_name - name of the ParagraphStyle to use for the paragraph.
+        leader     - Leading text for a paragraph. Typically used for numbering.
         """
         pass
 
diff --git a/gramps/src/const.py b/gramps/src/const.py
index bf9322a1f..9c0b1b353 100644
--- a/gramps/src/const.py
+++ b/gramps/src/const.py
@@ -92,7 +92,7 @@ startup        = 1
 #
 #-------------------------------------------------------------------------
 progName     = "GRAMPS"
-version      = "0.8.0-pl1"
+version      = "0.8.0-pl2"
 copyright    = "© 2001-2002 Donald N. Allingham"
 authors      = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
 comments     = _("GRAMPS (Genealogical Research and Analysis "
diff --git a/gramps/src/docgen/RTFDoc.py b/gramps/src/docgen/RTFDoc.py
index 65c9f1e0c..4ba8d3a27 100644
--- a/gramps/src/docgen/RTFDoc.py
+++ b/gramps/src/docgen/RTFDoc.py
@@ -72,14 +72,14 @@
 from TextDoc import *
 import ImgManip
 
-try:
-    import Plugins
-    import intl
-    _ = intl.gettext
-except:
-    withGramps = 0
-else:
-    withGramps = 1
+#try:
+#    import Plugins
+#    import intl
+#    _ = intl.gettext
+#except:
+#    withGramps = 0
+#else:
+#    withGramps = 1
 
 #------------------------------------------------------------------------
 #
@@ -129,9 +129,11 @@ class RTFDoc(TextDoc):
         self.f.write('{\\f2\\fmodern\\fcharset0\\fprq0 Courier New;}}\n')
         self.f.write('{\colortbl\n')
         self.color_map = {}
-        index = 1
+        index = 2
         self.color_map[(0,0,0)] = 0
         self.f.write('\\red0\\green0\\blue0;')
+        self.color_map[(0,0,255)] = 1
+        self.f.write('\\red0\\green0\\blue255;')
         for style_name in self.style_list.keys():
             style = self.style_list[style_name]
             fgcolor = style.get_font().get_color()
@@ -587,22 +589,23 @@ class RTFDoc(TextDoc):
     #
     #--------------------------------------------------------------------
     def show_link(self, text, href):
-        self.write_text("%s (" % text)
-	self.start_italic()
-	self.write_text(href)
-	self.end_italic()
-	self.write_text(") ")
+        #self.write_text("%s (" % text)
+	#self.start_italic()
+	#self.write_text(href)
+	#self.end_italic()
+	#self.write_text(") ")
+	self.text = self.text + '{\\field{\\*\\fldinst{\ul\cf1  HYPERLINK "%s" }} {\\fldrslt{\ul\cf1 %s}}}' % (href, text)
 
 #------------------------------------------------------------------------
 #
 # Register the document generator with the system if in Gramps
 #
 #------------------------------------------------------------------------
-if withGramps:
-    Plugins.register_text_doc(
-        name=_("Rich Text Format (RTF)"),
-        classref=RTFDoc,
-        table=1,
-        paper=1,
-        style=1
-        )
+#if withGramps:
+#    Plugins.register_text_doc(
+#        name=_("Rich Text Format (RTF)"),
+#        classref=RTFDoc,
+#        table=1,
+#        paper=1,
+#        style=1
+#        )
diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py
index 0e2196cfa..ab6cdd7fa 100755
--- a/gramps/src/gramps_main.py
+++ b/gramps/src/gramps_main.py
@@ -922,7 +922,7 @@ class Gramps:
                 if family.getFather() == None:
                     for child in family.getChildList():
                         child.removeAltFamily(family)
-                    self.db.removeFamily(family)
+                    self.db.deleteFamily(family)
                 else:
                     family.setMother(None)
 
diff --git a/gramps/src/plugins/DescendReport.py b/gramps/src/plugins/DescendReport.py
index 082732717..312c0cf8d 100644
--- a/gramps/src/plugins/DescendReport.py
+++ b/gramps/src/plugins/DescendReport.py
@@ -179,7 +179,7 @@ class DescendantReportDialog(TextReportDialog):
 #
 #------------------------------------------------------------------------
 def report(database,person):
-    DescendantReportDialog(person,database)
+    DescendantReportDialog(database,person)
 
 #------------------------------------------------------------------------
 #