mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Remove all uses of str.format().
For Python 2.5 compatibility.
This commit is contained in:
parent
e7c40a08af
commit
b924a82236
2 changed files with 10 additions and 10 deletions
|
@ -185,9 +185,9 @@ def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s
|
||||||
force_not_null = 'FORCE NOT NULL ' + ','.join('"%s"' % c for c in not_null_cols)
|
force_not_null = 'FORCE NOT NULL ' + ','.join('"%s"' % c for c in not_null_cols)
|
||||||
else:
|
else:
|
||||||
force_not_null = ''
|
force_not_null = ''
|
||||||
command = "COPY {table_name} ({columns}) FROM '{csvpath}' CSV HEADER {force_not_null}"
|
command = "COPY %(table_name)s (%(columns)s) FROM '%(csvpath)s' CSV HEADER %(force_not_null)s"
|
||||||
session.connection().execute(
|
session.connection().execute(
|
||||||
command.format(
|
command % dict(
|
||||||
table_name=table_name,
|
table_name=table_name,
|
||||||
csvpath=csvpath,
|
csvpath=csvpath,
|
||||||
columns=','.join('"%s"' % c for c in column_names),
|
columns=','.join('"%s"' % c for c in column_names),
|
||||||
|
|
|
@ -1150,7 +1150,7 @@ class Pokemon(TableBase):
|
||||||
u"""Returns the Pokémon's name, including its form if applicable."""
|
u"""Returns the Pokémon's name, including its form if applicable."""
|
||||||
|
|
||||||
if self.form_name:
|
if self.form_name:
|
||||||
return u'{0} {1}'.format(self.form_name, self.name)
|
return u'%s %s' % (self.form_name, self.name)
|
||||||
else:
|
else:
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@ -1354,7 +1354,7 @@ class PokemonForm(TableBase):
|
||||||
if not self.name:
|
if not self.name:
|
||||||
return None
|
return None
|
||||||
elif self.form_group and self.form_group.term:
|
elif self.form_group and self.form_group.term:
|
||||||
return u'{0} {1}'.format(self.name, self.form_group.term)
|
return u'%s %s' % (self.name, self.form_group.term)
|
||||||
else:
|
else:
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@ -1365,7 +1365,7 @@ class PokemonForm(TableBase):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.name:
|
if self.name:
|
||||||
return u'{0} {1}'.format(self.name, self.form_base_pokemon.name)
|
return u'%s %s' % (self.name, self.form_base_pokemon.name)
|
||||||
else:
|
else:
|
||||||
return self.form_base_pokemon.name
|
return self.form_base_pokemon.name
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue