Hopefully removed *.so files from the building of the tarball, added

GraphViz patches from Alexandre Duret-Lutz.


svn: r1129
This commit is contained in:
Don Allingham 2002-09-04 12:54:38 +00:00
parent 8ccfd0438b
commit 9d94d34a1f
6 changed files with 138 additions and 102 deletions

View File

@ -1,5 +1,5 @@
%define ver 0.8.0
%define rel 1
%define rel pl1
%define prefix /usr
Summary: Genealogical Research and Analysis Management Programming System.

View File

@ -39,7 +39,7 @@ import GTK
import gtk
import gnome.ui
import libglade
from gnome.config import *
import gnome.config
#-------------------------------------------------------------------------
#
@ -228,10 +228,10 @@ def loadConfig(call):
lastfile = get_string("/gramps/data/LastFile")
usetabs = get_bool("/gramps/config/UseTabs")
uselds = get_bool("/gramps/config/UseLDS")
ac = get_bool("/gramps/config/DisableAutoComplete")
mediaref = get_bool("/gramps/config/MakeReference")
globalprop = get_bool("/gramps/config/DisplayGlobal")
localprop = get_bool("/gramps/config/DisplayLocal")
ac = get_bool("/gramps/config/DisableAutoComplete",0)
mediaref = get_bool("/gramps/config/MakeReference",1)
globalprop = get_bool("/gramps/config/DisplayGlobal",1)
localprop = get_bool("/gramps/config/DisplayLocal",1)
calendar = get_bool("/gramps/config/ShowCalendar")
usevc = get_bool("/gramps/config/UseVersionControl")
vc_comment = get_bool("/gramps/config/UseComment")
@ -241,7 +241,7 @@ def loadConfig(call):
index_visible = get_bool("/gramps/config/IndexVisible")
show_detail = get_bool("/gramps/config/ShowDetail")
status_bar = get_int("/gramps/config/StatusBar")
t = get_int("/gramps/config/ToolBar")
t = get_int("/gramps/config/ToolBar",2)
if t == 0:
toolbar = 2
else:
@ -250,7 +250,7 @@ def loadConfig(call):
attr_name = get_string("/gramps/config/DisplayAttrName")
hide_altnames = get_bool("/gramps/config/DisplayAltNames")
autoload = get_bool("/gramps/config/autoLoad")
autoload = get_bool("/gramps/config/autoLoad",0)
autosave_int = get_int("/gramps/config/autoSaveInterval")
dateFormat = get_int("/gramps/config/dateFormat")
dateEntry = get_int("/gramps/config/dateEntry")
@ -323,60 +323,12 @@ def loadConfig(call):
if attr_name == None:
attr_name = ""
if autoload == None:
autoload = 1
if autosave_int == None:
autosave_int = 0
if mediaref == None:
mediaref = 1
if globalprop == None:
globalprop = 1
if localprop == None:
localprop =1
if usetabs == None:
usetabs = 0
if uselds == None:
uselds = 0
if ac == None:
autocomp = 1
else:
autocomp = not ac
if calendar == None:
calendar = 0
if usevc == None:
usevc = 0
if vc_comment == None:
vc_comment = 0
if uncompress == None:
uncompress = 0
if id_visible == None:
id_visible = 0
if id_edit == None:
id_edit = 0
if index_visible == None:
index_visible = 0
if show_detail == None:
show_detail = 0
if status_bar == None:
status_bar = 0
if toolbar == None:
toolbar = 2
if hide_altnames == None:
hide_altnames = 0
if dateFormat == None:
dateFormat = 0
if dateEntry == None:
dateEntry = 0
set_format_code(dateFormat)
Date.entryCode = dateEntry
if lastnamegen == None or lastnamegen == 0:
lastnamegen = 0
if _name_format == None or _name_format == 0:
_name_format = 0
if _name_format == 0:
nameof = Utils.normal_name
else:
nameof = Utils.phonebook_name
@ -386,6 +338,33 @@ def loadConfig(call):
make_path(os.path.expanduser("~/.gramps/plugins"))
make_path(os.path.expanduser("~/.gramps/templates"))
def get_string(value,defval=""):
v = gnome.config.get_string(value)
if v == None:
return defval
else:
return v
def get_bool(key,defval=0):
v = gnome.config.get_bool(key)
if v:
return v
else:
return defval
def get_int(key,defval=0):
v = gnome.config.get_int(key)
if v:
return v
else:
return defval
def set_bool(key,value):
gnome.config.set_bool(key,value)
def set_string(key,value):
gnome.config.set_string(key,value)
#-------------------------------------------------------------------------
#
#

