* src/docgen/HtmlDoc.py: fix typo

* src/docgen/OpenOfficeDoc.py: don't use temporary files
* src/plugins/PatchNames.py: pychecker fixes
* src/plugins/RelCalc.py: pychecker fixes
* src/plugins/ReorderIds.py: pychecker fixes
* src/plugins/Verify.py: pychecker fixes
* src/plugins/WebPage.py: pychecker fixes
* src/plugins/WriteFtree.py: pychecker fixes
* src/plugins/WriteGeneWeb.py: pychecker fixes


svn: r3674
This commit is contained in:
Don Allingham 2004-10-26 03:20:38 +00:00
parent e185199d6a
commit 91dcd9d52a
11 changed files with 599 additions and 613 deletions

View File

@ -1,3 +1,15 @@
2004-10-25 Don Allingham <dallingham@users.sourceforge.net>
* src/StartupDialog.py: handle delete event
* src/docgen/HtmlDoc.py: fix typo
* src/docgen/OpenOfficeDoc.py: don't use temporary files
* src/plugins/PatchNames.py: pychecker fixes
* src/plugins/RelCalc.py: pychecker fixes
* src/plugins/ReorderIds.py: pychecker fixes
* src/plugins/Verify.py: pychecker fixes
* src/plugins/WebPage.py: pychecker fixes
* src/plugins/WriteFtree.py: pychecker fixes
* src/plugins/WriteGeneWeb.py: pychecker fixes
2004-10-24 Don Allingham <dallingham@users.sourceforge.net> 2004-10-24 Don Allingham <dallingham@users.sourceforge.net>
* src/gramps.glade: change "Edit..." buttons to an image * src/gramps.glade: change "Edit..." buttons to an image
* src/plugins/CountAncestors.py: handle duplicates across * src/plugins/CountAncestors.py: handle duplicates across

View File

@ -21,6 +21,7 @@
# $Id$ # $Id$
import const import const
import gtk
import gtk.glade import gtk.glade
import gnome import gnome
import gnome.ui import gnome.ui
@ -56,8 +57,7 @@ class StartupDialog:
d.add(self.build_page_last()) d.add(self.build_page_last())
d.connect('cancel',self.close) d.connect('cancel',self.close)
self.w.connect("destroy_event", self.close) self.w.connect("delete_event", gtk.quit)
self.w.show_all() self.w.show_all()
def close(self,obj): def close(self,obj):

View File

@ -181,7 +181,7 @@ class HtmlDoc(BaseDoc.BaseDoc):
if top_add == 1: if top_add == 1:
mymsg = _("The marker '<!-- START -->' was not in the template") mymsg = _("The marker '<!-- START -->' was not in the template")
QuestionDilaog.ErrorDialog(_("Template Error"),mymsg) QuestionDialog.ErrorDialog(_("Template Error"),mymsg)
def load_template(self): def load_template(self):
if self.template: if self.template:

File diff suppressed because it is too large Load Diff

View File

@ -100,8 +100,6 @@ class PatchNames:
groups = match.groups() groups = match.groups()
self.nick_list.append((key,groups[0],groups[1])) self.nick_list.append((key,groups[0],groups[1]))
msg = ""
if self.nick_list or self.title_list: if self.nick_list or self.title_list:
self.display() self.display()
else: else:
@ -158,23 +156,23 @@ class PatchNames:
for (id,name,nick) in self.nick_list: for (id,name,nick) in self.nick_list:
p = self.db.get_person_from_handle(id) p = self.db.get_person_from_handle(id)
iter = self.model.append() handle = self.model.append()
self.model.set_value(iter,0,1) self.model.set_value(handle,0,1)
self.model.set_value(iter,1,id) self.model.set_value(handle,1,id)
self.model.set_value(iter,2,_('Nickname')) self.model.set_value(handle,2,_('Nickname'))
self.model.set_value(iter,3,nick) self.model.set_value(handle,3,nick)
self.model.set_value(iter,4,p.get_primary_name().get_name()) self.model.set_value(handle,4,p.get_primary_name().get_name())
self.nick_hash[id] = iter self.nick_hash[id] = handle
for (id,title,nick) in self.title_list: for (id,title,nick) in self.title_list:
p = self.db.get_person_from_handle(id) p = self.db.get_person_from_handle(id)
iter = self.model.append() handle = self.model.append()
self.model.set_value(iter,0,1) self.model.set_value(handle,0,1)
self.model.set_value(iter,1,id) self.model.set_value(handle,1,id)
self.model.set_value(iter,2,_('Title')) self.model.set_value(handle,2,_('Title'))
self.model.set_value(iter,3,nick) self.model.set_value(handle,3,nick)
self.model.set_value(iter,4,p.get_primary_name().get_name()) self.model.set_value(handle,4,p.get_primary_name().get_name())
self.title_hash[id] = iter self.title_hash[id] = handle
self.add_itself_to_menu() self.add_itself_to_menu()
self.window.show() self.window.show()
@ -202,8 +200,8 @@ class PatchNames:
def on_ok_clicked(self,obj): def on_ok_clicked(self,obj):
for grp in self.nick_list: for grp in self.nick_list:
iter = self.nick_hash[grp[0]] handle = self.nick_hash[grp[0]]
val = self.model.get_value(iter,0) val = self.model.get_value(handle,0)
if val: if val:
p = self.db.get_person_from_handle(grp[0]) p = self.db.get_person_from_handle(grp[0])
name = p.get_primary_name() name = p.get_primary_name()
@ -212,8 +210,8 @@ class PatchNames:
self.db.commit_person(p,self.trans) self.db.commit_person(p,self.trans)
for grp in self.title_list: for grp in self.title_list:
iter = self.title_hash[grp[0]] handle = self.title_hash[grp[0]]
val = self.model.get_value(iter,0) val = self.model.get_value(handle,0)
if val: if val:
p = self.db.get_person_from_handle(grp[0]) p = self.db.get_person_from_handle(grp[0])
name = p.get_primary_name() name = p.get_primary_name()

