Skip to content

Commit

Permalink
Merge pull request #160 from infstellar/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
infstellar authored Jun 17, 2024
2 parents 1c0f94d + 65507fc commit 452c076
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion assets/POI_JSON_API
Submodule POI_JSON_API updated 68 files
+1 −1 LANGUAGE/en_US.json
+1 −0 LANGUAGE/hant_TW.json
+1 −1 LANGUAGE/ja_JP.json
+1 −1 LANGUAGE/zh_CN.json
+25,453 −2,425 REFRESHTIME_INDEX.json
+1 −1 all_position.json
+27,217 −10,023 en_US/dataset/1.json
+26,982 −8,227 en_US/dataset/10.json
+28,611 −8,889 en_US/dataset/11.json
+28,122 −8,158 en_US/dataset/12.json
+26,920 −7,982 en_US/dataset/13.json
+30,833 −9,628 en_US/dataset/14.json
+75,867 −0 en_US/dataset/15.json
+80,649 −0 en_US/dataset/16.json
+82,560 −0 en_US/dataset/17.json
+77,456 −0 en_US/dataset/18.json
+80,423 −0 en_US/dataset/19.json
+25,538 −11,257 en_US/dataset/2.json
+79,373 −0 en_US/dataset/20.json
+83,102 −0 en_US/dataset/21.json
+85,164 −0 en_US/dataset/22.json
+83,705 −0 en_US/dataset/23.json
+80,862 −0 en_US/dataset/24.json
+41,863 −0 en_US/dataset/25.json
+15,725 −0 en_US/dataset/26.json
+25,654 −8,821 en_US/dataset/3.json
+28,264 −9,183 en_US/dataset/4.json
+26,207 −11,708 en_US/dataset/5.json
+27,430 −10,069 en_US/dataset/6.json
+22,868 −21,670 en_US/dataset/7.json
+44,052 −25,850 en_US/dataset/8.json
+27,475 −9,289 en_US/dataset/9.json
+348 −88 en_US/dataset/area.json
+3,662 −43 en_US/dataset/icon.json
+56,152 −15,967 en_US/dataset/item.json
+56 −12 en_US/dataset/type.json
+7,848 −1,136 zh_CN/ID_INDEX.json
+1,756 −1,065 zh_CN/ITEM_NAME.json
+27,216 −10,022 zh_CN/dataset/1.json
+26,958 −8,203 zh_CN/dataset/10.json
+28,539 −8,817 zh_CN/dataset/11.json
+28,152 −8,172 zh_CN/dataset/12.json
+26,826 −7,888 zh_CN/dataset/13.json
+30,805 −9,600 zh_CN/dataset/14.json
+75,867 −0 zh_CN/dataset/15.json
+80,649 −0 zh_CN/dataset/16.json
+82,560 −0 zh_CN/dataset/17.json
+77,456 −0 zh_CN/dataset/18.json
+80,447 −0 zh_CN/dataset/19.json
+25,539 −11,258 zh_CN/dataset/2.json
+79,373 −0 zh_CN/dataset/20.json
+83,102 −0 zh_CN/dataset/21.json
+85,168 −0 zh_CN/dataset/22.json
+83,705 −0 zh_CN/dataset/23.json
+80,862 −0 zh_CN/dataset/24.json
+43,240 −0 zh_CN/dataset/25.json
+15,725 −0 zh_CN/dataset/26.json
+25,684 −8,832 zh_CN/dataset/3.json
+28,201 −9,119 zh_CN/dataset/4.json
+26,166 −11,667 zh_CN/dataset/5.json
+27,394 −10,033 zh_CN/dataset/6.json
+22,895 −21,693 zh_CN/dataset/7.json
+44,043 −25,840 zh_CN/dataset/8.json
+27,466 −9,280 zh_CN/dataset/9.json
+344 −84 zh_CN/dataset/area.json
+3,628 −9 zh_CN/dataset/icon.json
+56,199 −16,014 zh_CN/dataset/item.json
+55 −11 zh_CN/dataset/type.json
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ torchvision
tabulate

paddleocr
paddlepaddle

thop

Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt', '-i',
'https://pypi.tuna.tsinghua.edu.cn/simple'])
open('DTISTREQ', 'x')
import installer_setup
# import installer_setup

installer_setup.auto_setup()
# installer_setup.auto_setup()

elif sys.argv[0] == 'update':
subprocess.check_call(['git', 'pull'])
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt', '-i',
'https://pypi.tuna.tsinghua.edu.cn/simple'])
if not os.path.exists('DTISTREQ'):
open('DTISTREQ', 'x')
import installer_setup
# import installer_setup

installer_setup.auto_setup()
# installer_setup.auto_setup()