View File

@ -2183,7 +2183,6 @@ class GrampsDB(Persistent):
else:
source = Source()
map[idVal] = self.addSource(source)
self.sourceTable[map[idVal]] = source.getDisplayInfo()
return source
def addSourceNoMap(self,source,index):
@ -2203,7 +2202,6 @@ class GrampsDB(Persistent):
else:
source = Source()
self.addSourceNoMap(source,val)
self.sourceTable[val] = source.getDisplayInfo()
return source
def addObject(self,object):
@ -2334,7 +2332,10 @@ class GrampsDB(Persistent):
return self.sourceTable[key]
def getSource(self,key):
if self.sourceMap.has_key(key):
return self.sourceMap[key]
else:
return None
def buildSourceDisplay(self,nkey,okey=None):
if nkey != okey and okey != None:

View File

@ -32,6 +32,8 @@ import time
import shutil
import os
from gnome.ui import GnomeErrorDialog
#-------------------------------------------------------------------------
#
# load GRAMPS libraries
@ -71,7 +73,6 @@ def exportData(database, filename, callback):
g = XmlWriter(database,callback,0,compress)
g.write(filename)
except:
from gnome.ui import GnomeErrorDialog
import DisplayTrace
DisplayTrace.DisplayTrace()
@ -295,6 +296,12 @@ class XmlWriter:
self.g.write(" <sources>\n")
for key in self.db.getSourceKeys():
source = self.db.getSource(key)
if not source:
d = self.db.getSourceDisplay(key)
GnomeErrorDialog("Database inconsistency found with sources\n"
"Index found for %s (%s)\n"
"but not included in tables - attempting to fix" % (d[0],d[1]))
continue
if self.callback and count % delta == 0:
self.callback(float(count)/float(total))
count = count + 1

View File