View File

@ -137,12 +137,12 @@ class RelCalc:
self.window.present() self.window.present()
def on_apply_clicked(self,obj): def on_apply_clicked(self,obj):
model,iter = self.clist.get_selected() model,node = self.clist.get_selected()
if not iter: if not node:
return return
id = self.clist.get_object(iter) handle = self.clist.get_object(node)
other_person = self.db.get_person_from_handle(id) other_person = self.db.get_person_from_handle(handle)
(rel_string,common) = self.relationship.get_relationship(self.person,other_person) (rel_string,common) = self.relationship.get_relationship(self.person,other_person)
length = len(common) length = len(common)

View File

@ -73,55 +73,55 @@ class ReorderIds:
for x in data_map.keys(): for x in data_map.keys():
key_list.append(x) key_list.append(x)
for id in key_list: for handle in key_list:
# attempt to extract integer, if we can't, treat it as a # attempt to extract integer, if we can't, treat it as a
# duplicate # duplicate
match = _findint.match(id) match = _findint.match(handle)
if match: if match:
# get the integer, build the new id. Make sure it # get the integer, build the new handle. Make sure it
# hasn't already been chosen. If it has, put this # hasn't already been chosen. If it has, put this
# in the duplicate id list # in the duplicate handle list
try: try:
index = match.groups()[0] index = match.groups()[0]
newid = prefix % int(index) newhandle = prefix % int(index)
if newid == id: if newhandle == handle:
newids[newid] = id newids[newhandle] = handle
continue continue
elif data_map.has_key(newid): elif data_map.has_key(newhandle):
dups.append(id) dups.append(handle)
else: else:
data = data_map[id] data = data_map[handle]
data_map[newid] = data data_map[newhandle] = data
newids[newid] = id newids[newhandle] = handle
data.set_handle(newid) data.set_handle(newhandle)
del data_map[id] del data_map[handle]
if update: if update:
update(newid,id) update(newhandle,handle)
except: except:
dups.append(id) dups.append(handle)
else: else:
dups.append(id) dups.append(handle)
# go through the duplicates, looking for the first availble # go through the duplicates, looking for the first availble
# id that matches the new scheme. # handle that matches the new scheme.
index = 0 index = 0
for id in dups: for handle in dups:
while 1: while 1:
newid = prefix % index newhandle = prefix % index
if not newids.has_key(newid): if not newids.has_key(newhandle):
break break
index = index + 1 index = index + 1
newids[newid] = newid newids[newhandle] = newhandle
data = data_map[id] data = data_map[handle]
data.set_handle(newid) data.set_handle(newhandle)
data_map[newid] = data data_map[newhandle] = data
if update: if update:
update(newid,id) update(newhandle,handle)
del data_map[id] del data_map[handle]
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -50,6 +50,7 @@ import gtk.glade
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import RelLib import RelLib
import Utils import Utils
import Date
from gettext import gettext as _ from gettext import gettext as _

View File

@ -56,6 +56,7 @@ import DateHandler
import Sort import Sort
import Report import Report
import Errors import Errors
import Utils
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
from gettext import gettext as _ from gettext import gettext as _

View File

@ -165,7 +165,6 @@ class FtreeWriter:
id_name = {} id_name = {}
for key in self.plist: for key in self.plist:
pn = self.db.get_person_from_handle(key).get_primary_name() pn = self.db.get_person_from_handle(key).get_primary_name()
fn = ""
sn = pn.get_surname() sn = pn.get_surname()
items = pn.get_first_name().split() items = pn.get_first_name().split()
if len(items) > 0: if len(items) > 0:

View File

@ -400,9 +400,8 @@ class GeneWebWriter:
retval = self.get_full_person_info(person) retval = self.get_full_person_info(person)
return retval return retval
def rem_spaces(self,string): def rem_spaces(self,str):
string = string.replace(' ','_') return str.replace(' ','_')
return string
def get_ref_name(self,person): def get_ref_name(self,person):
surname = self.rem_spaces( person.get_primary_name().get_surname()) surname = self.rem_spaces( person.get_primary_name().get_surname())
@ -514,11 +513,11 @@ class GeneWebWriter:
cal_type = "" cal_type = ""
if cal == Date.CAL_HEBREW: if cal == Date.CAL_HEBREW:
type = "H" cal_type = "H"
elif cal == Date.CAL_FRENCH: elif cal == Date.CAL_FRENCH:
type = "F" cal_type = "F"
elif cal == Date.CAL_JULIAN: elif cal == Date.CAL_JULIAN:
type = "J" cal_type = "J"
mode_prefix = "" mode_prefix = ""
if mode == Date.MOD_ABOUT: if mode == Date.MOD_ABOUT: