Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pokedex dump -l doesn't work as documented #295

Open
magical opened this issue Mar 1, 2020 · 1 comment · May be fixed by #299
Open

pokedex dump -l doesn't work as documented #295

magical opened this issue Mar 1, 2020 · 1 comment · May be fixed by #299

Comments

@magical
Copy link
Member

magical commented Mar 1, 2020

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.

We should either make it work the way it says it does or fix the documentation.

rluzuriaga added a commit to rluzuriaga/pokedex that referenced this issue Apr 1, 2020
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
    77e3d9d

Resolves: veekun#295
@rluzuriaga rluzuriaga linked a pull request Apr 1, 2020 that will close this issue
@rluzuriaga
Copy link
Contributor

My pull request keeps the same default functionality just adds more checks and functionality for 'none' and 'all'. As well as changed the documentation.
I thought that changing the default to actually be English would more than likely break other projects that depend on this repo.

magical pushed a commit that referenced this issue Jun 17, 2020
- Add exception handling for SQLite, PostgreSQL, and MySQL.
Sqlalchemy gives different exceptions for each database engine so I have
seperated each exception for each engine.
The error message passed by each engine is also different so that is
checked as well.
- Once the function gets one of those exceptions the following message
is outputed and the program ends: `ERROR:  Table 'TABLENAME' already
exists in the database. Did you mean to use 'pokedex load -D'`
- If the error is not that a table already exists, then the output will
just be the full error from sqlalchemy. That way if someone runs into
that error it can be reported as an issue and whoever can help would see
the full error.
---
Resolves part of issue #16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants