Remove unnecessary line continuations and tidy up a bit
svn: r16458
This commit is contained in:
parent
c84e1286d8
commit
fe5887626c
@ -575,8 +575,7 @@ class CheckIntegrity(object):
|
||||
if cl:
|
||||
# Convert to file system encoding before prining
|
||||
fn = os.path.basename(photo_name).encode(sys.getfilesystemencoding())
|
||||
print "Warning: media file %s was not found." \
|
||||
% fn
|
||||
print "Warning: media file %s was not found." % fn
|
||||
self.bad_photo.append(ObjectId)
|
||||
else:
|
||||
if missmedia_action == 0:
|
||||
@ -585,7 +584,7 @@ class CheckIntegrity(object):
|
||||
"The file may have been deleted or moved to a different location. "
|
||||
"You may choose to either remove the reference from the database, "
|
||||
"keep the reference to the missing file, or select a new file."
|
||||
) % { 'file_name' : '<b>%s</b>' % photo_name },
|
||||
) % {'file_name' : '<b>%s</b>' % photo_name},
|
||||
remove_clicked, leave_clicked, select_clicked)
|
||||
missmedia_action = mmd.default_action
|
||||
elif missmedia_action == 1:
|
||||
@ -840,7 +839,7 @@ class CheckIntegrity(object):
|
||||
# The event referenced by the family
|
||||
# does not exist in the database
|
||||
print family.gramps_id
|
||||
nlist = [ x for x in family.get_event_ref_list() \
|
||||
nlist = [x for x in family.get_event_ref_list()
|
||||
if x.ref != event_handle]
|
||||
family.set_event_ref_list(nlist)
|
||||
self.db.commit_family(family, self.trans)
|
||||
@ -1330,8 +1329,11 @@ class CheckIntegrity(object):
|
||||
|
||||
self.text = cStringIO.StringIO()
|
||||
if blink > 0:
|
||||
self.text.write(ngettext("%(quantity)d broken child/family link was fixed\n", \
|
||||
"%(quantity)d broken child-family links were fixed\n", blink) % { 'quantity' : blink } )
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d broken child/family link was fixed\n",
|
||||
"%(quantity)d broken child-family links were fixed\n",
|
||||
blink) % {'quantity': blink}
|
||||
)
|
||||
for (person_handle, family_handle) in self.broken_links:
|
||||
person = self.db.get_person_from_handle(person_handle)
|
||||
if person:
|
||||
@ -1344,13 +1346,17 @@ class CheckIntegrity(object):
|
||||
except:
|
||||
pn = _("Unknown")
|
||||
self.text.write('\t')
|
||||
self.text.write(_("%(person)s was removed from the family of %(family)s\n") % {
|
||||
'person' : cn, 'family' : pn } )
|
||||
self.text.write(
|
||||
_("%(person)s was removed from the family of %(family)s\n")
|
||||
% {'person': cn, 'family': pn}
|
||||
)
|
||||
|
||||
if plink > 0:
|
||||
self.text.write(ngettext("%(quantity)d broken spouse/family link was fixed\n",
|
||||
"%(quantity)d broken spouse/family links were fixed\n", plink) % {
|
||||
'quantity' : plink })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d broken spouse/family link was fixed\n",
|
||||
"%(quantity)d broken spouse/family links were fixed\n",
|
||||
plink) % {'quantity' : plink}
|
||||
)
|
||||
for (person_handle, family_handle) in self.broken_parent_links:
|
||||
person = self.db.get_person_from_handle(person_handle)
|
||||
if person:
|
||||
@ -1363,12 +1369,17 @@ class CheckIntegrity(object):
|
||||
else:
|
||||
pn = family_handle
|
||||
self.text.write('\t')
|
||||
self.text.write(_("%(person)s was restored to the family of %(family)s\n") % {
|
||||
'person' : cn, 'family' : pn } )
|
||||
self.text.write(
|
||||
_("%(person)s was restored to the family of %(family)s\n")
|
||||
% {'person': cn, 'family': pn}
|
||||
)
|
||||
|
||||
if slink > 0:
|
||||
self.text.write(ngettext("%(quantity)d duplicate spouse/family link was found\n", \
|
||||
"%(quantity)d duplicate spouse/family links were found\n", slink) % { 'quantity' : slink })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d duplicate spouse/family link was found\n",
|
||||
"%(quantity)d duplicate spouse/family links were found\n",
|
||||
slink) % {'quantity': slink}
|
||||
)
|
||||
for (person_handle, family_handle) in self.broken_parent_links:
|
||||
person = self.db.get_person_from_handle(person_handle)
|
||||
if person:
|
||||
@ -1381,24 +1392,35 @@ class CheckIntegrity(object):
|
||||
else:
|
||||
pn = _("None")
|
||||
self.text.write('\t')
|
||||
self.text.write(_("%(person)s was restored to the family of %(family)s\n") % {
|
||||
'person' : cn, 'family' : pn } )
|
||||
self.text.write(
|
||||
_("%(person)s was restored to the family of %(family)s\n")
|
||||
% {'person': cn, 'family': pn}
|
||||
)
|
||||
|
||||
if efam == 1:
|
||||
self.text.write(_("%d family with no parents or children found, removed.\n"))
|
||||
self.text.write(
|
||||
_("1 family with no parents or children found, removed.\n")
|
||||
)
|
||||
self.text.write("\t%s\n" % self.empty_family[0])
|
||||
elif efam > 1:
|
||||
self.text.write(_("%(quantity)d families with no parents or children, removed.\n") % {
|
||||
'quantity' : efam })
|
||||
self.text.write(
|
||||
_("%(quantity)d families with no parents or children, "
|
||||
"removed.\n") % {'quantity': efam}
|
||||
)
|
||||
|
||||
if rel:
|
||||
self.text.write(ngettext("%d corrupted family relationship fixed\n",
|
||||
"%d corrupted family relationship fixed\n", rel) % rel )
|
||||
self.text.write(
|
||||
ngettext("%d corrupted family relationship fixed\n",
|
||||
"%d corrupted family relationship fixed\n",
|
||||
rel) % rel
|
||||
)
|
||||
|
||||
if person_references:
|
||||
self.text.write(ngettext("%d person was referenced but not found\n",
|
||||
"%d persons were referenced, but not found\n",
|
||||
person_references) % person_references)
|
||||
self.text.write(
|
||||
ngettext("%d person was referenced but not found\n",
|
||||
"%d persons were referenced, but not found\n",
|
||||
person_references) % person_references
|
||||
)
|
||||
|
||||
if invalid_dates:
|
||||
self.text.write(ngettext("%d date was corrected\n",
|
||||
@ -1406,67 +1428,93 @@ class CheckIntegrity(object):
|
||||
invalid_dates) % invalid_dates)
|
||||
|
||||
if repo_references:
|
||||
self.text.write(ngettext("%(quantity)d repository was referenced but not found\n", \
|
||||
"%(quantity)d repositories were referenced, but not found\n", repo_references) % {
|
||||
'quantity' : repo_references })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d repository was referenced but not found\n",
|
||||
"%(quantity)d repositories were referenced, but not found\n",
|
||||
repo_references) % {'quantity': repo_references})
|
||||
|
||||
if photos:
|
||||
self.text.write(ngettext("%(quantity)d media object was referenced, but not found\n", \
|
||||
"%(quantity)d media objects were referenced, but not found\n", photos) % { 'quantity' : photos })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d media object was referenced, but not found\n",
|
||||
"%(quantity)d media objects were referenced, but not found\n",
|
||||
photos) % {'quantity' :photos}
|
||||
)
|
||||
|
||||
if bad_photos:
|
||||
self.text.write(ngettext("Reference to %(quantity)d missing media object was kept\n", \
|
||||
"References to %(quantity)d media objects were kept\n", bad_photos) % {
|
||||
'quantity' : bad_photos })
|
||||
self.text.write(
|
||||
ngettext("Reference to %(quantity)d missing media object was kept\n",
|
||||
"References to %(quantity)d media objects were kept\n",
|
||||
bad_photos) % {'quantity' :bad_photos}
|
||||
)
|
||||
|
||||
if replaced_photos:
|
||||
self.text.write(ngettext("%(quantity)d missing media object was replaced\n", \
|
||||
"%(quantity)d missing media objects were replaced\n", replaced_photos) % {
|
||||
'quantity' : replaced_photos })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d missing media object was replaced\n",
|
||||
"%(quantity)d missing media objects were replaced\n",
|
||||
replaced_photos) % {'quantity': replaced_photos}
|
||||
)
|
||||
|
||||
if removed_photos:
|
||||
self.text.write(ngettext("%(quantity)d missing media object was removed\n", \
|
||||
"%(quantity)d missing media objects were removed\n", removed_photos) % {
|
||||
'quantity' : removed_photos })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d missing media object was removed\n",
|
||||
"%(quantity)d missing media objects were removed\n",
|
||||
removed_photos) % {'quantity' : removed_photos}
|
||||
)
|
||||
|
||||
if event_invalid:
|
||||
self.text.write(ngettext("%(quantity)d invalid event reference was removed\n", \
|
||||
"%(quantity)d invalid event references were removed\n", event_invalid) % {
|
||||
'quantity' : event_invalid })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d invalid event reference was removed\n",
|
||||
"%(quantity)d invalid event references were removed\n",
|
||||
event_invalid) % {'quantity': event_invalid}
|
||||
)
|
||||
|
||||
if birth_invalid:
|
||||
self.text.write(ngettext("%(quantity)d invalid birth event name was fixed\n", \
|
||||
"%(quantity)d invalid birth event names were fixed\n", birth_invalid) % {
|
||||
'quantity' : birth_invalid })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d invalid birth event name was fixed\n",
|
||||
"%(quantity)d invalid birth event names were fixed\n",
|
||||
birth_invalid) % {'quantity' : birth_invalid}
|
||||
)
|
||||
|
||||
if death_invalid:
|
||||
self.text.write(ngettext("%(quantity)d invalid death event name was fixed\n", \
|
||||
"%(quantity)d invalid death event names were fixed\n", death_invalid) % {
|
||||
'quantity' : death_invalid })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d invalid death event name was fixed\n",
|
||||
"%(quantity)d invalid death event names were fixed\n",
|
||||
death_invalid) % {'quantity': death_invalid}
|
||||
)
|
||||
|
||||
if place_references:
|
||||
self.text.write(ngettext("%(quantity)d place was referenced but not found\n", \
|
||||
"%(quantity)d places were referenced, but not found\n", place_references) % {
|
||||
'quantity' : place_references })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d place was referenced but not found\n",
|
||||
"%(quantity)d places were referenced, but not found\n",
|
||||
place_references) % {'quantity': place_references}
|
||||
)
|
||||
|
||||
if source_references:
|
||||
self.text.write(ngettext("%(quantity)d source was referenced but not found\n", \
|
||||
"%(quantity)d sources were referenced, but not found\n", source_references) % {
|
||||
'quantity' : source_references })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d source was referenced but not found\n",
|
||||
"%(quantity)d sources were referenced, but not found\n",
|
||||
source_references) % {'quantity': source_references}
|
||||
)
|
||||
|
||||
if media_references:
|
||||
self.text.write(ngettext("%d media object was referenced but not found\n", \
|
||||
"%d media objects were referenced but not found\n", media_references) % media_references)
|
||||
self.text.write(
|
||||
ngettext("%(quantity)media object was referenced but not found\n",
|
||||
"%(quantity)media objects were referenced but not found\n",
|
||||
media_references) % {'quantity': media_references}
|
||||
)
|
||||
|
||||
if note_references:
|
||||
self.text.write(ngettext("%(quantity)d note object was referenced but not found\n", \
|
||||
"%(quantity)d note objects were referenced but not found\n", note_references) % {
|
||||
'quantity' : note_references })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d note object was referenced but not found\n",
|
||||
"%(quantity)d note objects were referenced but not found\n",
|
||||
note_references) % {'quantity': note_references})
|
||||
|
||||
if name_format:
|
||||
self.text.write(ngettext("%(quantity)d invalid name format reference was removed\n", \
|
||||
"%(quantity)d invalid name format references were removed\n", name_format) % {
|
||||
'quantity' : name_format })
|
||||
self.text.write(
|
||||
ngettext("%(quantity)d invalid name format reference was removed\n",
|
||||
"%(quantity)d invalid name format references were removed\n",
|
||||
name_format) % {'quantity' : name_format}
|
||||
)
|
||||
|
||||
if empty_objs > 0 :
|
||||
self.text.write(_("%(empty_obj)d empty objects removed:\n"
|
||||
@ -1477,7 +1525,7 @@ class CheckIntegrity(object):
|
||||
" %(media)d media objects\n"
|
||||
" %(place)d place objects\n"
|
||||
" %(repo)d repository objects\n"
|
||||
" %(note)d note objects\n" ) % {
|
||||
" %(note)d note objects\n") % {
|
||||
'empty_obj' : empty_objs,
|
||||
'person' : len(self.empty_objects['persons']),
|
||||
'family' : len(self.empty_objects['families']),
|
||||
@ -1486,7 +1534,9 @@ class CheckIntegrity(object):
|
||||
'media' : len(self.empty_objects['media']),
|
||||
'place' : len(self.empty_objects['places']),
|
||||
'repo' : len(self.empty_objects['repos']),
|
||||
'note' : len(self.empty_objects['notes']) } )
|
||||
'note' : len(self.empty_objects['notes'])
|
||||
}
|
||||
)
|
||||
|
||||
return errors
|
||||
|
||||
|
@ -66,8 +66,9 @@ class DesBrowse(tool.ActivePersonTool, ManagedWindow.ManagedWindow):
|
||||
active_handle = uistate.get_active('Person')
|
||||
self.active = dbstate.db.get_person_from_handle(active_handle)
|
||||
self.callback = callback
|
||||
self.active_name = _("Descendant Browser: %s") \
|
||||
% name_displayer.display(self.active)
|
||||
self.active_name = _("Descendant Browser: %s") % (
|
||||
name_displayer.display(self.active)
|
||||
)
|
||||
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self)
|
||||
|
||||
|
@ -250,10 +250,12 @@ class DisplayChart(ManagedWindow.ManagedWindow):
|
||||
self.table_titles = [_("Person"),_("ID")]
|
||||
for event_name in self.event_titles:
|
||||
self.table_titles.append(_("%(event_name)s Date") %
|
||||
{'event_name' :event_name })
|
||||
{'event_name' :event_name}
|
||||
)
|
||||
self.table_titles.append('sort') # This won't be shown in a tree
|
||||
self.table_titles.append(_("%(event_name)s Place") %
|
||||
{'event_name' :event_name })
|
||||
{'event_name' :event_name}
|
||||
)
|
||||
|
||||
self.build_row_data()
|
||||
self.draw_display()
|
||||
|
@ -300,10 +300,12 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
||||
def findRelatedPeople(self) :
|
||||
|
||||
#TRANS: No singular form is needed.
|
||||
self.progress.set_pass(ngettext("Finding relationships between %d person", "Finding relationships between %d people",\
|
||||
self.numberOfPeopleInDatabase) \
|
||||
% self.numberOfPeopleInDatabase, \
|
||||
self.numberOfPeopleInDatabase)
|
||||
self.progress.set_pass(
|
||||
ngettext("Finding relationships between %d person",
|
||||
"Finding relationships between %d people",
|
||||
self.numberOfPeopleInDatabase) %
|
||||
self.numberOfPeopleInDatabase,
|
||||
self.numberOfPeopleInDatabase)
|
||||
|
||||
# as long as we have people we haven't processed yet, keep looping
|
||||
while len(self.handlesOfPeopleToBeProcessed) > 0:
|
||||
@ -368,9 +370,10 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
||||
if self.numberOfUnrelatedPeople > 0:
|
||||
# we have at least 1 "unrelated" person to find
|
||||
|
||||
self.progress.set_pass( \
|
||||
ngettext("Looking for %d person", "Looking for %d people",\
|
||||
self.numberOfUnrelatedPeople) % self.numberOfUnrelatedPeople,\
|
||||
self.progress.set_pass(
|
||||
ngettext("Looking for %d person", "Looking for %d people",
|
||||
self.numberOfUnrelatedPeople) %
|
||||
self.numberOfUnrelatedPeople,
|
||||
self.numberOfPeopleInDatabase)
|
||||
|
||||
# loop through everyone in the database
|
||||
@ -393,9 +396,11 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
||||
|
||||
def populateModel(self) :
|
||||
|
||||
self.progress.set_pass( \
|
||||
ngettext("Looking up the name of %d person", "Looking up the names of %d people", \
|
||||
self.numberOfUnrelatedPeople) % self.numberOfUnrelatedPeople,\
|
||||
self.progress.set_pass(
|
||||
ngettext("Looking up the name of %d person",
|
||||
"Looking up the names of %d people",
|
||||
self.numberOfUnrelatedPeople) %
|
||||
self.numberOfUnrelatedPeople,
|
||||
self.numberOfUnrelatedPeople)
|
||||
|
||||
# loop through the entire list of unrelated people
|
||||
|
@ -316,8 +316,8 @@ class PatchNames(tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
cont = False
|
||||
# if previous is non-splitting connector, then add new val to
|
||||
# current surname
|
||||
if cont and (new_surname_list[-1].split()[-1].lower() \
|
||||
in self.connector_list_nonsplit):
|
||||
if cont and (new_surname_list[-1].split()[-1].lower()
|
||||
in self.connector_list_nonsplit):
|
||||
new_surname_list[-1] += ' ' + val
|
||||
try:
|
||||
val = surnval.pop(0)
|
||||
|
@ -108,7 +108,7 @@ class RelCalc(tool.Tool, ManagedWindow.ManagedWindow):
|
||||
self.titlelabel = self.glade.get_object('title')
|
||||
self.set_window(window, self.titlelabel,
|
||||
_('Relationship to %(person_name)s'
|
||||
) % {'person_name' : name },
|
||||
) % {'person_name' : name},
|
||||
self.title)
|
||||
|
||||
self.tree = self.glade.get_object("peopleList")
|
||||
@ -187,17 +187,23 @@ class RelCalc(tool.Tool, ManagedWindow.ManagedWindow):
|
||||
pass
|
||||
elif self.person.handle == other_person.handle:
|
||||
rstr = _("%(person)s and %(active_person)s are the same person.") % {
|
||||
'person' : p1, 'active_person' : p2 }
|
||||
'person': p1,
|
||||
'active_person': p2
|
||||
}
|
||||
text.append((rstr, ""))
|
||||
elif len(rel_strings) == 0:
|
||||
rstr = _("%(person)s and %(active_person)s are not related.") % {
|
||||
'person' : p2, 'active_person' : p1 }
|
||||
'person': p2,
|
||||
'active_person': p1
|
||||
}
|
||||
text.append((rstr, ""))
|
||||
|
||||
for rel_string, common in zip(rel_strings, common_an):
|
||||
rstr = _("%(person)s is the %(relationship)s of %(active_person)s."
|
||||
) % {'person' : p2, 'relationship' : rel_string,
|
||||
'active_person' : p1 }
|
||||
) % {'person': p2,
|
||||
'relationship': rel_string,
|
||||
'active_person': p1
|
||||
}
|
||||
length = len(common)
|
||||
if length == 1:
|
||||
person = self.db.get_person_from_handle(common[0])
|
||||
@ -212,7 +218,9 @@ class RelCalc(tool.Tool, ManagedWindow.ManagedWindow):
|
||||
p1str = name_displayer.display(p1c)
|
||||
p2str = name_displayer.display(p2c)
|
||||
commontext = " " + _("Their common ancestors are %(ancestor1)s and %(ancestor2)s.") % {
|
||||
'ancestor1' : p1str, 'ancestor2' : p2str }
|
||||
'ancestor1': p1str,
|
||||
'ancestor2': p2str
|
||||
}
|
||||
elif length > 2:
|
||||
index = 0
|
||||
commontext = " " + _("Their common ancestors are: ")
|
||||
|
@ -223,18 +223,14 @@ class RemoveUnused(tool.Tool, ManagedWindow.ManagedWindow, UpdateCallback):
|
||||
return (self.title, None)
|
||||
|
||||
def find(self, obj):
|
||||
self.options.handler.options_dict['events'] = \
|
||||
int(self.events_box.get_active())
|
||||
self.options.handler.options_dict['sources'] = \
|
||||
int(self.sources_box.get_active())
|
||||
self.options.handler.options_dict['places'] = \
|
||||
int(self.places_box.get_active())
|
||||
self.options.handler.options_dict['media'] = \
|
||||
int(self.media_box.get_active())
|
||||
self.options.handler.options_dict['repos'] = \
|
||||
int(self.repos_box.get_active())
|
||||
self.options.handler.options_dict['notes'] = \
|
||||
int(self.notes_box.get_active())
|
||||
self.options.handler.options_dict.update(
|
||||
events = self.events_box.get_active(),
|
||||
sources = self.sources_box.get_active(),
|
||||
places = self.places_box.get_active(),
|
||||
media = self.media_box.get_active(),
|
||||
repos = self.repos_box.get_active(),
|
||||
notes = self.notes_box.get_active(),
|
||||
)
|
||||
|
||||
for item in self.sensitive_list:
|
||||
item.set_sensitive(True)
|
||||
@ -349,8 +345,9 @@ class RemoveUnused(tool.Tool, ManagedWindow.ManagedWindow, UpdateCallback):
|
||||
def call_editor(self, the_type, handle):
|
||||
try:
|
||||
obj = self.tables[the_type]['get_func'](handle)
|
||||
editor_str = 'from gui.editors import %s as editor' \
|
||||
% self.tables[the_type]['editor']
|
||||
editor_str = 'from gui.editors import %s as editor' % (
|
||||
self.tables[the_type]['editor']
|
||||
)
|
||||
exec(editor_str)
|
||||
editor(self.dbstate, self.uistate, [], obj)
|
||||
except Errors.WindowActiveError:
|
||||
|
Loading…
Reference in New Issue
Block a user