Report cleanup.

svn: r94
This commit is contained in:
Don Allingham 2001-06-07 13:49:00 +00:00
parent 666722bb4b
commit 88ff9fd74f
22 changed files with 935 additions and 738 deletions

View File

@ -859,7 +859,7 @@
<widget> <widget>
<class>GtkFrame</class> <class>GtkFrame</class>
<name>frame6</name> <name>frame6</name>
<label>Indentification</label> <label>Identification</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child> <child>

View File

@ -79,7 +79,7 @@ class HtmlDoc(TextDoc):
if top_add == 1: if top_add == 1:
self.top.append(line) self.top.append(line)
match = start.search(line) match = start.search(line)
if match != None: if match:
top_add = 0 top_add = 0
elif bottom_add == 0: elif bottom_add == 0:
match = stop.search(line) match = stop.search(line)

View File

@ -192,9 +192,9 @@ class StyleEditor:
else: else:
p.set_alignment(PARA_ALIGN_JUSTIFY) p.set_alignment(PARA_ALIGN_JUSTIFY)
p.set_right_margin(float(self.top.get_widget("rmargin").get_text())) p.set_right_margin(utils.txt2fl(self.top.get_widget("rmargin").get_text()))
p.set_left_margin(float(self.top.get_widget("lmargin").get_text())) p.set_left_margin(utils.txt2fl(self.top.get_widget("lmargin").get_text()))
p.set_padding(float(self.top.get_widget("pad").get_text())) p.set_padding(utils.txt2fl(self.top.get_widget("pad").get_text()))
p.set_top_border(self.top.get_widget("tborder").get_active()) p.set_top_border(self.top.get_widget("tborder").get_active())
p.set_left_border(self.top.get_widget("lborder").get_active()) p.set_left_border(self.top.get_widget("lborder").get_active())
p.set_right_border(self.top.get_widget("rborder").get_active()) p.set_right_border(self.top.get_widget("rborder").get_active())

View File

@ -22,6 +22,7 @@ import string
import os import os
import xml.sax import xml.sax
import xml.sax.saxutils import xml.sax.saxutils
import utils
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -424,10 +425,11 @@ class StyleSheetList:
f.write('bold="%d" ' % font.get_bold()) f.write('bold="%d" ' % font.get_bold())
f.write('underline="%d" ' % font.get_bold()) f.write('underline="%d" ' % font.get_bold())
f.write('color="#%02x%02x%02x"/>\n' % font.get_color()) f.write('color="#%02x%02x%02x"/>\n' % font.get_color())
f.write('<para rmargin="%.3f" ' % p.get_right_margin()) f.write('<para ')
f.write('lmargin="%.3f" ' % p.get_left_margin()) f.write('rmargin="%s" ' % utils.fl2txt("%.3f",p.get_right_margin()))
f.write('first="%.3f" ' % p.get_first_indent()) f.write('lmargin="%.3f" ' % utils.fl2txt("%.3f",p.get_left_margin()))
f.write('pad="%.3f" ' % p.get_padding()) f.write('first="%.3f" ' % utils.fl2txt("%.3f",p.get_first_indent()))
f.write('pad="%.3f" ' % utils.fl2txt("%.3f",p.get_padding()))
f.write('bgcolor="#%02x%02x%02x" ' % p.get_background_color()) f.write('bgcolor="#%02x%02x%02x" ' % p.get_background_color())
f.write('align="%d" ' % p.get_alignment()) f.write('align="%d" ' % p.get_alignment())
f.write('tborder="%d" ' % p.get_top_border()) f.write('tborder="%d" ' % p.get_top_border())
@ -517,10 +519,10 @@ class SheetParser(xml.sax.handler.ContentHandler):
self.f.set_underline(int(attrs['underline'])) self.f.set_underline(int(attrs['underline']))
self.f.set_color(cnv2color(attrs['color'])) self.f.set_color(cnv2color(attrs['color']))
elif tag == "para": elif tag == "para":
self.p.set_right_margin(float(attrs['rmargin'])) self.p.set_right_margin(utils.txt2fl(attrs['rmargin']))
self.p.set_left_margin(float(attrs['lmargin'])) self.p.set_left_margin(utils.txt2fl(attrs['lmargin']))
self.p.set_first_indent(float(attrs['first'])) self.p.set_first_indent(utils.txt2fl(attrs['first']))
self.p.set_padding(float(attrs['pad'])) self.p.set_padding(utils.txt2fl(attrs['pad']))
self.p.set_alignment(int(attrs['align'])) self.p.set_alignment(int(attrs['align']))
self.p.set_right_border(int(attrs['rborder'])) self.p.set_right_border(int(attrs['rborder']))
self.p.set_left_border(int(attrs['lborder'])) self.p.set_left_border(int(attrs['lborder']))

