1
0
Fork 0
mirror of https://github.com/veekun/pokedex.git synced 2024-08-20 18:16:34 +00:00

Fix pokedex dump -l argument error - PR Changes

All changes requested in PR 17f36243bc

 ### pokedex/main.py -
 #### create_parser() -
- Change to langs argument reverting the help message to the original
one but changing the default to 'all'.
 #### command_dump() -
- Add check for 'all' langs code instead of in the load.py file.
- Add/fix comments.
---
 ### pokedex/db/load.py -
 #### dump() -
- Remove unneeded check for 'all' langs code since not it is checked in
the main.py file.
- Reword comment of what happens when the 'none' code is passed.
This commit is contained in:
rluzuriaga 2020-04-02 18:25:52 -07:00
parent 17f36243bc
commit 8ad6443a6c
2 changed files with 10 additions and 6 deletions
pokedex/db

View file

@ -431,11 +431,11 @@ def dump(session, tables=[], directory=None, verbose=False, langs=None):
# if specified, or for official languages by default.
# For non-translation tables, dump all rows.
if 'local_language_id' in columns:
# If no lang arguments were passed or the 'all' argument was passed
if langs is None or langs == ['all']:
if langs is None:
def include_row(row):
return languages[row.local_language_id].official
# If the none argument is passed then nothing should be changed from the csv files
# If the none code is passed, then all the csv files with the local_language_id
# column are not updated. In other words they are left blank.
elif langs == ['none']:
return False
elif any(col.info.get('official') for col in table.columns):