Commit graph

20 commits

Author SHA1 Message Date
rluzuriaga
cc3d5d7aaf Fix pokedex dump -l argument error - PR Changes
### 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.
2020-04-10 12:05:29 -07:00
rluzuriaga
8ad6443a6c 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.
2020-04-02 18:25:52 -07:00
rluzuriaga
17f36243bc Fix pokedex dump -l argument error (#295)
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
    77e3d9df16

Resolves: #295
2020-03-31 20:02:06 -07:00
thechief389
f413bf82f0 Fix error when no arguments are specified (#240)
Also, introduce a metavar for the command subparser, since it's currently a bit verbose.
2018-08-22 23:34:27 -07:00
Eevee (Lexy Munroe)
dd6630368d Allow common CLI arguments to work both before and after the subcommand 2016-02-02 11:01:45 -08:00
Eevee (Lexy Munroe)
59d8a790d1 Stub out a CLI search interface, which can also work with JSON and strings 2016-02-02 10:13:38 -08:00
Eevee (Lexy Munroe)
2dcc3c1aab Port the CLI to argparse 2016-02-02 10:13:38 -08:00
Eevee (Lexy Munroe)
ef03259e0f Little better CLI handling of Unicode in Py2 2016-02-02 10:12:56 -08:00
Eevee (Alex Munroe)
0ff24b4dc8 Fix the CLI in py3 2015-10-05 16:29:21 -07:00
Eevee (Alex Munroe)
b76b74e7a6 Compat with Python 3.3+ 2015-10-05 08:12:23 -07:00
Lynn "Zhorken" Vaughan
63dac87a40 Dump translations for official languages by default.
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.
2014-06-01 19:44:32 -04:00
Eevee (Alex Munroe)
efc0d0d10c Maybe make the setuptools entry point actually work. 2013-08-09 13:11:54 -07:00
Eevee (Alex Munroe)
bef859632d Make the library work with python -m. 2013-08-09 13:00:37 -07:00
Andrew Ekstedt
4d84fec42e Update some URLs to point to github.com 2012-12-02 17:14:08 -08:00
Petr Viktorin
05cca04306 Add usage text for --langs 2011-04-11 17:07:39 +03:00
Petr Viktorin
34a8070449 Load translations in pokedex load. 2011-04-11 17:07:38 +03:00
Petr Viktorin
817c4c289d Don't dump unofficial translations in pokedex dump
(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.
2011-04-11 17:07:37 +03:00
a_magical_me
b9a54c63d8 Add usage text for --safe. 2011-04-03 03:21:54 -07:00
a_magical_me
9340f24ae4 load: Add --recursive option.
Helps somewhat with #526 (`pokedex load` is slow) by making it easier to
load only the tables you're interested in.
2011-04-03 03:17:08 -07:00
a_magical_me
e7c40a08af Speed up import pokedex.db slightly.
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.
2011-04-03 03:13:07 -07:00