mirror of
https://github.com/LazoCoder/Pokemon-Terminal
synced 2024-11-23 12:23:04 +00:00
The caedus maneuver for one-based enumeration
@caedus75 nice one!
This commit is contained in:
parent
125d174e01
commit
9cc2fc5c07
1 changed files with 3 additions and 3 deletions
|
@ -30,8 +30,8 @@ def region_name_by_id(id):
|
|||
assert False, 'region_name_by_id({})'.format(id)
|
||||
|
||||
|
||||
def make_a_pokemon(i, line):
|
||||
id = '{:03}'.format(i + 1)
|
||||
def make_a_pokemon(id, line):
|
||||
id = '{:03}'.format(id)
|
||||
line = line.strip().split()
|
||||
while len(line) < 4: # add '' as the subtype if it is missing
|
||||
line.append('')
|
||||
|
@ -47,7 +47,7 @@ def make_a_pokemon(i, line):
|
|||
def load_pokemon(filename='pokemon.txt'):
|
||||
"""Load everything but the Pokemon from the 'Extra' folder"""
|
||||
with open(os.path.join(DATA_DIR, filename)) as in_file:
|
||||
return [make_a_pokemon(i, line) for i, line in enumerate(in_file)]
|
||||
return [make_a_pokemon(i, line) for i, line in enumerate(in_file, 1)]
|
||||
|
||||
|
||||
def make_an_extra_pokemon(filename, in_ext='.jpg'):
|
||||
|
|
Loading…
Reference in a new issue