From 728730de2e0069947b2d3614f23c42fd99fa069c Mon Sep 17 00:00:00 2001 From: Bryce Allen Date: Thu, 3 Dec 2015 20:21:00 -0600 Subject: [PATCH] refactor layout, add jp sort pages, data update --- bin/mkmobilelist.py | 169 ++++++++--- bin/parse-wikia-monsters.py | 9 +- bin/parse-wikia-skills.py | 53 ++++ db/mhx_monster_list.json | 200 +++++++++--- db/mhx_skill_tree_list.json | 586 ++++++++++++++++++++++++++++++++++++ web/translate/index.html | 228 +++++++------- 6 files changed, 1034 insertions(+), 211 deletions(-) create mode 100755 bin/parse-wikia-skills.py create mode 100644 db/mhx_skill_tree_list.json diff --git a/bin/mkmobilelist.py b/bin/mkmobilelist.py index 78c45c9..4ae1a2e 100755 --- a/bin/mkmobilelist.py +++ b/bin/mkmobilelist.py @@ -3,6 +3,7 @@ import sys import json import os.path +import types import _pathfix @@ -10,67 +11,65 @@ from mhapi.db import MHDB from mhapi.util import get_utf8_writer -def print_header_nav(current_page_id): - pages = [("page-skilltrees", "Skill Trees"), - ("page-items", "Items"), - ("page-gather", "Gather"), - ("page-carve", "Carve"), - ("page-hunterarts", "Hunter Arts"), - ("page-monsters", "Monsters")] +def print_header_nav(title, pid): print """ -
-
-
    -""".strip("\n") - for page_id, page_name in pages: - if current_page_id == page_id: - print """ -
  • %s
  • -""".strip("\n") % (page_id, page_name) - else: - print """ -
  • %s
  • -""".strip("\n") % (page_id, page_name) - print """ -
-
-
-""".strip("\n") +
+ Home +

%s

+""".strip() % title + + alt_pid = None + if pid.endswith("-en"): + alt_pid = pid.replace("-en", "-jp") + alt_title = "jp" + if pid.endswith("-jp"): + alt_pid = pid.replace("-jp", "-en") + alt_title = "en" + if alt_pid is not None: + print """ + %s +""".strip() % (alt_pid, alt_title) -def mk_html_list(dict_list, keys, sort_keys, divider_fn=None): - if divider_fn is None: + print "
" + + +def mk_html_list(dict_list, keys, sort_keys, divider_fn="auto"): + if divider_fn == "auto": print ('