* 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:
parent
e185199d6a
commit
91dcd9d52a
12
ChangeLog
12
ChangeLog
@ -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>
|
||||
* src/gramps.glade: change "Edit..." buttons to an image
|
||||
* src/plugins/CountAncestors.py: handle duplicates across
|
||||
|
@ -21,6 +21,7 @@
|
||||
# $Id$
|
||||
|
||||
import const
|
||||
import gtk
|
||||
import gtk.glade
|
||||
import gnome
|
||||
import gnome.ui
|
||||
@ -56,8 +57,7 @@ class StartupDialog:
|
||||
d.add(self.build_page_last())
|
||||
|
||||
d.connect('cancel',self.close)
|
||||
self.w.connect("destroy_event", self.close)
|
||||
|
||||
self.w.connect("delete_event", gtk.quit)
|
||||
self.w.show_all()
|
||||
|
||||
def close(self,obj):
|
||||
|
@ -181,7 +181,7 @@ class HtmlDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if top_add == 1:
|
||||
mymsg = _("The marker '<!-- START -->' was not in the template")
|
||||
QuestionDilaog.ErrorDialog(_("Template Error"),mymsg)
|
||||
QuestionDialog.ErrorDialog(_("Template Error"),mymsg)
|
||||
|
||||
def load_template(self):
|
||||
if self.template:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -100,8 +100,6 @@ class PatchNames:
|
||||
groups = match.groups()
|
||||
self.nick_list.append((key,groups[0],groups[1]))
|
||||
|
||||
msg = ""
|
||||
|
||||
if self.nick_list or self.title_list:
|
||||
self.display()
|
||||
else:
|
||||
@ -158,23 +156,23 @@ class PatchNames:
|
||||
|
||||
for (id,name,nick) in self.nick_list:
|
||||
p = self.db.get_person_from_handle(id)
|
||||
iter = self.model.append()
|
||||
self.model.set_value(iter,0,1)
|
||||
self.model.set_value(iter,1,id)
|
||||
self.model.set_value(iter,2,_('Nickname'))
|
||||
self.model.set_value(iter,3,nick)
|
||||
self.model.set_value(iter,4,p.get_primary_name().get_name())
|
||||
self.nick_hash[id] = iter
|
||||
handle = self.model.append()
|
||||
self.model.set_value(handle,0,1)
|
||||
self.model.set_value(handle,1,id)
|
||||
self.model.set_value(handle,2,_('Nickname'))
|
||||
self.model.set_value(handle,3,nick)
|
||||
self.model.set_value(handle,4,p.get_primary_name().get_name())
|
||||
self.nick_hash[id] = handle
|
||||
|
||||
for (id,title,nick) in self.title_list:
|
||||
p = self.db.get_person_from_handle(id)
|
||||
iter = self.model.append()
|
||||
self.model.set_value(iter,0,1)
|
||||
self.model.set_value(iter,1,id)
|
||||
self.model.set_value(iter,2,_('Title'))
|
||||
self.model.set_value(iter,3,nick)
|
||||
self.model.set_value(iter,4,p.get_primary_name().get_name())
|
||||
self.title_hash[id] = iter
|
||||
handle = self.model.append()
|
||||
self.model.set_value(handle,0,1)
|
||||
self.model.set_value(handle,1,id)
|
||||
self.model.set_value(handle,2,_('Title'))
|
||||
self.model.set_value(handle,3,nick)
|
||||
self.model.set_value(handle,4,p.get_primary_name().get_name())
|
||||
self.title_hash[id] = handle
|
||||
|
||||
self.add_itself_to_menu()
|
||||
self.window.show()
|
||||
@ -202,8 +200,8 @@ class PatchNames:
|
||||
|
||||
def on_ok_clicked(self,obj):
|
||||
for grp in self.nick_list:
|
||||
iter = self.nick_hash[grp[0]]
|
||||
val = self.model.get_value(iter,0)
|
||||
handle = self.nick_hash[grp[0]]
|
||||
val = self.model.get_value(handle,0)
|
||||
if val:
|
||||
p = self.db.get_person_from_handle(grp[0])
|
||||
name = p.get_primary_name()
|
||||
@ -212,8 +210,8 @@ class PatchNames:
|
||||
self.db.commit_person(p,self.trans)
|
||||
|
||||
for grp in self.title_list:
|
||||
iter = self.title_hash[grp[0]]
|
||||
val = self.model.get_value(iter,0)
|
||||
handle = self.title_hash[grp[0]]
|
||||
val = self.model.get_value(handle,0)
|
||||
if val:
|
||||
p = self.db.get_person_from_handle(grp[0])
|
||||
name = p.get_primary_name()
|
||||
|
@ -137,12 +137,12 @@ class RelCalc:
|
||||
self.window.present()
|
||||
|
||||
def on_apply_clicked(self,obj):
|
||||
model,iter = self.clist.get_selected()
|
||||
if not iter:
|
||||
model,node = self.clist.get_selected()
|
||||
if not node:
|
||||
return
|
||||
|
||||
id = self.clist.get_object(iter)
|
||||
other_person = self.db.get_person_from_handle(id)
|
||||
handle = self.clist.get_object(node)
|
||||
other_person = self.db.get_person_from_handle(handle)
|
||||
|
||||
(rel_string,common) = self.relationship.get_relationship(self.person,other_person)
|
||||
length = len(common)
|
||||
|
@ -73,55 +73,55 @@ class ReorderIds:
|
||||
for x in data_map.keys():
|
||||
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
|
||||
# duplicate
|
||||
|
||||
match = _findint.match(id)
|
||||
match = _findint.match(handle)
|
||||
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
|
||||
# in the duplicate id list
|
||||
# in the duplicate handle list
|
||||
|
||||
try:
|
||||
index = match.groups()[0]
|
||||
newid = prefix % int(index)
|
||||
if newid == id:
|
||||
newids[newid] = id
|
||||
newhandle = prefix % int(index)
|
||||
if newhandle == handle:
|
||||
newids[newhandle] = handle
|
||||
continue
|
||||
elif data_map.has_key(newid):
|
||||
dups.append(id)
|
||||
elif data_map.has_key(newhandle):
|
||||
dups.append(handle)
|
||||
else:
|
||||
data = data_map[id]
|
||||
data_map[newid] = data
|
||||
newids[newid] = id
|
||||
data.set_handle(newid)
|
||||
del data_map[id]
|
||||
data = data_map[handle]
|
||||
data_map[newhandle] = data
|
||||
newids[newhandle] = handle
|
||||
data.set_handle(newhandle)
|
||||
del data_map[handle]
|
||||
if update:
|
||||
update(newid,id)
|
||||
update(newhandle,handle)
|
||||
except:
|
||||
dups.append(id)
|
||||
dups.append(handle)
|
||||
else:
|
||||
dups.append(id)
|
||||
dups.append(handle)
|
||||
|
||||
# go through the duplicates, looking for the first availble
|
||||
# id that matches the new scheme.
|
||||
# handle that matches the new scheme.
|
||||
|
||||
index = 0
|
||||
for id in dups:
|
||||
for handle in dups:
|
||||
while 1:
|
||||
newid = prefix % index
|
||||
if not newids.has_key(newid):
|
||||
newhandle = prefix % index
|
||||
if not newids.has_key(newhandle):
|
||||
break
|
||||
index = index + 1
|
||||
newids[newid] = newid
|
||||
data = data_map[id]
|
||||
data.set_handle(newid)
|
||||
data_map[newid] = data
|
||||
newids[newhandle] = newhandle
|
||||
data = data_map[handle]
|
||||
data.set_handle(newhandle)
|
||||
data_map[newhandle] = data
|
||||
if update:
|
||||
update(newid,id)
|
||||
del data_map[id]
|
||||
update(newhandle,handle)
|
||||
del data_map[handle]
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -50,6 +50,7 @@ import gtk.glade
|
||||
#------------------------------------------------------------------------
|
||||
import RelLib
|
||||
import Utils
|
||||
import Date
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
|
@ -56,6 +56,7 @@ import DateHandler
|
||||
import Sort
|
||||
import Report
|
||||
import Errors
|
||||
import Utils
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gettext import gettext as _
|
||||
|
||||
|
@ -165,7 +165,6 @@ class FtreeWriter:
|
||||
id_name = {}
|
||||
for key in self.plist:
|
||||
pn = self.db.get_person_from_handle(key).get_primary_name()
|
||||
fn = ""
|
||||
sn = pn.get_surname()
|
||||
items = pn.get_first_name().split()
|
||||
if len(items) > 0:
|
||||
|
@ -400,9 +400,8 @@ class GeneWebWriter:
|
||||
retval = self.get_full_person_info(person)
|
||||
return retval
|
||||
|
||||
def rem_spaces(self,string):
|
||||
string = string.replace(' ','_')
|
||||
return string
|
||||
def rem_spaces(self,str):
|
||||
return str.replace(' ','_')
|
||||
|
||||
def get_ref_name(self,person):
|
||||
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
||||
@ -514,11 +513,11 @@ class GeneWebWriter:
|
||||
|
||||
cal_type = ""
|
||||
if cal == Date.CAL_HEBREW:
|
||||
type = "H"
|
||||
cal_type = "H"
|
||||
elif cal == Date.CAL_FRENCH:
|
||||
type = "F"
|
||||
cal_type = "F"
|
||||
elif cal == Date.CAL_JULIAN:
|
||||
type = "J"
|
||||
cal_type = "J"
|
||||
|
||||
mode_prefix = ""
|
||||
if mode == Date.MOD_ABOUT:
|
||||
|
Loading…
Reference in New Issue
Block a user