elif sys.argv[0] == 'build':
import source.config.config_updater
Expand Down
10 changes: 5 additions & 5 deletions source/funclib/collector_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def get_item_id(item_name:str, area_id:list, match_mode = 0) -> list:
if int(i["areaId"]) in area_id:
if match_mode == 0:
if i["name"] == item_name:
ret_id.append(i["itemId"])
ret_id.append(i["id"])
elif match_mode == 1:
if i["name"] in item_name:
ret_id.append(i["itemId"])
ret_id.append(i["id"])
ret_id = list(set(ret_id))
return ret_id
if len(ret_id) == 1:
Expand Down Expand Up @@ -176,7 +176,7 @@ def load_items_position(marker_title:str, mode=0, area_id=None, blacklist_id=Non
if match_mode == 0:
id_index = load_json("ID_INDEX.json", f"assets\\POI_JSON_API\\{GLOBAL_LANG}")[marker_title]
elif match_mode == 1:
id_index = list(range(1,14))
id_index = list(range(1,27))
ita = []
for i in id_index:
ita += load_json(str(i)+".json", f"assets\\POI_JSON_API\\{GLOBAL_LANG}\\dataset")
Expand All @@ -188,7 +188,7 @@ def load_items_position(marker_title:str, mode=0, area_id=None, blacklist_id=Non
item_id = get_item_id(marker_title, area_id, match_mode=match_mode)
for i in ita:
if len(i["itemList"])>0:
if i["itemList"][0]["itemId"] in item_id:
if i["itemList"][0]["id"] in item_id:
common_name.append(i)
if mode == 1:
for i in ita:
Expand Down Expand Up @@ -226,7 +226,7 @@ def load_items_position(marker_title:str, mode=0, area_id=None, blacklist_id=Non
return ret_dict

def load_all_dict():
id_index = list(range(1,14))
id_index = list(range(1,27))
ita = []
for i in id_index:
ita += load_json(str(i)+".json", f"assets\\POI_JSON_API\\{GLOBAL_LANG}\\dataset")
Expand Down
3 changes: 3 additions & 0 deletions source/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def load_json(json_name='General.json', default_path='config\\settings') -> dict
def get_local_lang():
lang = locale.getdefaultlocale()[0]
print(lang)
# 反正英文也用不了,摆!
# TODO: Remove it in due course
return "zh_CN"
if lang in ["zh_CN", "zh_SG", "zh_MO", "zh_HK", "zh_TW"]:
return "zh_CN"
else:
Expand Down
12 changes: 6 additions & 6 deletions source/test/test238.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from source.util import *

MAX_INDEX = 27

# save_json(load_json(json_name="icon.json", default_path="assets\\POI_JSON_API"),json_name="icon.json", default_path="assets\\POI_JSON_API")
LANG = 'en_US'
Expand Down Expand Up @@ -30,15 +30,15 @@ def replace_str(d):
return d

def reshape_json():
for i in list(range(1,15))+["area", "icon", "id_stamp", "item", "type"]:
for i in list(range(1,MAX_INDEX))+["area", "icon", "id_stamp", "item", "type"]:
s = load_json(json_name=str(i)+".json", folder_path=f"assets\\POI_JSON_API\\{LANG}\\dataset")
s = replace_str(s)
save_json(s,json_name=str(i)+".json", default_path=f"assets\\POI_JSON_API\\{LANG}\\dataset")
logger.info(f"{i} succ")

def create_indexes():
s = {}
for ii in range(1,15):
for ii in range(1,MAX_INDEX):
j = load_json(json_name=str(ii)+".json", folder_path=f"assets\\POI_JSON_API\\{LANG}\\dataset")
for i in j:
s.setdefault(i["markerTitle"], []).append(str(ii))
Expand All @@ -52,7 +52,7 @@ def create_indexes():

def create_name():
s = []
for ii in range(1,15):
for ii in range(1,MAX_INDEX):
j = load_json(json_name=str(ii)+".json", folder_path=f"assets\\POI_JSON_API\\{LANG}\\dataset")
for i in j:
s.append(i["markerTitle"])
Expand All @@ -62,7 +62,7 @@ def create_name():

def create_refreshTime():
s = {}
for ii in range(1,15):
for ii in range(1,MAX_INDEX):
j = load_json(json_name=str(ii)+".json", folder_path=f"assets\\POI_JSON_API\\{LANG}\\dataset")
for i in j:
if int(i["refreshTime"]) not in [-1,0]:
Expand All @@ -72,7 +72,7 @@ def create_refreshTime():

def get_all_position():
rl = []
for ii in range(1,15):
for ii in range(1,MAX_INDEX):
j = load_json(json_name=str(ii)+".json", folder_path=f"assets\\POI_JSON_API\\{LANG}\\dataset")
for i in j:
rl.append(list(map(float,i['position'].split(',') )))
Expand Down

0 comments on commit 452c076

Please sign in to comment.