From b655fa7b52c5ce605bd19be81d1b080a1bf005c6 Mon Sep 17 00:00:00 2001 From: chris360KS Date: Wed, 8 Jan 2020 13:04:26 +1100 Subject: [PATCH] Remove Typing dependency, update docs --- README.html | 96 ++++++++++++--------------------- README.md | 6 +-- package-lock.json | 16 ------ popup_wikipedia/consts.py | 6 +-- popup_wikipedia/wiki_connect.py | 5 +- 5 files changed, 42 insertions(+), 87 deletions(-) delete mode 100644 package-lock.json diff --git a/README.html b/README.html index 8995465..8111d07 100644 --- a/README.html +++ b/README.html @@ -1,89 +1,61 @@ AnkiWikiPopup -

Anki 2.1 addon to display Wikipedia page previews inside of Anki.

+Anki 2.1 addon to display Wikipedia page previews inside of Anki. -

Shows a popup of the Mobile Wikipedia page / Extract for the selected text. In order to avoid conflicts with the - Popup-Dictionary addon, this addon only supports keyboard shortcuts (Control-Shift-W) for now.

+Shows a popup of the Mobile Wikipedia page / Extract for the selected text. In order to avoid conflicts with the +Popup-Dictionary addon, this addon only supports keyboard shortcuts (Control-Shift-W) for now. Modes: +Mobile (default) + -

| Mobile (default) | Extract (shorter, faster to load) | - docs/content_extract.png | docs/content_extract.png -

+Extract (shorter, faster to load) + Features - -

This is currently in beta stage - things will almost certainly break! Please submit a bug report if it does.

- -

Installation

- -

AnkiWeb

- -

The easiest way to install Pop-up Dictionary is through AnkiWeb.

- -

Manual installation

+This is currently in beta stage - things will almost certainly break! Please submit a bug report if it does. -
    -
  1. Make sure you have the latest version of Anki 2.1 installed. - Earlier releases (e.g. found in various Linux distros) do not support .ankiaddon packages. -
  2. +Installation -
  3. Download the latest .ankiaddon package from the releases tab (you might need to click on - Assets below the description to reveal the download links) -
  4. +The easiest way to install Pop-up Dictionary is through AnkiWeb. -
  5. From Anki's main window, head to ToolsAdd-ons
  6. +License and Credits -
  7. Drag-and-drop the .ankiaddon package onto the add-ons list
  8. +Significant portions of the code (as marked in the source files) +were based on the Anki add-on Pop-up Dictionary by +Glutanimate. Click here to support Glutanimate's work. -
  9. Restart Anki
  10. -
+I would also like to thank the team at AMBOSS for their encouragment and +inspiration for this work. Some css and js code was taken from their extremely good Anki Addon. -

License and Credits

- -

Significant portions of the code (as marked in the source files) - were based on the Anki add-on Pop-up Dictionary by - Glutanimate. Click here to support Glutanimate's work.

- -

I would also like to thank the team at AMBOSS for their encouragment and - insipration for this work. Some css and js code was taken from their extremely good Anki Addon.

- -

Ships with the following javascript libraries:

+Ships with the following javascript libraries: -

PopupWikipedia is free and open-source software. The add-on code that runs within Anki is released under the GNU - AGPLv3 license. For more information please see the LICENSE file that accompanied - this program.

+PopupWikipedia is free and open-source software. The add-on code that runs within Anki is released under the GNU +AGPLv3 license. For more information please see the LICENSE file that accompanied +this program. -

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.

+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. -

Known issues

+ Known issues diff --git a/README.md b/README.md index fca6367..60746f7 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ This is currently in beta stage - things will almost certainly break! Please sub #### AnkiWeb -The easiest way to install Pop-up Dictionary is through [AnkiWeb](https://ankiweb.net/shared/info/). +The easiest way to install Pop-up Dictionary is through [AnkiWeb](https://ankiweb.net/shared/info/395343016). #### Manual installation 1. Make sure you have the [latest version](https://apps.ankiweb.net/#download) of Anki 2.1 installed. Earlier releases (e.g. found in various Linux distros) do not support `.ankiaddon` packages. -2. Download the latest `.ankiaddon` package from the [releases tab](https://github.com/glutanimate/popup-dictionary/releases) (you might need to click on *Assets* below the description to reveal the download links) +2. Download the latest `.ankiaddon` package from the [releases tab](https://github.com/cfculhane/AnkiPopupWikipedia/releases) (you might need to click on *Assets* below the description to reveal the download links) 3. From Anki's main window, head to *Tools* → *Add-ons* 4. Drag-and-drop the `.ankiaddon` package onto the add-ons list 5. Restart Anki @@ -43,7 +43,7 @@ I would also like to thank the team at [AMBOSS](https://www.amboss.com/) for the Ships with the following javascript libraries: - jQuery (v1.12.4), (c) jQuery Foundation, licensed under the MIT license -- qTip2 (v2.1.1), (c) 2011-2018 Craig Michael Thompson, licensed under the MIT license +- qTip2 (v3.0.3), (c) 2011-2018 Craig Michael Thompson, licensed under the MIT license - imagesLoaded (v4.1.4) (c) David DeSandro, licensed under the MIT license PopupWikipedia is free and open-source software. The add-on code that runs within Anki is released under the GNU AGPLv3 license. For more information please see the [LICENSE](https://github.com/cfculhane/AnkiPopupWikipedia/blob/master/LICENSE) file that accompanied this program. diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 2c9ac46..0000000 --- a/package-lock.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "mitt": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.2.0.tgz", - "integrity": "sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==" - }, - "popper.js": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.0.tgz", - "integrity": "sha512-+G+EkOPoE5S/zChTpmBSSDYmhXJ5PsW8eMhH8cP/CQHMFPBG/kC9Y5IIw6qNYgdJ+/COf0ddY2li28iHaZRSjw==" - } - } -} diff --git a/popup_wikipedia/consts.py b/popup_wikipedia/consts.py index b7b90f8..06302e4 100644 --- a/popup_wikipedia/consts.py +++ b/popup_wikipedia/consts.py @@ -11,9 +11,9 @@ class ADDON(object): """Class storing general add-on properties Property names need to be all-uppercase with no leading underscores """ - NAME = "Anki Wiki Popup" - MODULE = "anki_wiki_popup" - ID = "0000000000" + NAME = "Popup Wikipedia" + MODULE = "popup_wikipedia" + ID = "395343016" VERSION = __version__ LICENSE = "GNU AGPLv3" AUTHORS = ( diff --git a/popup_wikipedia/wiki_connect.py b/popup_wikipedia/wiki_connect.py index d1033d6..189c21f 100644 --- a/popup_wikipedia/wiki_connect.py +++ b/popup_wikipedia/wiki_connect.py @@ -31,7 +31,6 @@ import re from os import PathLike from pathlib import Path -from typing import Dict, Union from .libaddon._vendor.common.requests_cache import CachedSession @@ -153,7 +152,7 @@ def get_extract(self, title: str) -> str: return f'
{filled_html}
' - def summary_parser(self, summary_resp: Dict) -> Dict: + def summary_parser(self, summary_resp: {}) -> {}: """ Handles disambiguation routing, search failuers @@ -194,5 +193,5 @@ def srcrepl(match): # Return the file contents with paths replaced return p.sub(srcrepl, html_str) @staticmethod - def _write_htmlfile(html, pth: Union[Path, str, PathLike]) -> int: + def _write_htmlfile(html, pth: PathLike) -> int: return Path(pth).write_text(html, encoding="utf-8")