pokedex/main.py -
create_parser() -
Change the help message for the langs argument in the dump subparser
to show the actual default and state that the 'all' and 'none' codes
cannot be used alongside other codes.
command_dump() -
Check if 'all' or 'none' codes are passed alongside other codes. If
they are, error message is printed and program ends.
pokedex/db/load.py -
dump() -
Add check if langs code is 'all' or 'none'.
If langs wasn't passed to the parser or 'all' was passed (they are
the same since the default is 'all'), then everything will get
dumped to the csv files.
If 'none' was passed to the parser, then nothing new should be
dumped to the csv files.
pokexed/.travis.yml -
Re-added 'pokedex dump -l all' that was previously remove on
77e3d9df16Resolves: #295
I don't really like this but ehhhhhhh, the system for prose
translations seems to be to keep them in csv/translations/, and I can't
figure out how you're supposed to DO that, plus judging by the age of
the single file that's in there, that seems to be where translations go
to die.
(Translations cannot be dumped properly because the source string hash
isn't in the database.)
By default, unofficial texts are only dumped for English, but that can
be configured if someone wants CSVs for different language(s).
Official texts (<thing>_names rows for official languages) are always
dumped.
Importing pokedex can take several seconds due to its rather large
dependencies—in particular, sqlalchemy, whoosh, and pkg_resources seem
to be the largest offenders. Normally, it would be possible to import
only the submodules one needs (pokedex.db, say), but pokedex.__init__
brings in all the submodules, for use by the command-line interface.
The fix is rather obvious:
- Move the command-line stuff into pokedex.main.
Note: because the submodules are no longer imported by default, any
script which expects `import pokedex` to be useful will likely break.
Note: the `pokedex` command will not work until you re-run `python
setup.py develop`, to update entry_points.txt.
- Don't import pkg_resources until necessary.