7167: support python2.6 where str.format() is used

svn: r23442
This commit is contained in:
Vassilii Khachaturov 2013-10-30 07:39:25 +00:00
parent 227a1e6378
commit 59470368d3
3 changed files with 5 additions and 5 deletions

View File

@ -837,7 +837,7 @@ class ProbablyAlive(object):
return (date1, date2, explain, other) return (date1, date2, explain, other)
def ancestors_too_old(person, year): def ancestors_too_old(person, year):
LOG.debug("ancestors_too_old('{}', {})".format( LOG.debug("ancestors_too_old('{0}', {1})".format(
name_displayer.display(person), year) ) name_displayer.display(person), year) )
family_handle = person.get_main_parents_family_handle() family_handle = person.get_main_parents_family_handle()
if family_handle: if family_handle:
@ -986,7 +986,7 @@ def probably_alive(person, db,
max_sib_age_diff, max_age_prob_alive, avg_generation_gap) max_sib_age_diff, max_age_prob_alive, avg_generation_gap)
if current_date is None: if current_date is None:
current_date = gen.lib.date.Today() current_date = gen.lib.date.Today()
LOG.debug("{}: b.{}, d.{} - {}".format( LOG.debug("{0}: b.{1}, d.{2} - {3}".format(
" ".join(person.get_primary_name().get_text_data_list()), " ".join(person.get_primary_name().get_text_data_list()),
birth, death, explain)) birth, death, explain))
if not birth or not death: if not birth or not death:

View File

@ -1616,7 +1616,7 @@ class Date(object):
for adjusted,original in d,m: for adjusted,original in d,m:
if adjusted != original and not(original == 0 and adjusted == 1): if adjusted != original and not(original == 0 and adjusted == 1):
log.debug("Sanity check failed - self: {}, sanity: {}".format( log.debug("Sanity check failed - self: {0}, sanity: {1}".format(
self.dateval, sanity.dateval)) self.dateval, sanity.dateval))
raise DateError("Invalid day/month {} passed in value {}". raise DateError("Invalid day/month {} passed in value {}".
format(original, value)) format(original, value))
@ -1624,7 +1624,7 @@ class Date(object):
adjusted,original = y adjusted,original = y
adjusted -= year_delta adjusted -= year_delta
if adjusted != original and not(original == 0 and adjusted == 1): if adjusted != original and not(original == 0 and adjusted == 1):
log.debug("Sanity check failed - self: {}, sanity: {}".format( log.debug("Sanity check failed - self: {0}, sanity: {1}".format(
self.dateval, sanity.dateval)) self.dateval, sanity.dateval))
raise DateError("Invalid year {} passed in value {}". raise DateError("Invalid year {} passed in value {}".
format(original, value)) format(original, value))

View File

@ -510,7 +510,7 @@ class Test_set2(unittest.TestCase):
try: try:
function(self.date) function(self.date)
self.assertTrue(False, self.assertTrue(False,
"Modifier: {}, dateval: {} - exception expected!".format( "Modifier: {0}, dateval: {1} - exception expected!".format(
mod, self.date.dateval)) mod, self.date.dateval))
except DateError: except DateError:
pass pass