@ -92,7 +92,7 @@ startup = 1
#
#-------------------------------------------------------------------------
progName = "GRAMPS"
version = "0.8.0-1"
version = "0.8.0-pl1"
copyright = "© 2001-2002 Donald N. Allingham"
authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
comments = _("GRAMPS (Genealogical Research and Analysis "

View File

@ -165,6 +165,14 @@ class GraphVizDialog(ReportDialog):
_("Non-birth relationships will show up "
"as dashed lines in the graph."))
self.show_families_cb = gtk.GtkCheckButton(_("Show family nodes"))
self.show_families_cb.set_active(0)
self.add_frame_option(_("GraphViz Options"),
'',
self.show_families_cb,
_("Families will show up as circles, linked"
"to parents and children."))
tb_margin_adj = gtk.GtkAdjustment(value=0.5, lower=0.25,
upper=100.0, step_incr=0.25)
lr_margin_adj = gtk.GtkAdjustment(value=0.5, lower=0.25,
@ -248,6 +256,7 @@ class GraphVizDialog(ReportDialog):
self.adoptionsdashed = self.adoptionsdashed_cb.get_active()
self.hpages = self.hpages_sb.get_value_as_int()
self.vpages = self.vpages_sb.get_value_as_int()
self.show_families = self.show_families_cb.get_active()
#------------------------------------------------------------------------
#
@ -266,7 +275,8 @@ class GraphVizDialog(ReportDialog):
write_dot(file, ind_list, self.orien, width, height,
self.tb_margin, self.lr_margin, self.hpages,
self.vpages, self.includedates, self.includeurl,
self.colorize, self.adoptionsdashed, self.arrowheadstyle, self.arrowtailstyle)
self.colorize, self.adoptionsdashed, self.arrowheadstyle,
self.arrowtailstyle, self.show_families)
#------------------------------------------------------------------------
#
@ -283,23 +293,26 @@ def report(database,person):
#------------------------------------------------------------------------
def write_dot(file, ind_list, orien, width, height, tb_margin,
lr_margin, hpages, vpages, includedates, includeurl,
colorize, adoptionsdashed, arrowheadstyle, arrowtailstyle):
colorize, adoptionsdashed, arrowheadstyle, arrowtailstyle,
show_families):
file.write("digraph g {\n")
file.write("bgcolor=white;\n")
file.write("rankdir=LR;\n")
file.write("center=1;\n")
file.write("margin=0.5;\n")
file.write("ratio=fill;\n")
file.write("size=\"%3.1fin,%3.1fin\";\n" % ((width*hpages)-(lr_margin*2)-((hpages-1)*1.0),
file.write("size=\"%3.1f,%3.1f\";\n" % ((width*hpages)-(lr_margin*2)-((hpages-1)*1.0),
(height*vpages)-(tb_margin*2)-((vpages-1)*1.0)))
file.write("page=\"%3.1fin,%3.1fin\";\n" % (width,height))
file.write("page=\"%3.1f,%3.1f\";\n" % (width,height))
if orien == PAPER_LANDSCAPE:
file.write("rotate=90;\n")
if len(ind_list) > 1:
dump_index(ind_list,file,includedates,includeurl,colorize)
dump_person(ind_list,file,adoptionsdashed,arrowheadstyle,arrowtailstyle)
dump_index(ind_list,file,includedates,includeurl,colorize,
arrowheadstyle,arrowtailstyle,show_families)
dump_person(ind_list,file,adoptionsdashed,arrowheadstyle,
arrowtailstyle,show_families)
file.write("}\n")
file.close()
@ -309,28 +322,44 @@ def write_dot(file, ind_list, orien, width, height, tb_margin,
#
#
#------------------------------------------------------------------------
def dump_person(person_list,file,adoptionsdashed,arrowheadstyle,arrowtailstyle):
def dump_person(person_list,file,adoptionsdashed,arrowheadstyle,
arrowtailstyle,show_families):
for person in person_list:
pid = string.replace(person.getId(),'-','_')
family, mrel, frel = person.getMainParentsRel()
if family == None:
continue
for family, mrel, frel in person.getParentList():
father = family.getFather()
if father and father in person_list:
fid = string.replace(father.getId(),'-','_')
file.write('p%s -> p%s [' % (pid, fid))
file.write('arrowhead=%s, arrowtail=%s, ' % (arrowheadstyle, arrowtailstyle))
if adoptionsdashed and frel != _("Birth"):
mother = family.getMother()
fadopted = frel != _("Birth")
madopted = mrel != _("Birth")
if show_families:
# Link to the family node.
famid = string.replace(family.getId(),'-','_')
file.write('p%s -> f%s [' % (pid, famid))
file.write('arrowhead=%s, arrowtail=%s, ' %
(arrowheadstyle, arrowtailstyle))
if adoptionsdashed and (fadopted or madopted):
file.write('style=dashed')
else:
file.write('style=solid')
file.write('];\n')
else:
# Link to the parents' nodes directly.
if father and father in person_list:
fid = string.replace(father.getId(),'-','_')
file.write('p%s -> p%s [' % (pid, fid))
file.write('arrowhead=%s, arrowtail=%s, ' %
(arrowheadstyle, arrowtailstyle))
if adoptionsdashed and fadopted:
file.write('style=dashed')
else:
file.write('style=solid')
file.write('];\n')
mother = family.getMother()
if mother and mother in person_list:
mid = string.replace(mother.getId(),'-','_')
file.write('p%s -> p%s [' % (pid, mid))
file.write('arrowhead=%s, arrowtail=%s, ' % (arrowheadstyle, arrowtailstyle))
if adoptionsdashed and mrel != _("Birth"):
file.write('arrowhead=%s, arrowtail=%s, ' %
(arrowheadstyle, arrowtailstyle))
if adoptionsdashed and madopted:
file.write('style=dashed')
else:
file.write('style=solid')
@ -341,8 +370,13 @@ def dump_person(person_list,file,adoptionsdashed,arrowheadstyle,arrowtailstyle):
#
#
#------------------------------------------------------------------------
def dump_index(person_list,file,includedates,includeurl,colorize):
def dump_index(person_list,file,includedates,includeurl,colorize,
arrowheadstyle,arrowtailstyle,show_families):
# The list of families for which we have output the node, so we
# don't do it twice.
families_done = []
for person in person_list:
# Output the person's node.
label = person.getPrimaryName().getName()
id = string.replace(person.getId(),'-','_')
if includedates:
@ -367,6 +401,21 @@ def dump_index(person_list,file,includedates,includeurl,colorize):
else:
file.write('color=black, ')
file.write('fontname="Arial", label="%s"];\n' % label)
# Output families's nodes.
if show_families:
family_list = person.getFamilyList()
for fam in family_list:
fid = string.replace(fam.getId(),'-','_')
if fam not in families_done:
file.write('f%s [shape=circle, label="", ' % fid)
file.write('weight=8, height=.3];\n')
# Link this person to all his/her families.
file.write('f%s -> p%s [' % (fid, id))
file.write('arrowhead=%s, arrowtail=%s, ' %
(arrowheadstyle, arrowtailstyle))
file.write('style=solid];\n')
#------------------------------------------------------------------------
#