diff --git a/addon/__init__.py b/addon/__init__.py index 18f59b8..07f7c94 100644 --- a/addon/__init__.py +++ b/addon/__init__.py @@ -21,7 +21,7 @@ # Allow webviews accessing kanjivg svgs, web data for lookups and fonts aqt.mw.addonManager.setWebExports( - __name__, r"(kanjivg/.*\.svg|web/.*|fonts/.*|user_files/fonts/.*)" + __name__, r"(kanjivg/.*\.svg|kanjivg-supplementary/.*\.svg|primitives/.*\.svg|web/.*|fonts/.*|user_files/fonts/.*)" ) diff --git a/addon/card_type.py b/addon/card_type.py index 4db9ed4..52c35fc 100644 --- a/addon/card_type.py +++ b/addon/card_type.py @@ -124,9 +124,12 @@ def field_exists(name): settings_html = f""" """ + common_js = "\n\n" jquery_js = "\n\n" common_back_js = "\n\n" dmak_js = "\n\n" @@ -139,6 +142,7 @@ def field_exists(name): jquery_js + settings_html + "\n\n" + japanese_util_js + + common_js + read_web_file_with_includes(f"front-{self.label}.html") ) template["afmt"] = ( @@ -147,6 +151,7 @@ def field_exists(name): dmak_js + raphael_js + japanese_util_js + + common_js + read_web_file_with_includes(f"back-{self.label}.html") + common_back_js + launch_back_js diff --git a/addon/fonts.py b/addon/fonts.py index 5ba0e0c..470581e 100644 --- a/addon/fonts.py +++ b/addon/fonts.py @@ -23,6 +23,22 @@ def get_col_name(idx): def get_col_path(idx): return util.col_media_path(get_col_name(idx)) +def assure_primitive_col_media(sub_dir=''): + primitive_dir = util.addon_path("primitives",sub_dir) + primitive_files = os.listdir(primitive_dir) + if sub_dir != '': + sub_dir_tag = sub_dir + '_' + else: + sub_dir_tag = '' + for f in primitive_files: + src_path = util.addon_path("primitives", sub_dir, f) + if not os.path.isdir(src_path): + dest_path = util.col_media_path('_primitive_' + sub_dir_tag + f) + shutil.copy(src_path, dest_path) + else: + # subdirectory + assure_primitive_col_media(f) + def get_addon_uri(idx): user_name = config.get("fonts", config_default)[idx] @@ -109,3 +125,4 @@ def ui_css(): def assure_col_media(): for idx in range(font_num): shutil.copy(get_path(idx), get_col_path(idx)) + assure_primitive_col_media() diff --git a/addon/kanji.db b/addon/kanji.db index 882c1ae..4d6f0f7 100644 Binary files a/addon/kanji.db and b/addon/kanji.db differ diff --git a/addon/kanji.py b/addon/kanji.py index d690bc5..052d89b 100644 --- a/addon/kanji.py +++ b/addon/kanji.py @@ -8,7 +8,7 @@ import anki import aqt -from .util import addon_path, user_path, assure_user_dir, unique_characters +from .util import addon_path, user_path, assure_user_dir, unique_characters, custom_list from .errors import InvalidStateError, InvalidDeckError from .card_type import CardType from . import config @@ -24,10 +24,12 @@ def clean_character_field(f): f = f.lstrip() f = text_parser.html_regex.sub("", f) if len(f): + # Leave [primitive_tag] as it is, otherwise return the single unicode character + if f[0] == '[': + return f return f[0] return "" - class KanjiDB: def __init__(self): self.initialize() @@ -155,17 +157,6 @@ def _new_characters_find(self, card_type, character, out, max_characters=-1): if character in out: return - # Check if card already exists for character - table = f"usr.{card_type.label}_card_ids" - r = self.crs_execute_and_fetch_one( - f"SELECT COUNT(*) FROM {table} " - "WHERE character == (?) AND card_id NOT NULL", - (character,), - ) - - if r[0] != 0: - return - # Get primitives primitives_result = self.crs_execute_and_fetch_one( "SELECT primitives FROM characters " "WHERE character == (?)", (character,) @@ -175,6 +166,7 @@ def _new_characters_find(self, card_type, character, out, max_characters=-1): print(f"Lookup of primitive {character} failed.") return primitives = primitives_result[0] + primitives = custom_list(primitives) # Recusivly add primitives that need to be learned if enabled if card_type.add_primitives: @@ -187,6 +179,17 @@ def _new_characters_find(self, card_type, character, out, max_characters=-1): if max_characters >= 0 and len(out) >= max_characters: return + # Check if card already exists for character + table = f"usr.{card_type.label}_card_ids" + r = self.crs_execute_and_fetch_one( + f"SELECT COUNT(*) FROM {table} " + "WHERE character == (?) AND card_id NOT NULL", + (character,), + ) + + if r[0] != 0: + return + out.append(character) # Recursivley find new characters to learn @@ -612,23 +615,18 @@ def make_cards_from_characters(self, card_type, new_characters, checkpoint=None) deck_id = deck["id"] model = aqt.mw.col.models.byName(model_name) - aqt.mw.requireReset() - for c in characters: note = anki.notes.Note(aqt.mw.col, model) note["Character"] = c self.refresh_note(note) add_note_no_hook(aqt.mw.col, note, deck_id) - aqt.mw.maybeReset() - self.recalc_user_cards(card_type) def refresh_note(self, note, do_flush=False): c = clean_character_field(note["Character"]) if len(c) < 1: return - c = c[0] note["Character"] = c r = self.get_kanji_result_data(c, card_ids=False) @@ -637,10 +635,20 @@ def refresh_note(self, note, do_flush=False): data_json_b64 = str(data_json_b64_b, "utf-8") note["MigakuData"] = data_json_b64 - svg_name = "%05x.svg" % ord(c) - svg_path = addon_path("kanjivg", svg_name) + if c[0] == '[': + svg_name = c[1:-1] + ".svg" + else: + svg_name = "%05x.svg" % ord(c) + + # Try to find the KanjiVG file first in supplementary directory and + # only then from the main repository + svg_path = addon_path("kanjivg-supplementary", svg_name) + if not os.path.exists(svg_path): + svg_path = addon_path("kanjivg", svg_name) + if not os.path.exists(svg_path): + svg_path = '' - if os.path.exists(svg_path): + if svg_path != '': with open(svg_path, "r", encoding="utf-8") as file: svg_data = file.read() @@ -651,6 +659,31 @@ def refresh_note(self, note, do_flush=False): if do_flush: note.flush() + # If the deck has cards that have now references for new primitives + # which are not yet included in the stack, add them. + def add_missing_characters(self): + new_kanji_for_msg = OrderedDict() + + for ct in CardType: + if not ct.add_primitives: + continue + + find_filter = f'"note:{ct.model_name}"' + note_ids = aqt.mw.col.find_notes(find_filter) + + all_characters_in_the_deck = [] + for i, note_id in enumerate(note_ids): + note = aqt.mw.col.getNote(note_id) + c = clean_character_field(note["Character"]) + all_characters_in_the_deck.append(c) + + new_characters = self.new_characters(ct, all_characters_in_the_deck, -1) + if len(new_characters) > 0: + new_kanji_for_msg[ct] = new_characters + + if len(new_kanji_for_msg) > 0: + KanjiConfirmDialog.show_new_kanji(new_kanji_for_msg, aqt.mw) + # Recalc everything def recalc_all(self, callback=None): if callback: @@ -664,6 +697,8 @@ def recalc_all(self, callback=None): self.recalc_user_words() + self.add_missing_characters() + find_filter = [f'"note:{ct.model_name}"' for ct in CardType] note_ids = aqt.mw.col.find_notes(" OR ".join(find_filter)) num_notes = len(note_ids) @@ -701,10 +736,10 @@ def get_kanji_result_data( ("grade", _, None), ("jlpt", _, None), ("kanken", _, None), - ("primitives", list, None), - ("primitive_of", list, None), + ("primitives", custom_list, None), + ("primitive_of", custom_list, None), ("primitive_keywords", json.loads, None), - ("primitive_alternatives", list, None), + ("primitive_alternatives", custom_list, None), ("heisig_id5", _, None), ("heisig_id6", _, None), ("heisig_keyword5", _, None), diff --git a/addon/kanji_confirm_dialog.py b/addon/kanji_confirm_dialog.py index 9e41a16..d560aad 100644 --- a/addon/kanji_confirm_dialog.py +++ b/addon/kanji_confirm_dialog.py @@ -55,7 +55,11 @@ def data(self, idx, role): if role == Qt.ItemDataRole.DisplayRole: # This should be a QBrush, but we also use the method - return str(kanji) + if kanji[0] != '[': + return str(kanji) + if role == Qt.ItemDataRole.DecorationRole: + if kanji[0] == '[': + return util.get_pixmap_from_tag(kanji, 35) if role == Qt.ItemDataRole.BackgroundRole: state = self.states[kanji] return QBrush(QColor(self.state_colors[state])) @@ -163,9 +167,10 @@ def __init__(self, parent=None, ct_kanji={}): self.resize(500, 400) - button_box = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok) + button_box = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel) button_box.accepted.connect(self.accept) - lyt.addWidget(button_box) + button_box.rejected.connect(self.reject) + lyt.addWidget(button_box, Qt.AlignmentFlag.AlignRight) self.add_kanji(ct_kanji) diff --git a/addon/kanjivg-supplementary/02e81.svg b/addon/kanjivg-supplementary/02e81.svg new file mode 100644 index 0000000..97608fc --- /dev/null +++ b/addon/kanjivg-supplementary/02e81.svg @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/02eb6.svg b/addon/kanjivg-supplementary/02eb6.svg new file mode 100644 index 0000000..5e6c570 --- /dev/null +++ b/addon/kanjivg-supplementary/02eb6.svg @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/030ff.svg b/addon/kanjivg-supplementary/030ff.svg new file mode 100644 index 0000000..84af432 --- /dev/null +++ b/addon/kanjivg-supplementary/030ff.svg @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/0342e.svg b/addon/kanjivg-supplementary/0342e.svg new file mode 100644 index 0000000..e6e0c98 --- /dev/null +++ b/addon/kanjivg-supplementary/0342e.svg @@ -0,0 +1,53 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/03452.svg b/addon/kanjivg-supplementary/03452.svg new file mode 100644 index 0000000..618e44c --- /dev/null +++ b/addon/kanjivg-supplementary/03452.svg @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/03563.svg b/addon/kanjivg-supplementary/03563.svg new file mode 100644 index 0000000..5774cec --- /dev/null +++ b/addon/kanjivg-supplementary/03563.svg @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/039ae.svg b/addon/kanjivg-supplementary/039ae.svg new file mode 100644 index 0000000..9c35bde --- /dev/null +++ b/addon/kanjivg-supplementary/039ae.svg @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04491.svg b/addon/kanjivg-supplementary/04491.svg new file mode 100644 index 0000000..d9b86d1 --- /dev/null +++ b/addon/kanjivg-supplementary/04491.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e02.svg b/addon/kanjivg-supplementary/04e02.svg new file mode 100644 index 0000000..220cb0f --- /dev/null +++ b/addon/kanjivg-supplementary/04e02.svg @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e1a.svg b/addon/kanjivg-supplementary/04e1a.svg new file mode 100644 index 0000000..602c350 --- /dev/null +++ b/addon/kanjivg-supplementary/04e1a.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e29.svg b/addon/kanjivg-supplementary/04e29.svg new file mode 100644 index 0000000..fb5ba96 --- /dev/null +++ b/addon/kanjivg-supplementary/04e29.svg @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e2c.svg b/addon/kanjivg-supplementary/04e2c.svg new file mode 100644 index 0000000..a7248a1 --- /dev/null +++ b/addon/kanjivg-supplementary/04e2c.svg @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e30.svg b/addon/kanjivg-supplementary/04e30.svg new file mode 100644 index 0000000..b6833a3 --- /dev/null +++ b/addon/kanjivg-supplementary/04e30.svg @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e37.svg b/addon/kanjivg-supplementary/04e37.svg new file mode 100644 index 0000000..7baedad --- /dev/null +++ b/addon/kanjivg-supplementary/04e37.svg @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e40.svg b/addon/kanjivg-supplementary/04e40.svg new file mode 100644 index 0000000..6fcda6d --- /dev/null +++ b/addon/kanjivg-supplementary/04e40.svg @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04e47.svg b/addon/kanjivg-supplementary/04e47.svg new file mode 100644 index 0000000..e2c5fe3 --- /dev/null +++ b/addon/kanjivg-supplementary/04e47.svg @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/04ebc.svg b/addon/kanjivg-supplementary/04ebc.svg new file mode 100644 index 0000000..71ad422 --- /dev/null +++ b/addon/kanjivg-supplementary/04ebc.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05151.svg b/addon/kanjivg-supplementary/05151.svg new file mode 100644 index 0000000..83a14b4 --- /dev/null +++ b/addon/kanjivg-supplementary/05151.svg @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05198.svg b/addon/kanjivg-supplementary/05198.svg new file mode 100644 index 0000000..744b1d3 --- /dev/null +++ b/addon/kanjivg-supplementary/05198.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05216.svg b/addon/kanjivg-supplementary/05216.svg new file mode 100644 index 0000000..3bc8ca8 --- /dev/null +++ b/addon/kanjivg-supplementary/05216.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/053d5.svg b/addon/kanjivg-supplementary/053d5.svg new file mode 100644 index 0000000..76f2718 --- /dev/null +++ b/addon/kanjivg-supplementary/053d5.svg @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/053da.svg b/addon/kanjivg-supplementary/053da.svg new file mode 100644 index 0000000..c5b0690 --- /dev/null +++ b/addon/kanjivg-supplementary/053da.svg @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05485.svg b/addon/kanjivg-supplementary/05485.svg new file mode 100644 index 0000000..f5ec20e --- /dev/null +++ b/addon/kanjivg-supplementary/05485.svg @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05547.svg b/addon/kanjivg-supplementary/05547.svg new file mode 100644 index 0000000..3c3b905 --- /dev/null +++ b/addon/kanjivg-supplementary/05547.svg @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05725.svg b/addon/kanjivg-supplementary/05725.svg new file mode 100644 index 0000000..0f5af6a --- /dev/null +++ b/addon/kanjivg-supplementary/05725.svg @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/058f4.svg b/addon/kanjivg-supplementary/058f4.svg new file mode 100644 index 0000000..acc5868 --- /dev/null +++ b/addon/kanjivg-supplementary/058f4.svg @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/0590b.svg b/addon/kanjivg-supplementary/0590b.svg new file mode 100644 index 0000000..d5558a6 --- /dev/null +++ b/addon/kanjivg-supplementary/0590b.svg @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05917.svg b/addon/kanjivg-supplementary/05917.svg new file mode 100644 index 0000000..b3f9f04 --- /dev/null +++ b/addon/kanjivg-supplementary/05917.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05939.svg b/addon/kanjivg-supplementary/05939.svg new file mode 100644 index 0000000..8facfaf --- /dev/null +++ b/addon/kanjivg-supplementary/05939.svg @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05c1e.svg b/addon/kanjivg-supplementary/05c1e.svg new file mode 100644 index 0000000..cd4b4dd --- /dev/null +++ b/addon/kanjivg-supplementary/05c1e.svg @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05c70.svg b/addon/kanjivg-supplementary/05c70.svg new file mode 100644 index 0000000..4309b6a --- /dev/null +++ b/addon/kanjivg-supplementary/05c70.svg @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/05f00.svg b/addon/kanjivg-supplementary/05f00.svg new file mode 100644 index 0000000..7d96be4 --- /dev/null +++ b/addon/kanjivg-supplementary/05f00.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/06c10.svg b/addon/kanjivg-supplementary/06c10.svg new file mode 100644 index 0000000..f962456 --- /dev/null +++ b/addon/kanjivg-supplementary/06c10.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/07ca6.svg b/addon/kanjivg-supplementary/07ca6.svg new file mode 100644 index 0000000..a816325 --- /dev/null +++ b/addon/kanjivg-supplementary/07ca6.svg @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/08080.svg b/addon/kanjivg-supplementary/08080.svg new file mode 100644 index 0000000..ea2c1b1 --- /dev/null +++ b/addon/kanjivg-supplementary/08080.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/08204.svg b/addon/kanjivg-supplementary/08204.svg new file mode 100644 index 0000000..d1dab05 --- /dev/null +++ b/addon/kanjivg-supplementary/08204.svg @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/096ba.svg b/addon/kanjivg-supplementary/096ba.svg new file mode 100644 index 0000000..6da08bc --- /dev/null +++ b/addon/kanjivg-supplementary/096ba.svg @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/09fb6.svg b/addon/kanjivg-supplementary/09fb6.svg new file mode 100644 index 0000000..a360aff --- /dev/null +++ b/addon/kanjivg-supplementary/09fb6.svg @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/09fb7.svg b/addon/kanjivg-supplementary/09fb7.svg new file mode 100644 index 0000000..d22caea --- /dev/null +++ b/addon/kanjivg-supplementary/09fb7.svg @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/20087.svg b/addon/kanjivg-supplementary/20087.svg new file mode 100644 index 0000000..aa989dd --- /dev/null +++ b/addon/kanjivg-supplementary/20087.svg @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/20089.svg b/addon/kanjivg-supplementary/20089.svg new file mode 100644 index 0000000..9c17b09 --- /dev/null +++ b/addon/kanjivg-supplementary/20089.svg @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/2099d.svg b/addon/kanjivg-supplementary/2099d.svg new file mode 100644 index 0000000..00aca22 --- /dev/null +++ b/addon/kanjivg-supplementary/2099d.svg @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/20ad3.svg b/addon/kanjivg-supplementary/20ad3.svg new file mode 100644 index 0000000..6eddc6e --- /dev/null +++ b/addon/kanjivg-supplementary/20ad3.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/215d7.svg b/addon/kanjivg-supplementary/215d7.svg new file mode 100644 index 0000000..56f814f --- /dev/null +++ b/addon/kanjivg-supplementary/215d7.svg @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/2298f.svg b/addon/kanjivg-supplementary/2298f.svg new file mode 100644 index 0000000..1df5cb6 --- /dev/null +++ b/addon/kanjivg-supplementary/2298f.svg @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/26c29.svg b/addon/kanjivg-supplementary/26c29.svg new file mode 100644 index 0000000..61cc770 --- /dev/null +++ b/addon/kanjivg-supplementary/26c29.svg @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/27607.svg b/addon/kanjivg-supplementary/27607.svg new file mode 100644 index 0000000..dd8902a --- /dev/null +++ b/addon/kanjivg-supplementary/27607.svg @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/apron.svg b/addon/kanjivg-supplementary/apron.svg new file mode 100644 index 0000000..c639945 --- /dev/null +++ b/addon/kanjivg-supplementary/apron.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/arm.svg b/addon/kanjivg-supplementary/arm.svg new file mode 100644 index 0000000..6da8132 --- /dev/null +++ b/addon/kanjivg-supplementary/arm.svg @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/banner.svg b/addon/kanjivg-supplementary/banner.svg new file mode 100644 index 0000000..e04679e --- /dev/null +++ b/addon/kanjivg-supplementary/banner.svg @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/birdhouse.svg b/addon/kanjivg-supplementary/birdhouse.svg new file mode 100644 index 0000000..267dbfb --- /dev/null +++ b/addon/kanjivg-supplementary/birdhouse.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/butchers.svg b/addon/kanjivg-supplementary/butchers.svg new file mode 100644 index 0000000..76b7045 --- /dev/null +++ b/addon/kanjivg-supplementary/butchers.svg @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/cabbage.svg b/addon/kanjivg-supplementary/cabbage.svg new file mode 100644 index 0000000..9541d38 --- /dev/null +++ b/addon/kanjivg-supplementary/cabbage.svg @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/caverns.svg b/addon/kanjivg-supplementary/caverns.svg new file mode 100644 index 0000000..4a79e54 --- /dev/null +++ b/addon/kanjivg-supplementary/caverns.svg @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/celery.svg b/addon/kanjivg-supplementary/celery.svg new file mode 100644 index 0000000..bd5e5d6 --- /dev/null +++ b/addon/kanjivg-supplementary/celery.svg @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/condor.svg b/addon/kanjivg-supplementary/condor.svg new file mode 100644 index 0000000..f75ab1a --- /dev/null +++ b/addon/kanjivg-supplementary/condor.svg @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/cornstalk.svg b/addon/kanjivg-supplementary/cornstalk.svg new file mode 100644 index 0000000..b56e2ff --- /dev/null +++ b/addon/kanjivg-supplementary/cornstalk.svg @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/fenceposts.svg b/addon/kanjivg-supplementary/fenceposts.svg new file mode 100644 index 0000000..d8998da --- /dev/null +++ b/addon/kanjivg-supplementary/fenceposts.svg @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/hairpin.svg b/addon/kanjivg-supplementary/hairpin.svg new file mode 100644 index 0000000..eac5be0 --- /dev/null +++ b/addon/kanjivg-supplementary/hairpin.svg @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/i_ching.svg b/addon/kanjivg-supplementary/i_ching.svg new file mode 100644 index 0000000..8015aeb --- /dev/null +++ b/addon/kanjivg-supplementary/i_ching.svg @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/lidded_crock.svg b/addon/kanjivg-supplementary/lidded_crock.svg new file mode 100644 index 0000000..8bc1376 --- /dev/null +++ b/addon/kanjivg-supplementary/lidded_crock.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/mending.svg b/addon/kanjivg-supplementary/mending.svg new file mode 100644 index 0000000..03a7e41 --- /dev/null +++ b/addon/kanjivg-supplementary/mending.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/oaken_tub.svg b/addon/kanjivg-supplementary/oaken_tub.svg new file mode 100644 index 0000000..cb08ba5 --- /dev/null +++ b/addon/kanjivg-supplementary/oaken_tub.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/outhouse.svg b/addon/kanjivg-supplementary/outhouse.svg new file mode 100644 index 0000000..6ac9f80 --- /dev/null +++ b/addon/kanjivg-supplementary/outhouse.svg @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/pegasus.svg b/addon/kanjivg-supplementary/pegasus.svg new file mode 100644 index 0000000..7412435 --- /dev/null +++ b/addon/kanjivg-supplementary/pegasus.svg @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/piglets.svg b/addon/kanjivg-supplementary/piglets.svg new file mode 100644 index 0000000..7c35982 --- /dev/null +++ b/addon/kanjivg-supplementary/piglets.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/plow.svg b/addon/kanjivg-supplementary/plow.svg new file mode 100644 index 0000000..cbff524 --- /dev/null +++ b/addon/kanjivg-supplementary/plow.svg @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/purse.svg b/addon/kanjivg-supplementary/purse.svg new file mode 100644 index 0000000..cca1049 --- /dev/null +++ b/addon/kanjivg-supplementary/purse.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/quarter.svg b/addon/kanjivg-supplementary/quarter.svg new file mode 100644 index 0000000..3971afa --- /dev/null +++ b/addon/kanjivg-supplementary/quarter.svg @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/quiver.svg b/addon/kanjivg-supplementary/quiver.svg new file mode 100644 index 0000000..f5ce31a --- /dev/null +++ b/addon/kanjivg-supplementary/quiver.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/rags.svg b/addon/kanjivg-supplementary/rags.svg new file mode 100644 index 0000000..1d864b3 --- /dev/null +++ b/addon/kanjivg-supplementary/rags.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/receipt.svg b/addon/kanjivg-supplementary/receipt.svg new file mode 100644 index 0000000..7b941a4 --- /dev/null +++ b/addon/kanjivg-supplementary/receipt.svg @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/schoolhouse.svg b/addon/kanjivg-supplementary/schoolhouse.svg new file mode 100644 index 0000000..f08bb7b --- /dev/null +++ b/addon/kanjivg-supplementary/schoolhouse.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/siesta.svg b/addon/kanjivg-supplementary/siesta.svg new file mode 100644 index 0000000..446bf05 --- /dev/null +++ b/addon/kanjivg-supplementary/siesta.svg @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/silage.svg b/addon/kanjivg-supplementary/silage.svg new file mode 100644 index 0000000..ba6f46f --- /dev/null +++ b/addon/kanjivg-supplementary/silage.svg @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/slingshot.svg b/addon/kanjivg-supplementary/slingshot.svg new file mode 100644 index 0000000..23261cd --- /dev/null +++ b/addon/kanjivg-supplementary/slingshot.svg @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/sparkler.svg b/addon/kanjivg-supplementary/sparkler.svg new file mode 100644 index 0000000..51dcd03 --- /dev/null +++ b/addon/kanjivg-supplementary/sparkler.svg @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/spear.svg b/addon/kanjivg-supplementary/spear.svg new file mode 100644 index 0000000..c271db3 --- /dev/null +++ b/addon/kanjivg-supplementary/spear.svg @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/staple_gun.svg b/addon/kanjivg-supplementary/staple_gun.svg new file mode 100644 index 0000000..25bb148 --- /dev/null +++ b/addon/kanjivg-supplementary/staple_gun.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/staples.svg b/addon/kanjivg-supplementary/staples.svg new file mode 100644 index 0000000..19e9b89 --- /dev/null +++ b/addon/kanjivg-supplementary/staples.svg @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/tail_feathers.svg b/addon/kanjivg-supplementary/tail_feathers.svg new file mode 100644 index 0000000..ea74ee4 --- /dev/null +++ b/addon/kanjivg-supplementary/tail_feathers.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/tool.svg b/addon/kanjivg-supplementary/tool.svg new file mode 100644 index 0000000..6bafed0 --- /dev/null +++ b/addon/kanjivg-supplementary/tool.svg @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/addon/kanjivg-supplementary/wall.svg b/addon/kanjivg-supplementary/wall.svg new file mode 100644 index 0000000..ec10cad --- /dev/null +++ b/addon/kanjivg-supplementary/wall.svg @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/addon/lookup_window.py b/addon/lookup_window.py index 26aebe7..21af3b6 100644 --- a/addon/lookup_window.py +++ b/addon/lookup_window.py @@ -19,6 +19,9 @@ class LookupWindow(QDialog): instance = None kanjivg_uri = util.addon_web_base + "/kanjivg/" + kanjivg_supplementary_uri = util.addon_web_base + "/kanjivg-supplementary/" + primitives_uri = util.addon_web_base + "/primitives/" + cursive_primitives_uri = util.addon_web_base + "/primitives/cursive/" @classmethod def web_uri(cls, name): @@ -88,9 +91,13 @@ def __init__(self, parent=None): f'' f'' f'' + f'' + f'' + f'' f'' f'' f'' + f'' "" ) common_back = ( diff --git a/addon/primitives/apron.svg b/addon/primitives/apron.svg new file mode 100644 index 0000000..41e3121 --- /dev/null +++ b/addon/primitives/apron.svg @@ -0,0 +1,19 @@ + + + diff --git a/addon/primitives/arm.svg b/addon/primitives/arm.svg new file mode 100644 index 0000000..452276d --- /dev/null +++ b/addon/primitives/arm.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/banner.svg b/addon/primitives/banner.svg new file mode 100644 index 0000000..b984713 --- /dev/null +++ b/addon/primitives/banner.svg @@ -0,0 +1,22 @@ + + + diff --git a/addon/primitives/birdhouse.svg b/addon/primitives/birdhouse.svg new file mode 100644 index 0000000..8ea78c3 --- /dev/null +++ b/addon/primitives/birdhouse.svg @@ -0,0 +1,22 @@ + + + diff --git a/addon/primitives/box-small.svg b/addon/primitives/box-small.svg new file mode 100644 index 0000000..0101e35 --- /dev/null +++ b/addon/primitives/box-small.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/brush-top.svg b/addon/primitives/brush-top.svg new file mode 100644 index 0000000..f857ef9 --- /dev/null +++ b/addon/primitives/brush-top.svg @@ -0,0 +1,25 @@ + + + diff --git a/addon/primitives/bucket_of_eels.svg b/addon/primitives/bucket_of_eels.svg new file mode 100644 index 0000000..f6d0b79 --- /dev/null +++ b/addon/primitives/bucket_of_eels.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/bushes-side.svg b/addon/primitives/bushes-side.svg new file mode 100644 index 0000000..3e51e4b --- /dev/null +++ b/addon/primitives/bushes-side.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/butchers.svg b/addon/primitives/butchers.svg new file mode 100644 index 0000000..18e2895 --- /dev/null +++ b/addon/primitives/butchers.svg @@ -0,0 +1,25 @@ + + + diff --git a/addon/primitives/cabbage.svg b/addon/primitives/cabbage.svg new file mode 100644 index 0000000..5b60d90 --- /dev/null +++ b/addon/primitives/cabbage.svg @@ -0,0 +1,23 @@ + + + diff --git a/addon/primitives/caverns.svg b/addon/primitives/caverns.svg new file mode 100644 index 0000000..96a55f9 --- /dev/null +++ b/addon/primitives/caverns.svg @@ -0,0 +1,19 @@ + + + diff --git a/addon/primitives/celery.svg b/addon/primitives/celery.svg new file mode 100644 index 0000000..8da1a7b --- /dev/null +++ b/addon/primitives/celery.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/condor.svg b/addon/primitives/condor.svg new file mode 100644 index 0000000..55739d5 --- /dev/null +++ b/addon/primitives/condor.svg @@ -0,0 +1,27 @@ + + + diff --git a/addon/primitives/cornstalk.svg b/addon/primitives/cornstalk.svg new file mode 100644 index 0000000..026d732 --- /dev/null +++ b/addon/primitives/cornstalk.svg @@ -0,0 +1,15 @@ + + + diff --git a/addon/primitives/cursive/apron.svg b/addon/primitives/cursive/apron.svg new file mode 100644 index 0000000..46b0a23 --- /dev/null +++ b/addon/primitives/cursive/apron.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/arm.svg b/addon/primitives/cursive/arm.svg new file mode 100644 index 0000000..052be8d --- /dev/null +++ b/addon/primitives/cursive/arm.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/banner.svg b/addon/primitives/cursive/banner.svg new file mode 100644 index 0000000..3fb173c --- /dev/null +++ b/addon/primitives/cursive/banner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/birdhouse.svg b/addon/primitives/cursive/birdhouse.svg new file mode 100644 index 0000000..6140fa8 --- /dev/null +++ b/addon/primitives/cursive/birdhouse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/butchers.svg b/addon/primitives/cursive/butchers.svg new file mode 100644 index 0000000..9e6362b --- /dev/null +++ b/addon/primitives/cursive/butchers.svg @@ -0,0 +1,45 @@ + + + diff --git a/addon/primitives/cursive/cabbage.svg b/addon/primitives/cursive/cabbage.svg new file mode 100644 index 0000000..014e188 --- /dev/null +++ b/addon/primitives/cursive/cabbage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/caverns.svg b/addon/primitives/cursive/caverns.svg new file mode 100644 index 0000000..96246d8 --- /dev/null +++ b/addon/primitives/cursive/caverns.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/celery.svg b/addon/primitives/cursive/celery.svg new file mode 100644 index 0000000..599b647 --- /dev/null +++ b/addon/primitives/cursive/celery.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/condor.svg b/addon/primitives/cursive/condor.svg new file mode 100644 index 0000000..a23d6e3 --- /dev/null +++ b/addon/primitives/cursive/condor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/cornstalk.svg b/addon/primitives/cursive/cornstalk.svg new file mode 100644 index 0000000..01df3a0 --- /dev/null +++ b/addon/primitives/cursive/cornstalk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/fenceposts.svg b/addon/primitives/cursive/fenceposts.svg new file mode 100644 index 0000000..bbaddb6 --- /dev/null +++ b/addon/primitives/cursive/fenceposts.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/futon.svg b/addon/primitives/cursive/futon.svg new file mode 100644 index 0000000..da4ba62 --- /dev/null +++ b/addon/primitives/cursive/futon.svg @@ -0,0 +1,45 @@ + + + diff --git a/addon/primitives/cursive/hair.svg b/addon/primitives/cursive/hair.svg new file mode 100644 index 0000000..c54fe90 --- /dev/null +++ b/addon/primitives/cursive/hair.svg @@ -0,0 +1,23 @@ + + + diff --git a/addon/primitives/cursive/hairpin.svg b/addon/primitives/cursive/hairpin.svg new file mode 100644 index 0000000..9ab56b5 --- /dev/null +++ b/addon/primitives/cursive/hairpin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/i_ching.svg b/addon/primitives/cursive/i_ching.svg new file mode 100644 index 0000000..cfe7b8b --- /dev/null +++ b/addon/primitives/cursive/i_ching.svg @@ -0,0 +1,23 @@ + + + diff --git a/addon/primitives/cursive/lidded_crock.svg b/addon/primitives/cursive/lidded_crock.svg new file mode 100644 index 0000000..a1d04be --- /dev/null +++ b/addon/primitives/cursive/lidded_crock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/mending.svg b/addon/primitives/cursive/mending.svg new file mode 100644 index 0000000..7af1d4b --- /dev/null +++ b/addon/primitives/cursive/mending.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/oaken_tub.svg b/addon/primitives/cursive/oaken_tub.svg new file mode 100644 index 0000000..6a75685 --- /dev/null +++ b/addon/primitives/cursive/oaken_tub.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/outhouse.svg b/addon/primitives/cursive/outhouse.svg new file mode 100644 index 0000000..49ffcc9 --- /dev/null +++ b/addon/primitives/cursive/outhouse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/pegasus.svg b/addon/primitives/cursive/pegasus.svg new file mode 100644 index 0000000..b694111 --- /dev/null +++ b/addon/primitives/cursive/pegasus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/piglets.svg b/addon/primitives/cursive/piglets.svg new file mode 100644 index 0000000..128ea2c --- /dev/null +++ b/addon/primitives/cursive/piglets.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/plow.svg b/addon/primitives/cursive/plow.svg new file mode 100644 index 0000000..479e3a9 --- /dev/null +++ b/addon/primitives/cursive/plow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/purse.svg b/addon/primitives/cursive/purse.svg new file mode 100644 index 0000000..2448b1e --- /dev/null +++ b/addon/primitives/cursive/purse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/quarter.svg b/addon/primitives/cursive/quarter.svg new file mode 100644 index 0000000..7c6c7c2 --- /dev/null +++ b/addon/primitives/cursive/quarter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/quiver.svg b/addon/primitives/cursive/quiver.svg new file mode 100644 index 0000000..0b226b9 --- /dev/null +++ b/addon/primitives/cursive/quiver.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/rags.svg b/addon/primitives/cursive/rags.svg new file mode 100644 index 0000000..685c179 --- /dev/null +++ b/addon/primitives/cursive/rags.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/receipt.svg b/addon/primitives/cursive/receipt.svg new file mode 100644 index 0000000..eb2ad65 --- /dev/null +++ b/addon/primitives/cursive/receipt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/schoolhouse.svg b/addon/primitives/cursive/schoolhouse.svg new file mode 100644 index 0000000..22351eb --- /dev/null +++ b/addon/primitives/cursive/schoolhouse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/siesta.svg b/addon/primitives/cursive/siesta.svg new file mode 100644 index 0000000..23c797b --- /dev/null +++ b/addon/primitives/cursive/siesta.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/silage.svg b/addon/primitives/cursive/silage.svg new file mode 100644 index 0000000..6af32ae --- /dev/null +++ b/addon/primitives/cursive/silage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/slingshot.svg b/addon/primitives/cursive/slingshot.svg new file mode 100644 index 0000000..75331d5 --- /dev/null +++ b/addon/primitives/cursive/slingshot.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/sparkler.svg b/addon/primitives/cursive/sparkler.svg new file mode 100644 index 0000000..f2ac43a --- /dev/null +++ b/addon/primitives/cursive/sparkler.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/spear.svg b/addon/primitives/cursive/spear.svg new file mode 100644 index 0000000..f96f345 --- /dev/null +++ b/addon/primitives/cursive/spear.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/staple_gun.svg b/addon/primitives/cursive/staple_gun.svg new file mode 100644 index 0000000..9ba621b --- /dev/null +++ b/addon/primitives/cursive/staple_gun.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/staples.svg b/addon/primitives/cursive/staples.svg new file mode 100644 index 0000000..a5d4c59 --- /dev/null +++ b/addon/primitives/cursive/staples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/tail_feathers.svg b/addon/primitives/cursive/tail_feathers.svg new file mode 100644 index 0000000..e19f562 --- /dev/null +++ b/addon/primitives/cursive/tail_feathers.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/tool.svg b/addon/primitives/cursive/tool.svg new file mode 100644 index 0000000..9718180 --- /dev/null +++ b/addon/primitives/cursive/tool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/cursive/wall.svg b/addon/primitives/cursive/wall.svg new file mode 100644 index 0000000..adf3b4e --- /dev/null +++ b/addon/primitives/cursive/wall.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/deer-abbreviated.svg b/addon/primitives/deer-abbreviated.svg new file mode 100644 index 0000000..2563df2 --- /dev/null +++ b/addon/primitives/deer-abbreviated.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/dollar_sign-below.svg b/addon/primitives/dollar_sign-below.svg new file mode 100644 index 0000000..229fc7c --- /dev/null +++ b/addon/primitives/dollar_sign-below.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/drag-bottom.svg b/addon/primitives/drag-bottom.svg new file mode 100644 index 0000000..946a385 --- /dev/null +++ b/addon/primitives/drag-bottom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/eel.svg b/addon/primitives/eel.svg new file mode 100644 index 0000000..d5f13aa --- /dev/null +++ b/addon/primitives/eel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/fenceposts.svg b/addon/primitives/fenceposts.svg new file mode 100644 index 0000000..27c1902 --- /dev/null +++ b/addon/primitives/fenceposts.svg @@ -0,0 +1,16 @@ + + + diff --git a/addon/primitives/flood-bottom.svg b/addon/primitives/flood-bottom.svg new file mode 100644 index 0000000..128cf4e --- /dev/null +++ b/addon/primitives/flood-bottom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/futon.svg b/addon/primitives/futon.svg new file mode 100644 index 0000000..89e07e0 --- /dev/null +++ b/addon/primitives/futon.svg @@ -0,0 +1,29 @@ + + + diff --git a/addon/primitives/genie_in_the_bottle.svg b/addon/primitives/genie_in_the_bottle.svg new file mode 100644 index 0000000..da43df6 --- /dev/null +++ b/addon/primitives/genie_in_the_bottle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/go_in.svg b/addon/primitives/go_in.svg new file mode 100644 index 0000000..301c482 --- /dev/null +++ b/addon/primitives/go_in.svg @@ -0,0 +1,17 @@ + + + diff --git a/addon/primitives/hairpin.svg b/addon/primitives/hairpin.svg new file mode 100644 index 0000000..ac74366 --- /dev/null +++ b/addon/primitives/hairpin.svg @@ -0,0 +1,19 @@ + + + diff --git a/addon/primitives/halo.svg b/addon/primitives/halo.svg new file mode 100644 index 0000000..f83b653 --- /dev/null +++ b/addon/primitives/halo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/i_ching.svg b/addon/primitives/i_ching.svg new file mode 100644 index 0000000..d5e3781 --- /dev/null +++ b/addon/primitives/i_ching.svg @@ -0,0 +1,15 @@ + + + diff --git a/addon/primitives/in_a_row_upside_down.svg b/addon/primitives/in_a_row_upside_down.svg new file mode 100644 index 0000000..7bbd8e9 --- /dev/null +++ b/addon/primitives/in_a_row_upside_down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/lidded_crock.svg b/addon/primitives/lidded_crock.svg new file mode 100644 index 0000000..31501d4 --- /dev/null +++ b/addon/primitives/lidded_crock.svg @@ -0,0 +1,17 @@ + + + diff --git a/addon/primitives/mama-top.svg b/addon/primitives/mama-top.svg new file mode 100644 index 0000000..a1353b7 --- /dev/null +++ b/addon/primitives/mama-top.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/mane.svg b/addon/primitives/mane.svg new file mode 100644 index 0000000..55b0e6e --- /dev/null +++ b/addon/primitives/mane.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/meeting.svg b/addon/primitives/meeting.svg new file mode 100644 index 0000000..077f8d4 --- /dev/null +++ b/addon/primitives/meeting.svg @@ -0,0 +1,16 @@ + + + diff --git a/addon/primitives/mending.svg b/addon/primitives/mending.svg new file mode 100644 index 0000000..8832d1f --- /dev/null +++ b/addon/primitives/mending.svg @@ -0,0 +1,19 @@ + + + diff --git a/addon/primitives/oaken_tub.svg b/addon/primitives/oaken_tub.svg new file mode 100644 index 0000000..1638b80 --- /dev/null +++ b/addon/primitives/oaken_tub.svg @@ -0,0 +1,19 @@ + + + diff --git a/addon/primitives/outhouse.svg b/addon/primitives/outhouse.svg new file mode 100644 index 0000000..e6a52c2 --- /dev/null +++ b/addon/primitives/outhouse.svg @@ -0,0 +1,22 @@ + + + diff --git a/addon/primitives/pegasus.svg b/addon/primitives/pegasus.svg new file mode 100644 index 0000000..46d0704 --- /dev/null +++ b/addon/primitives/pegasus.svg @@ -0,0 +1,26 @@ + + + diff --git a/addon/primitives/piglets.svg b/addon/primitives/piglets.svg new file mode 100644 index 0000000..b22fc91 --- /dev/null +++ b/addon/primitives/piglets.svg @@ -0,0 +1,24 @@ + + + diff --git a/addon/primitives/plow.svg b/addon/primitives/plow.svg new file mode 100644 index 0000000..c54e8af --- /dev/null +++ b/addon/primitives/plow.svg @@ -0,0 +1,14 @@ + + + diff --git a/addon/primitives/purse.svg b/addon/primitives/purse.svg new file mode 100644 index 0000000..12fc70f --- /dev/null +++ b/addon/primitives/purse.svg @@ -0,0 +1,18 @@ + + + + diff --git a/addon/primitives/quarter.svg b/addon/primitives/quarter.svg new file mode 100644 index 0000000..578a4ab --- /dev/null +++ b/addon/primitives/quarter.svg @@ -0,0 +1,25 @@ + + + diff --git a/addon/primitives/quiver.svg b/addon/primitives/quiver.svg new file mode 100644 index 0000000..868b736 --- /dev/null +++ b/addon/primitives/quiver.svg @@ -0,0 +1,20 @@ + + + diff --git a/addon/primitives/rags.svg b/addon/primitives/rags.svg new file mode 100644 index 0000000..bb3e504 --- /dev/null +++ b/addon/primitives/rags.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/receipt-left.svg b/addon/primitives/receipt-left.svg new file mode 100644 index 0000000..facc092 --- /dev/null +++ b/addon/primitives/receipt-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/receipt.svg b/addon/primitives/receipt.svg new file mode 100644 index 0000000..96c1f9d --- /dev/null +++ b/addon/primitives/receipt.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/row-bottom.svg b/addon/primitives/row-bottom.svg new file mode 100644 index 0000000..31381a3 --- /dev/null +++ b/addon/primitives/row-bottom.svg @@ -0,0 +1,23 @@ + + + diff --git a/addon/primitives/scarf-unhooked.svg b/addon/primitives/scarf-unhooked.svg new file mode 100644 index 0000000..b217040 --- /dev/null +++ b/addon/primitives/scarf-unhooked.svg @@ -0,0 +1,17 @@ + + + diff --git a/addon/primitives/schoolhouse.svg b/addon/primitives/schoolhouse.svg new file mode 100644 index 0000000..9c13f78 --- /dev/null +++ b/addon/primitives/schoolhouse.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/siesta.svg b/addon/primitives/siesta.svg new file mode 100644 index 0000000..2b103e8 --- /dev/null +++ b/addon/primitives/siesta.svg @@ -0,0 +1,25 @@ + + + diff --git a/addon/primitives/silage.svg b/addon/primitives/silage.svg new file mode 100644 index 0000000..9504548 --- /dev/null +++ b/addon/primitives/silage.svg @@ -0,0 +1,19 @@ + + + diff --git a/addon/primitives/silver-left.svg b/addon/primitives/silver-left.svg new file mode 100644 index 0000000..57a9df3 --- /dev/null +++ b/addon/primitives/silver-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/slingshot.svg b/addon/primitives/slingshot.svg new file mode 100644 index 0000000..c6859e1 --- /dev/null +++ b/addon/primitives/slingshot.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/sparkler.svg b/addon/primitives/sparkler.svg new file mode 100644 index 0000000..fe0caff --- /dev/null +++ b/addon/primitives/sparkler.svg @@ -0,0 +1,21 @@ + + + diff --git a/addon/primitives/spear.svg b/addon/primitives/spear.svg new file mode 100644 index 0000000..b83cc79 --- /dev/null +++ b/addon/primitives/spear.svg @@ -0,0 +1,16 @@ + + + diff --git a/addon/primitives/spring-small.svg b/addon/primitives/spring-small.svg new file mode 100644 index 0000000..4dd459d --- /dev/null +++ b/addon/primitives/spring-small.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/staple_gun.svg b/addon/primitives/staple_gun.svg new file mode 100644 index 0000000..925dbf1 --- /dev/null +++ b/addon/primitives/staple_gun.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/staples.svg b/addon/primitives/staples.svg new file mode 100644 index 0000000..a48f0b8 --- /dev/null +++ b/addon/primitives/staples.svg @@ -0,0 +1,15 @@ + + + diff --git a/addon/primitives/tail_feathers.svg b/addon/primitives/tail_feathers.svg new file mode 100644 index 0000000..afdc468 --- /dev/null +++ b/addon/primitives/tail_feathers.svg @@ -0,0 +1,24 @@ + + + diff --git a/addon/primitives/tall.svg b/addon/primitives/tall.svg new file mode 100644 index 0000000..3340dce --- /dev/null +++ b/addon/primitives/tall.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/tool.svg b/addon/primitives/tool.svg new file mode 100644 index 0000000..fa32e65 --- /dev/null +++ b/addon/primitives/tool.svg @@ -0,0 +1,18 @@ + + + diff --git a/addon/primitives/top_hat_and_scarf.svg b/addon/primitives/top_hat_and_scarf.svg new file mode 100644 index 0000000..8a18352 --- /dev/null +++ b/addon/primitives/top_hat_and_scarf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/primitives/wall.svg b/addon/primitives/wall.svg new file mode 100644 index 0000000..ae03927 --- /dev/null +++ b/addon/primitives/wall.svg @@ -0,0 +1,17 @@ + + + diff --git a/addon/stats_window.py b/addon/stats_window.py index a512739..78ad293 100644 --- a/addon/stats_window.py +++ b/addon/stats_window.py @@ -403,6 +403,10 @@ def refresh(self): class_ = "known" category_good += 1 + if kanji[0] == "[": + img = kanji[1:-1] + path = util.addon_web_uri('primitives','%s.svg' % img) + kanji = f'' entry_pts.append(f'' + kanji + "") category_count = len(entries) diff --git a/addon/util.py b/addon/util.py index 86a3dff..6080bc4 100644 --- a/addon/util.py +++ b/addon/util.py @@ -2,6 +2,7 @@ import sys import re from collections import OrderedDict +import re import anki import aqt @@ -57,14 +58,24 @@ def make_icon(*file_parts): def default_icon(): return make_icon("migaku.png") +# Creates a list of single-character Unicode kanjis and [primitive] tags +# For example '[banner]也' -> ['\[banner\]','也'] +def custom_list(l): + g = re.findall(r'([^\[]|\[[^\]]+\])',l) + return g def unique_characters(string): - return list(OrderedDict((c, True) for c in string).keys()) - + l = custom_list(string) + return list(OrderedDict((c, True) for c in l).keys()) import aqt from aqt.qt import * +def get_pixmap_from_tag(kanji, size): + img = kanji[1:-1] + path = addon_path('primitives','%s.svg' % img) + pixmap = QIcon(path).pixmap(QSize(size,size)) + return pixmap def log(*args): print("[Migaku Kanji]", *args) diff --git a/addon/web/back-production.html b/addon/web/back-production.html index 51f0e19..d3337c1 100644 --- a/addon/web/back-production.html +++ b/addon/web/back-production.html @@ -36,10 +36,10 @@