View File

@ -172,7 +172,7 @@
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>label2</name> <name>label2</name>
<label>label2</label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>

View File

@ -71,9 +71,7 @@ progName = "gramps"
version = "0.2.0" version = "0.2.0"
copyright = "(C) 2001 Donald N. Allingham" copyright = "(C) 2001 Donald N. Allingham"
authors = ["Donald N. Allingham"] authors = ["Donald N. Allingham"]
comments = _("Gramps (Genealogical Research and Analysis Management ") +\ comments = _("Gramps (Genealogical Research and Analysis Management Programming System) is a personal genealogy program that can be extended by using the Python programming language.")
_("Programming System) is a personal genealogy program that ") +\
_("can be extended by using the Python programming language.")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -151,7 +149,7 @@ personalConstantEvents = {
personalConstantAttributes = { personalConstantAttributes = {
"Description" : "DSCR", "Description" : "DSCR",
"Indentification Number": "IDNO", "Identification Number": "IDNO",
"Social Security Number": "SSN" "Social Security Number": "SSN"
} }

View File

@ -221,7 +221,7 @@
<handler>on_sources_activate</handler> <handler>on_sources_activate</handler>
<last_modification_time>Wed, 30 May 2001 01:59:42 GMT</last_modification_time> <last_modification_time>Wed, 30 May 2001 01:59:42 GMT</last_modification_time>
</signal> </signal>
<label>Sources</label> <label>_Sources</label>
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </widget>
</widget> </widget>
@ -1288,7 +1288,7 @@
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>Notebook:tab</child_name> <child_name>Notebook:tab</child_name>
<name>label199</name> <name>label199</name>
<label>label199</label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>
@ -1309,7 +1309,7 @@
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>Notebook:tab</child_name> <child_name>Notebook:tab</child_name>
<name>label200</name> <name>label200</name>
<label>label200</label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>

View File

@ -257,7 +257,7 @@ def on_save_clicked(obj):
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
def get_description(): def get_description():
return _("Produces a graphical ancestral tree graph") return _("Produces a graphical ancestral tree")
#------------------------------------------------------------------------ #------------------------------------------------------------------------

View File

@ -381,7 +381,7 @@ def mysort(first, second) :
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
def get_description(): def get_description():
return _("Produces a graphical ancestral tree graph") return _("Displays an ancestral tree graph")
def get_name(): def get_name():
return _("View/View an ancestor graph") return _("View/View an ancestor graph")

View File

@ -84,7 +84,7 @@ class DescendantReport:
name = self.person.getPrimaryName().getRegularName() name = self.person.getPrimaryName().getRegularName()
self.doc.write_text(_("Descendants of %s") % name) self.doc.write_text(_("Descendants of %s") % name)
self.doc.end_paragraph() self.doc.end_paragraph()
self.dump(1,self.person) self.dump(0,self.person)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# #
@ -92,6 +92,8 @@ class DescendantReport:
# #
#-------------------------------------------------------------------- #--------------------------------------------------------------------
def dump(self,level,person): def dump(self,level,person):
if level != 0:
self.doc.start_paragraph("Level" + str(level)) self.doc.start_paragraph("Level" + str(level))
self.doc.write_text(str(level) + '. ') self.doc.write_text(str(level) + '. ')
self.doc.write_text(person.getPrimaryName().getRegularName()) self.doc.write_text(person.getPrimaryName().getRegularName())

View File

@ -428,7 +428,10 @@ def report(database,person):
spouse = family.getMother() spouse = family.getMother()
else: else:
spouse = family.getFather() spouse = family.getFather()
if spouse:
item = GtkMenuItem(spouse.getPrimaryName().getName()) item = GtkMenuItem(spouse.getPrimaryName().getName())
else:
item = GtkMenuItem("unknown")
item.set_data("f",family) item.set_data("f",family)
item.show() item.show()
my_menu.append(item) my_menu.append(item)
@ -496,7 +499,7 @@ def on_save_clicked(obj):
item = topDialog.get_widget("format").get_menu().get_active() item = topDialog.get_widget("format").get_menu().get_active()
format = item.get_data("name") format = item.get_data("name")
doc = FindDoc.make_text_doc(format,paper,orien,template) doc = FindDoc.make_text_doc(styles,format,paper,orien,template)
MyReport = FamilyGroup(db,family,outputName,doc) MyReport = FamilyGroup(db,family,outputName,doc)

View File

@ -243,7 +243,7 @@ def dump_index(person_list,file):
def get_description(): def get_description():
return _("Generates relationship graphs, currently only in GraphViz format.") + \ return _("Generates relationship graphs, currently only in GraphViz format.") + \
" " + \ " " + \
_("GraphViz (dot) will transform the graph into postscript, jpeg, png, vrml, svg, and many other formats.") + \ _("GraphViz (dot) can transform the graph into postscript, jpeg, png, vrml, svg, and many other formats.") + \
" " + \ " " + \
_("For more information or to get a copy of GraphViz, goto http://www.graphviz.org") _("For more information or to get a copy of GraphViz, goto http://www.graphviz.org")

View File

@ -215,6 +215,7 @@ def report(database,person):
name = person.getPrimaryName().getName() name = person.getPrimaryName().getName()
topDialog.get_widget("personName").set_text(name) topDialog.get_widget("personName").set_text(name)
topDialog.get_widget("prefix").get_text("ind")
top.show() top.show()

View File

@ -334,6 +334,9 @@ def report(database,person):
global db global db
global style_sheet_list global style_sheet_list
if person == None:
return
active_person = person active_person = person
db = database db = database

View File

@ -153,7 +153,7 @@
<editable>True</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
<text_max_length>0</text_max_length> <text_max_length>0</text_max_length>
<text>ind</text> <text></text>
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>

View File

@ -745,7 +745,7 @@
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>label51</name> <name>label51</name>
<label>label51</label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>
@ -1399,7 +1399,7 @@
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>label50</name> <name>label50</name>
<label>label48</label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>

File diff suppressed because it is too large Load Diff

View File

@ -184,7 +184,7 @@
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>label2</name> <name>label2</name>
<label>label2</label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>

View File

@ -97,3 +97,34 @@ def destroy_passed_object(obj):
while gtk.events_pending(): while gtk.events_pending():
gtk.mainiteration() gtk.mainiteration()
#-------------------------------------------------------------------------
#
# Get around python's interpretation of commas/periods in floating
# point numbers
#
#-------------------------------------------------------------------------
import string
if string.find("%.3f" % 1.2, ",") == -1:
_use_comma = 0
else:
_use_comma = 1
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def txt2fl(st):
if _use_comma:
return string.atof(string.replace(st,'.',','))
else:
return string.atof(string.replace(st,',','.'))
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def fl2txt(fmt,val):
return string.replace(fmt % val, ',', '.')