update mhx monster list, reorg jqui mobile site
This commit is contained in:
@@ -36,10 +36,10 @@ def print_header_nav(title, pid):
|
||||
|
||||
def mk_html_list(dict_list, keys, sort_keys, divider_fn="auto"):
|
||||
if divider_fn == "auto":
|
||||
print ('<ul data-role="listview" data-filter="true"'
|
||||
print ('<ul data-role="listview" data-filter="false"'
|
||||
' data-autodividers="true">')
|
||||
else:
|
||||
print '<ul data-role="listview" data-filter="true">'
|
||||
print '<ul data-role="listview" data-filter="false">'
|
||||
|
||||
if isinstance(sort_keys, types.FunctionType):
|
||||
sort_fn = sort_keys
|
||||
|
||||
@@ -38,7 +38,7 @@ MONSTER_RE = re.compile(
|
||||
|
||||
JAPANESE_NAME_STR = '<h3 class="pi-data-label pi-secondary-font">Japanese:</h3>'
|
||||
JAPANESE_NAME_RE = re.compile(
|
||||
'<div class="pi-data-value pi-font">([^<]*)')
|
||||
'<div class="pi-data-value pi-font">(.*)</div>')
|
||||
|
||||
|
||||
def parse_wikia_monsters(f):
|
||||
@@ -83,12 +83,24 @@ def get_jp_names(monster_path):
|
||||
line = lines.pop(0).strip()
|
||||
m = JAPANESE_NAME_RE.match(line)
|
||||
assert m, "No match: " + line
|
||||
names.append(m.group(1))
|
||||
names.append(parse_japanese_name(m.group(1)))
|
||||
if len(names) == 2:
|
||||
break
|
||||
return names
|
||||
|
||||
|
||||
def parse_japanese_name(div_contents):
|
||||
parts = div_contents.split("<br />")
|
||||
if len(parts) == 1:
|
||||
return parts[0]
|
||||
assert len(parts) == 2
|
||||
# Remobra has different titles in 2nd and 4th gen, parse from
|
||||
# second part and remove the paren part
|
||||
if parts[1].endswith("(4th Gen)"):
|
||||
return parts[1][:-len("(4th Gen)")]
|
||||
return parts[0]
|
||||
|
||||
|
||||
def _main():
|
||||
with open(sys.argv[1]) as f:
|
||||
monster_list = parse_wikia_monsters(f)
|
||||
|
||||
@@ -59,12 +59,6 @@
|
||||
"name": "Spearbreaker Daimyo Hermitaur",
|
||||
"name_jp": "\u77db\u7815\u30c0\u30a4\u30df\u30e7\u30a6\u30b6\u30b6\u30df"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u6050\u66b4\u7adc",
|
||||
"href": "/wiki/Deviljho",
|
||||
"name": "Deviljho",
|
||||
"name_jp": "\u30a4\u30d3\u30eb\u30b8\u30e7\u30fc"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u65ac\u7adc",
|
||||
"href": "/wiki/Dinovaldo",
|
||||
@@ -299,6 +293,12 @@
|
||||
"name": "Ukanlos",
|
||||
"name_jp": "\u30a6\u30ab\u30e0\u30eb\u30d0\u30b9"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u7206\u939a\u7adc",
|
||||
"href": "/wiki/Uragaan",
|
||||
"name": "Uragaan",
|
||||
"name_jp": "\u30a6\u30e9\u30ac\u30f3\u30ad\u30f3"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u5b9d\u7e8f",
|
||||
"href": "/wiki/Treasure_Clad_Uragaan",
|
||||
@@ -317,12 +317,6 @@
|
||||
"name": "Volvidon",
|
||||
"name_jp": "\u30e9\u30f3\u30b0\u30ed\u30c8\u30e9"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u602a\u9ce5",
|
||||
"href": "/wiki/Yian_Kut-Ku",
|
||||
"name": "Yian Kut-Ku",
|
||||
"name_jp": "\u30a4\u30e3\u30f3\u30af\u30c3\u30af"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u9ed2\u72fc\u9ce5",
|
||||
"href": "/wiki/Yian_Garuga",
|
||||
@@ -335,6 +329,12 @@
|
||||
"name": "One-Eyed Yian Garuga",
|
||||
"name_jp": "\u96bb\u773c\u30a4\u30e3\u30f3\u30ac\u30eb\u30eb\u30ac"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u602a\u9ce5",
|
||||
"href": "/wiki/Yian_Kut-Ku",
|
||||
"name": "Yian Kut-Ku",
|
||||
"name_jp": "\u30a4\u30e3\u30f3\u30af\u30c3\u30af"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u5316\u3051\u9bab",
|
||||
"href": "/wiki/Zamtrios",
|
||||
@@ -594,19 +594,13 @@
|
||||
"name_jp": "\u30e9\u30f3\u30b4\u30b9\u30bf"
|
||||
},
|
||||
{
|
||||
"title_jp": "",
|
||||
"title_jp": "\u7802\u7adc",
|
||||
"href": "/wiki/Cephalos",
|
||||
"name": "Cephalos",
|
||||
"name_jp": ""
|
||||
"name_jp": "\u30ac\u30ec\u30aa\u30b9"
|
||||
},
|
||||
{
|
||||
"title_jp": "",
|
||||
"href": "/wiki/Delex",
|
||||
"name": "Delex",
|
||||
"name_jp": "\u30c7\u30eb\u30af\u30b9"
|
||||
},
|
||||
{
|
||||
"title_jp": "\u86c7\u7adc(2nd Gen)",
|
||||
"title_jp": "\u7ffc\u86c7\u7adc",
|
||||
"href": "/wiki/Remobra",
|
||||
"name": "Remobra",
|
||||
"name_jp": "\u30ac\u30d6\u30e9\u30b9"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user