Skip to content

Commit

Permalink
Merge pull request #14 from gflohr/new-config
Browse files Browse the repository at this point in the history
New config
  • Loading branch information
gflohr authored Jun 11, 2024
2 parents 7fb1c1d + 12c683b commit d84a598
Show file tree
Hide file tree
Showing 36 changed files with 1,221 additions and 600 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __pycache__
src/vendor
src/manifest.json
src/meta.json
src/version.py
/build
/ankidata
/ankiweb-description.md
4 changes: 4 additions & 0 deletions .pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
testpaths =
tests
pythonpath = src
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2024-06-12

### Added

* allow multiple imports per colour (thanks to Norbert Hies for the suggestion)

### Changed

* validate the configuration on load against the JSON schema

## [0.1.2] - 2023-12-12

### Fixed
Expand All @@ -28,4 +38,4 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Added

* importer for PGN files
* configuration to keep user preferences
* configuration to keep user preferences
26 changes: 23 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
include ./VERSION

default: all

all: zip ankiweb

zip: vendor
generated: src/version.py src/config.py src/schema.py

zip: generated vendor
python -m ankiscripts.build --type package --qt all --exclude user_files/**/*

ankiweb: vendor build/ankiweb-description.md
ankiweb: generated vendor build/ankiweb-description.md
python -m ankiscripts.build --type ankiweb --qt all --exclude user_files/**/*

build/ankiweb-description.md: description.md CHANGELOG.md
cat description.md CHANGELOG.md >$@

src/version.py: ./VERSION
@echo "__version__ = '$(VERSION)'" >$@

src/config.py: ./src/config.schema.json
datamodel-codegen \
--input=$< \
--input-file-type=jsonschema \
--output-model-type=typing.TypedDict \
| sed -e "s/ /\t/g" >$@

src/schema.py: ./src/config.schema.json
python3 ./tools/json2python.py <$< >$@

src/basic_names.py:
sh ./tools/get-basic-notetype-names.sh >$@

vendor:
python -m ankiscripts.vendor

Expand All @@ -35,6 +55,6 @@ sourcedist:
python -m ankiscripts.sourcedist

clean:
rm -rf build/
rm -rf build/ src/version.py src/config.py

.PHONY: all zip ankiweb vendor fix mypy pylint lint test sourcedist clean
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=v0.1.2
VERSION=1.0.0
2 changes: 1 addition & 1 deletion po/PACKAGE
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ TEXTDOMAIN = anki-chess-opening-trainer
# Initial copyright holder added to pot and po files.
COPYRIGHT_HOLDER = Guido Flohr <http://www.guido-flohr.net>

# Where to send msgid bugs?
# Where to send msgid bugs?
MSGID_BUGS_ADDRESS = Guido Flohr <guido.flohr@cantanea.com>
13 changes: 9 additions & 4 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
../anki-chess-opening-trainer.py
../src/__init__.py
../src/answer.py
../src/basic_names.py
../src/config.py
../src/config_reader.py
../src/delete_hook.py
../src/dialog.py
../src/importer.py
../src/patchset.py
../src/question.py
../src/__init__.py
../src/page.py
../src/question.py
../src/schema.py
../src/updater.py
../src/version.py
../src/visitor.py
122 changes: 90 additions & 32 deletions po/anki-chess-opening-trainer.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: Guido Flohr <guido.flohr@cantanea.com>\n"
"POT-Creation-Date: 2023-11-21 17:55+0200\n"
"POT-Creation-Date: 2024-06-11 21:16+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -18,91 +18,149 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

#: ../anki-chess-opening-trainer.py:83 ../src/dialog.py:207
#: ../src/__init__.py:47 ../src/dialog.py:277
msgid "Chess Opening Trainer"
msgstr ""

#: ../src/config_reader.py:27
msgid "Cannot run without main window!"
msgstr ""

#: ../src/config_reader.py:39
msgid "Your add-on configuration is invalid, restoring defaults."
msgstr ""

#: ../src/dialog.py:45
msgid "Import PGN File"
msgstr ""

#: ../src/dialog.py:50
msgid "Color"
msgstr ""

#: ../src/dialog.py:53
msgid "White"
msgstr ""

