fix typos on XML import

svn: r6405
This commit is contained in:
Don Allingham 2006-04-21 22:24:54 +00:00
parent 28a48093ee
commit 0b35225daa
5 changed files with 26 additions and 15 deletions

View File

@ -1,4 +1,7 @@
2006-04-21 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadXML.py: fix typos
* src/PluginUtils/_PluginMgr.py: handle module to description mapping
* src/Editors/_EditRepoRef.py: fix typos
* src/Editors/_EditMediaRef.py: define warnbox
* src/GrampsDb/_DbUtils.py: fix old call to get_child_handle_list
* src/Editors/_EditSource.py: remove warnbox

View File

@ -137,7 +137,7 @@ class EditRepoRef(EditReference):
self.backref_tab = self._add_tab(
notebook_src,
SourceBackRefList(self.dbstate, self.uistate, self.track,
self.db.find_backlink_handles(self.obj.handle),
self.db.find_backlink_handles(self.source.handle),
self.enable_warnbox))
def build_menu_names(self,sourceref):

View File

@ -652,7 +652,7 @@ class GrampsParser:
self.person.lds_ord_list.append(self.ord)
elif self.family:
if atype == "sealed_to_spouse":
self.ord.set_type(RelLib.LdsOrd.SEAL_TO_SPOUSES)
self.ord.set_type(RelLib.LdsOrd.SEAL_TO_SPOUSE)
self.family.lds_ord_list.append(self.ord)
def start_temple(self,attrs):
@ -704,7 +704,7 @@ class GrampsParser:
loc.postal = attrs.get('postal','')
loc.city = attrs.get('city','')
loc.parish = attrs.get('parish','')
loc.state = attrs.bet('state','')
loc.state = attrs.get('state','')
loc.county = attrs.get('county','')
loc.country = attrs.get('country','')
if self.locations > 0:
@ -919,8 +919,7 @@ class GrampsParser:
self.family = self.find_family_by_gramps_id(gramps_id)
# GRAMPS LEGACY: the type now belongs to <rel> tag
# Here we need to support old format of <family type="Married">
self.family.type = RelLib.FamilyRelType().set_from_xml_str(
attrs.get("type",'Unknown'))
self.family.type.set_from_xml_str(attrs.get("type",'Unknown'))
# Old and new markers: complete=1 and marker=word both have to work
if attrs.get('complete'): # this is only true for complete=1
@ -952,8 +951,12 @@ class GrampsParser:
# Here we are handling the old XML, in which
# frel and mrel belonged to the "childof" tag
mrel = RelLib.ChildRefType().set_from_xml_str(attrs.get('mrel'))
frel = RelLib.ChildRefType().set_from_xml_str(attrs.get('frel'))
mrel = RelLib.ChildRefType()
frel = RelLib.ChildRefType()
if attrs.get('mrel'):
mrel.set_from_xml_str(attrs['mrel'])
if attrs.get('frel'):
frel.set_from_xml_str(attrs['frel'])
childref = RelLib.ChildRef()
childref.ref = self.person.handle

View File

@ -54,7 +54,6 @@ report_list = []
tool_list = []
import_list = []
export_list = []
expect_list = []
attempt_list = []
loaddir_list = []
textdoc_list = []
@ -64,9 +63,10 @@ failmsg_list = []
bkitems_list = []
cl_list = []
cli_tool_list = []
success_list = []
mod2text = {}
#-------------------------------------------------------------------------
#
# Default relationship calculator
@ -126,12 +126,10 @@ def load_plugins(direct):
try:
a = __import__(plugin)
success_list.append((filename,a))
except Errors.PluginError, msg:
expect_list.append((filename,str(msg)))
except:
failmsg_list.append((filename,sys.exc_info()))
if len(expect_list)+len(failmsg_list):
if len(failmsg_list):
return False
else:
return True
@ -155,6 +153,7 @@ def register_export(exportData,title,description='',config=None,filename=''):
del export_list[del_index]
export_list.append((exportData,title,description,config,filename))
mod2text[exportData.__module__] = description
def register_import(task, ffilter, mime=None, native_format=0, format_name=""):
"""Register an import filter, taking the task and file filter"""
@ -167,6 +166,7 @@ def register_import(task, ffilter, mime=None, native_format=0, format_name=""):
del import_list[del_index]
import_list.append((task, ffilter, mime, native_format, format_name))
mod2text[task.__module__] = format_name
#-------------------------------------------------------------------------
#
@ -196,6 +196,7 @@ def register_tool(
"""
import _Tool
(junk,gui_task) = divmod(modes,2**_Tool.MODE_GUI)
if gui_task:
_register_gui_tool(tool_class,options_class,translated_name,
@ -221,6 +222,7 @@ def _register_gui_tool(tool_class,options_class,translated_name,
del_index = i
if del_index != -1:
del tool_list[del_index]
mod2text[tool_class.__module__] = description
tool_list.append((tool_class,options_class,translated_name,
category,name,description,status,
author_name,author_email,unsupported))
@ -305,6 +307,7 @@ def _register_standalone(report_class, options_class, translated_name,
report_list.append((report_class, options_class, translated_name,
category, name, description, status,
author_name, author_email, unsupported))
mod2text[report_class.__module__] = description
def register_book_item(translated_name, category, report_class,
option_class, name, unsupported):
@ -355,6 +358,7 @@ def register_text_doc(name,classref, table, paper, style, ext,
textdoc_list.append(
(name, classref, table, paper, style,
ext, print_report_label, clname))
mod2text[classref.__module__] = name
#-------------------------------------------------------------------------
#
@ -394,6 +398,7 @@ def register_draw_doc(name,classref,paper,style, ext,
clname = ext[1:]
drawdoc_list.append((name, classref, paper,style, ext,
print_report_label, clname))
mod2text[classref.__module__] = name
#-------------------------------------------------------------------------
#

View File

@ -97,10 +97,11 @@ class PluginStatus(ManagedWindow.ManagedWindow):
i[0], str(i[1][1]), i[1]])
for i in PluginMgr.success_list:
modname = i[1].__name__
descr = PluginMgr.mod2text.get(modname,'')
self.model.append(row=[
'<span weight="bold" color="#267726">%s</span>' % _("OK"),
i[0], '', None])
i[0], descr, None])
def button_press(self, obj, event):
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
@ -118,7 +119,6 @@ class PluginTrace(ManagedWindow.ManagedWindow):
def __init__(self, uistate, track, data):
self.title = _("Plugin Status Details")
print uistate, track, data
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
self.set_window(