### pokedex/main.py -
#### create_parser() -
- Change the default in the the help text for the `-l` argument in the
`pokedex dump` parser.
#### command_dump() -
- Change the functionality of `pokedex dump -l none` to be the same as
entering `pokedex dump`.
---
### pokedex/db/load.py -
#### dump() -
- Change the functionality of the dump command to work the way that the
help text says it should.
- Tables always dump official languages.
- If there were any `langs` passed, then the official languages plus the
specified `langs` will be dumped from the tables that have a
'local_language_id' column.
- If `pokedex dump -l all` is passed then all the languages (official
and unofficial) will be dumped.
- If the table doesn't have a 'local_language_id' column, then all the
rows will be dumped.
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.
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
Run git-diff after dumping the database to make sure that there are no
changes to the csv files.
We often get PRs from people who edit stuff by hand and don't know to do
a load/dump of the database afterwards. Usually this means they were
adding game data by hand, which we want to discourage, but even if it's
done for valid reasons it's good to canonicalize the csv files as soon
as possible to avoid interfering with future commits.
The help text for pokedex dump -l says
-l LANGS, --langs LANGS
comma-separated list of language codes to load,
'none', or 'all' (default: en)
However, the values 'none' and 'all' don't work (they are treated as
language names) and the default is to dump all languages, not just
English.
So `dump -l all` actually dumps no text at all because there is no
language called 'all'.
This is about to cause trouble for Travis CI because the next commit
will start checking that load/dump successfully round-trips... which
definitely isn't the case right now because the dump is missing
all text from translated tables.
The dump command and its documentation should definitely be fixed at
some point, but for now just stop using -l.
`sudo: false` used to be the way to opt in to their container-based
infrastructure. That system was retired in 2018 and so the `sudo` option
no longer does anything. Remove it.
Travi CI supports multiple OSes now. Add `os: linux` to be explicit
about which OS we want to test on.
Gen III contest effects were part of the initial data import from brown
veekun and so have probably never gotten a proper rip.
This commit re-rips contest effect stats, types, combos, and the mapping
between contest effects and moves.
None of the stats changed (jam & appeal); a few moves got assigned
different contest effects (specifically: smokescreen, flash, spite, and
shadow ball); and several combos changed.
For example, Hail was listed as comboing into the following moves
(this is also what Bulbapedia says):
Ice Beam, Blizzard, Aurora Beam, Haze, Powder Snow, Icy Wind,
Ice Ball, Weather Ball, Sheer Cold, Icicle Spear
However, the actual list is much shorter:
Blizzard, Powder Snow, Weather Ball
I verified on my Ruby cart that Hail->Ice Beam and Hail->Icy Wind are
not real combos, and that Hail->Blizzard is.
n.b. There are a bunch of unused contest effects in the game: out of 48
effects, 15 are not used by any move. The pokedex doesn't currently
include these. I elected not to add them, partly because i didn't want
to have to rip flavor text for them, but mostly because if i were going
to go that route i would probably reassign contest_effects.id to match
their internal ids, which would have made for uglier diffs.
Fixes#280
- link to nonexistant `[]{move:shield}` in Color Change (changed to protect)
- invalid syntax `[move:sandstorm]` in Primordial Sea
- invalid syntax `[move:sandstorm]` in Desolate Land
- invalid syntax `[move:sandstorm]` in Delta Stream
Found by test_markdown_values, which is not run by default because it is
slow. It can be run manually with
py.test pokedex/tests/test_strings.py --all
Pikachu's Cap forms and Cosplay forms had overlapping orders because i
forgot about Cosplay Pikachu when i set the form_order for the cap
forms.
??? Arceus had form_order=3 so it would go after all the other forms,
which had form_order=2. These were assigned distinct form_orders 2
through 17 at some point during a recent dump, but ??? Arceus was
missed.
Fixes#282
This commit adds Korean translations for egg groups, generations, languages, regions, stats, and version names. Also the ??? and shadow types.
It also fills in some missing foreign version names for S/M and US/UM (from Bulbapedia).
Roserade and Roselia were mistakenly sharing dex number 72. Presumably
an error from the original X/Y spreadsheet. I guess we never reripped
these after 3DS rom dumping became possible.
Regardless of how it happened, add a test and some database constraints
to ensure that it doesn't happen again.
- Add a test for gaps in pokedex numbers
- Add uniqueness constraints to pokemon_dex_numbers. A species can
only appear once per pokedex, and a number cannot be used more than
once per pokedex.
Cosplay Pikachu was listed as being encountered in contest-hall, but
that's a Sinnoh location. In OR/AS, the contest halls are not a
first-class location but rather just treated as part of the town or city
they are in. Cosplay Pikachu is given to the player after they
participate in their first contest, so its location can be any of the
four cities with a contest hall.
The Sinnoh starter that the player obtains in OR/AS is on Hoenn Route
101, not Sinnoh Route 201 (probably a copy/paste error).
Add a test to make sure that encounter regions always match the
region(s) that their game takes place in.
Add Japanese translations of the generation names, thanks to @SethETaron. I think this marks our first unofficial Japanese translation. 🎉
Also, fix some issues with Gen VII:
* generation names were missing for every language
* the identifier was incorrect — it was sun-moon instead of generation-vii
Fixes#250, #251, and #252.
Fossil pokémon don't fit with the rest of the gift pokemon: rather than
being given a pokémon directly, you get an item which can be exchanged
for a pokémon somewhere else ("revived"). To handle them properly we'd
have to add an item location table. I don't want to figure that out
right now, so just ignore the fossils for now.
Python 3 doesn't allow the ur'' prefix for raw unicode strings.
We want a unicode string here so that we get a unicode regexp,
so drop the r and do the escaping explicitly (the regexp in question
is pretty simple, fortunately).
Unova Routes 19-23 were added in B/W 2 and i forgot to prefix them when
we added the locations. Kalos Victory Road used to have a prefix but it
got dropped when i re-ripped X/Y locations. Kalos Pokemon League gets a
prefix too, since both Sinnoh and Alola also have Pokemon Leagues.
Add a test to ensure that we don't forget again in the future.
Also require location area identifiers to be unique to their location.
I almost added a duplicate pokemon-league location when adding S/M
locations. This should help.
The previous commit added a nullable subtitle field to location_names.
This caused a test in test_schema.py to fail because the name field
wasn't also nullable.
A comment above the test says, "If there's more than one text column in a
translation table they have to be nullable, to support missing
translations", but i don't think that logic holds in this case.
The idea is that we might have a translation for the subtitle, but not
the name, or vice versa, so both need to be nullable in case one or the
other is missing. But in this particular case that doesn't make sense:
if you don't have a name, you don't have a location; it may or may not
have a subtitle, but a location will always have a name.
Therefore, add an exception to the test.
Using the following steps:
* Unroll the previous commit with bulk CSV changes (b7500e92f0)
* remove and re-initialize the database
* follow the steps in that commit
* Only select location_area_prose in English
(there's a bunch of czech translations tracked separately in pokedex/data/csv/translations/cs.csv)
This change implies no functionality, but it was easiest to just
make it - sqlite insists on quoting spaces, though it's not needed.
Not rolling it back, since theoretically someone could run into the
same thing again in the future.