#: ../src/dialog.py:54
msgid "Black"
msgstr ""

#: ../src/dialog.py:58
msgid "Deck"
msgstr ""

#: ../src/dialog.py:70
msgid "Input Files"
msgstr ""

#: ../src/dialog.py:73
msgid "Select files"
msgstr ""

#: ../src/dialog.py:77
msgid "Note type"
msgstr ""

#: ../src/dialog.py:89
msgid "Basic"
msgstr ""

#: ../src/dialog.py:202
msgid "No changes since last import into this deck."
msgstr ""

#: ../src/dialog.py:205
#, python-format
msgid "%d note inserted."
msgid_plural "%d notes inserted."
msgstr[0] ""
msgstr[1] ""

#: ../anki-chess-opening-trainer.py:86 ../src/dialog.py:209
#: ../src/dialog.py:207
#, python-format
msgid "%d note updated."
msgid_plural "%d notes updated."
msgstr[0] ""
msgstr[1] ""

#: ../anki-chess-opening-trainer.py:88 ../src/dialog.py:211
#: ../src/dialog.py:209
#, python-format
msgid "%d note deleted."
msgid_plural "%d notes deleted."
msgstr[0] ""
msgstr[1] ""

#: ../anki-chess-opening-trainer.py:90 ../src/dialog.py:213
#: ../src/dialog.py:211
#, python-format
msgid "%d image created."
msgid_plural "%d images created."
msgstr[0] ""
msgstr[1] ""

#: ../anki-chess-opening-trainer.py:93 ../src/dialog.py:215
#: ../src/dialog.py:213
#, python-format
msgid "%d image deleted."
msgid_plural "%d images deleted."
msgstr[0] ""
msgstr[1] ""

#: ../src/dialog.py:42 ../src/dialog.py:144
msgid "Basic"
#: ../src/dialog.py:243
msgid "No input files specified!"
msgstr ""

#: ../src/dialog.py:105
msgid "Import Opening PGN"
#: ../src/dialog.py:261
msgid "An error occurred!"
msgstr ""

#: ../src/dialog.py:110
msgid "Input Files"
#: ../src/dialog.py:262
msgid ""
"Clicking the help button will open a web page explaining how to report a bug."
msgstr ""

#: ../src/dialog.py:113
msgid "Select files"
#: ../src/dialog.py:263
msgid "Please include the following information in your bug report:"
msgstr ""

#: ../src/dialog.py:117
msgid "Deck"
#: ../src/dialog.py:265
msgid "Exception type:"
msgstr ""

#: ../src/dialog.py:126
msgid "Color"
#: ../src/dialog.py:266
msgid "Exception message:"
msgstr ""

#: ../src/dialog.py:129
msgid "White"
#: ../src/dialog.py:267
msgid "Traceback:"
msgstr ""

#: ../src/dialog.py:130
msgid "Black"
#: ../src/dialog.py:291
msgid ""
"https://www.guido-flohr.net/practice-chess-openings-with-anki/#report-bugs"
msgstr ""

#: ../src/dialog.py:133
msgid "Note type"
#: ../src/dialog.py:308
msgid "Open PGN files"
msgstr ""

#: ../src/dialog.py:232
msgid "No input files specified!"
#: ../src/dialog.py:309
msgid "Portable Game Notation files (*.pgn)"
msgstr ""

#: ../src/dialog.py:252
msgid "Open PGN files"
#: ../src/dialog.py:329
msgid "The selected deck does not exist! Try again!"
msgstr ""

#: ../src/dialog.py:253
msgid "Portable Game Notation files (*.pgn)"
#: ../src/dialog.py:336
msgid "The selected note type does not exist! Try again!"
msgstr ""

#: ../src/__init__.py:47
msgid "Chess Opening Trainer"
#: ../src/importer.py:43
msgid "Selected note type does not exist!"
msgstr ""

#: ../src/importer.py:47
msgid "Selected deck does not exist!"
msgstr ""

#. TRANSLATORS: This is the letter to use for a pawn.
Expand Down
Binary file modified po/de.gmo
Binary file not shown.
Loading

0 comments on commit d84a598

Please sign in to comment.