From fe9605f63278715779064dfdde383c343884eda1 Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Thu, 4 Apr 2019 19:11:19 +0200 Subject: [PATCH] Some small refactoring on More Answer Buttons --- .../{more answer buttons.py => More Answer Buttons.py} | 6 +++++- .../more_answer_buttons/README.md | 3 +++ .../more_answer_buttons/__init__.py | 7 +++---- .../more_answer_buttons/config.md | 10 ++++++++++ .../if you use Anki 2.0 read this.txt | 1 - .../more_answer_buttons/manifest.json | 4 ++++ .../more_answer_buttons/readme.md | 7 ------- .../reviewer_more_answer_buttons_for_21.py | 6 +++--- 8 files changed, 28 insertions(+), 16 deletions(-) rename src/reviewer_more_answer_buttons/{more answer buttons.py => More Answer Buttons.py} (91%) create mode 100644 src/reviewer_more_answer_buttons/more_answer_buttons/README.md create mode 100644 src/reviewer_more_answer_buttons/more_answer_buttons/config.md delete mode 100644 src/reviewer_more_answer_buttons/more_answer_buttons/if you use Anki 2.0 read this.txt create mode 100644 src/reviewer_more_answer_buttons/more_answer_buttons/manifest.json delete mode 100644 src/reviewer_more_answer_buttons/more_answer_buttons/readme.md diff --git a/src/reviewer_more_answer_buttons/more answer buttons.py b/src/reviewer_more_answer_buttons/More Answer Buttons.py similarity index 91% rename from src/reviewer_more_answer_buttons/more answer buttons.py rename to src/reviewer_more_answer_buttons/More Answer Buttons.py index 5f97792..392255f 100644 --- a/src/reviewer_more_answer_buttons/more answer buttons.py +++ b/src/reviewer_more_answer_buttons/More Answer Buttons.py @@ -2,9 +2,13 @@ """ Anki Add-on: More Answer Buttons for New Cards + Entry point for the add-on into Anki Please do not edit this if you do not know what you are doing. + Copyright: (c) 2016-2019 Glutanimate + (c) ijgnd 2019 + License: GNU AGPLv3 """ @@ -22,4 +26,4 @@ # Please use NotePad++ or another text editor that supports python # source code files to edit it -import more_answer_buttons +import more_answer_buttons # noqa: F401 diff --git a/src/reviewer_more_answer_buttons/more_answer_buttons/README.md b/src/reviewer_more_answer_buttons/more_answer_buttons/README.md new file mode 100644 index 0000000..dc26a40 --- /dev/null +++ b/src/reviewer_more_answer_buttons/more_answer_buttons/README.md @@ -0,0 +1,3 @@ +## Configuring the add-on on Anki 2.0 + +The configuration options may be found at the top of the file reviewer_more_answer_buttons_for_20.py. \ No newline at end of file diff --git a/src/reviewer_more_answer_buttons/more_answer_buttons/__init__.py b/src/reviewer_more_answer_buttons/more_answer_buttons/__init__.py index ad3c4d3..57971b4 100644 --- a/src/reviewer_more_answer_buttons/more_answer_buttons/__init__.py +++ b/src/reviewer_more_answer_buttons/more_answer_buttons/__init__.py @@ -4,15 +4,14 @@ # Please do not edit this if you do not know what you are doing. # # Copyright: (c) 2017-2019 Glutanimate +# (c) 2019 ijgnd # License: GNU AGPLv3 -import sys -import os from anki import version anki20 = version.startswith("2.0") if anki20: - from . import reviewer_more_answer_buttons_for_20 + from . import reviewer_more_answer_buttons_for_20 # noqa: F401 else: - from . import reviewer_more_answer_buttons_for_21 + from . import reviewer_more_answer_buttons_for_21 # noqa: F401 diff --git a/src/reviewer_more_answer_buttons/more_answer_buttons/config.md b/src/reviewer_more_answer_buttons/more_answer_buttons/config.md new file mode 100644 index 0000000..db751a7 --- /dev/null +++ b/src/reviewer_more_answer_buttons/more_answer_buttons/config.md @@ -0,0 +1,10 @@ +### Answer button properties + +You can add 4 buttons at maximum, each of which should have the following properties defined (please refer to the default config for the exact syntax and formatting): + +Description ... appears above the button +Label ... the label of the button +ShortCut ... the shortcut key for the button +ReschedMin ... same as the lower number in the Browser's "Edit/Rescedule" command +ReschedMax ... same as the higher number in the Browser's "Edit/Rescedule" command + diff --git a/src/reviewer_more_answer_buttons/more_answer_buttons/if you use Anki 2.0 read this.txt b/src/reviewer_more_answer_buttons/more_answer_buttons/if you use Anki 2.0 read this.txt deleted file mode 100644 index 5210774..0000000 --- a/src/reviewer_more_answer_buttons/more_answer_buttons/if you use Anki 2.0 read this.txt +++ /dev/null @@ -1 +0,0 @@ -the configuration options are on top of the file reviewer_more_answer_buttons_for_20.py diff --git a/src/reviewer_more_answer_buttons/more_answer_buttons/manifest.json b/src/reviewer_more_answer_buttons/more_answer_buttons/manifest.json new file mode 100644 index 0000000..6ffbd36 --- /dev/null +++ b/src/reviewer_more_answer_buttons/more_answer_buttons/manifest.json @@ -0,0 +1,4 @@ +{ + "name": "More Answer Buttons for New Cards", + "package": "153603893" +} diff --git a/src/reviewer_more_answer_buttons/more_answer_buttons/readme.md b/src/reviewer_more_answer_buttons/more_answer_buttons/readme.md deleted file mode 100644 index 8261de3..0000000 --- a/src/reviewer_more_answer_buttons/more_answer_buttons/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -There can not be more than 4 buttons. - - Description ... appears above the button - Label ... the label of the button - ShortCut ... the shortcut key for the button - ReschedMin ... same as the lower number in the Browser's "Edit/Rescedule" command - ReschedMax ... same as the higher number in the Browser's "Edit/Rescedule" command diff --git a/src/reviewer_more_answer_buttons/more_answer_buttons/reviewer_more_answer_buttons_for_21.py b/src/reviewer_more_answer_buttons/more_answer_buttons/reviewer_more_answer_buttons_for_21.py index 59a512b..1d46067 100644 --- a/src/reviewer_more_answer_buttons/more_answer_buttons/reviewer_more_answer_buttons_for_21.py +++ b/src/reviewer_more_answer_buttons/more_answer_buttons/reviewer_more_answer_buttons_for_21.py @@ -5,9 +5,9 @@ Adds extra buttons to the answer button area for new cards -Copyright: (c) Steve AW 2013 - (c) Glutanimate 2016-2017 - (c) ijgnd 2019 +Copyright: (c) 2013 Steve AW + (c) 2016-2019 Glutanimate + (c) 2019 ijgnd License: GNU AGPLv3 or later """