Procházet zdrojové kódy

Merge pull request #2498 from openNAMU/dont_use

비동기 1차분 적용
잉여개발기 před 1 rokem
rodič
revize
0e9a56e08a
100 změnil soubory, kde provedl 494 přidání a 428 odebrání
  1. 25 12
      app.py
  2. 6 0
      lang/en-US.json
  3. 6 1
      lang/ko-KR.json
  4. 9 8
      route/__init__.py
  5. 1 1
      route/api_image_view.py
  6. 1 1
      route/api_skin_info.py
  7. 3 3
      route/api_user_info.py
  8. 1 1
      route/api_version.py
  9. 3 3
      route/bbs_delete.py
  10. 4 4
      route/bbs_make.py
  11. 5 5
      route/bbs_w.py
  12. 3 3
      route/bbs_w_comment_tool.py
  13. 4 4
      route/bbs_w_delete.py
  14. 18 18
      route/bbs_w_edit.py
  15. 3 3
      route/bbs_w_hide.py
  16. 4 4
      route/bbs_w_pinned.py
  17. 17 17
      route/bbs_w_post.py
  18. 3 3
      route/bbs_w_tool.py
  19. 24 24
      route/edit.py
  20. 1 1
      route/edit_backlink_reset.py
  21. 12 12
      route/edit_delete.py
  22. 6 6
      route/edit_delete_file.py
  23. 9 9
      route/edit_delete_multiple.py
  24. 19 19
      route/edit_move.py
  25. 5 5
      route/edit_request.py
  26. 17 17
      route/edit_revert.py
  27. 15 15
      route/edit_upload.py
  28. 5 5
      route/filter_all.py
  29. 20 20
      route/filter_all_add.py
  30. 3 3
      route/filter_all_delete.py
  31. 6 6
      route/give_admin_groups.py
  32. 6 6
      route/give_delete_admin_group.py
  33. 16 16
      route/give_user_ban.py
  34. 8 8
      route/give_user_fix.py
  35. 1 1
      route/go_api_bbs.py
  36. 1 1
      route/go_api_bbs_list.py
  37. 5 2
      route/go_api_bbs_w.py
  38. 4 1
      route/go_api_bbs_w_comment.py
  39. 4 1
      route/go_api_bbs_w_comment_one.py
  40. 1 1
      route/go_api_bbs_w_set.py
  41. 1 1
      route/go_api_bbs_w_tabom.py
  42. 1 1
      route/go_api_func_auth.py
  43. 19 0
      route/go_api_func_email.py
  44. 1 1
      route/go_api_func_ip.py
  45. 1 1
      route/go_api_func_ip_menu.py
  46. 1 1
      route/go_api_func_language.py
  47. 1 1
      route/go_api_func_llm.py
  48. 4 1
      route/go_api_func_search.py
  49. 1 1
      route/go_api_func_sha224.py
  50. 1 1
      route/go_api_give_auth.py
  51. 1 1
      route/go_api_list_acl.py
  52. 1 1
      route/go_api_list_auth.py
  53. 1 1
      route/go_api_list_history.py
  54. 1 3
      route/go_api_list_markup.py
  55. 1 1
      route/go_api_list_old_page.py
  56. 1 1
      route/go_api_list_recent_block.py
  57. 1 1
      route/go_api_list_recent_change.py
  58. 1 1
      route/go_api_list_recent_discuss.py
  59. 4 1
      route/go_api_list_recent_edit_request.py
  60. 1 1
      route/go_api_list_title_index.py
  61. 1 1
      route/go_api_setting.py
  62. 7 7
      route/go_api_topic.py
  63. 1 1
      route/go_api_topic_list.py
  64. 1 1
      route/go_api_user_rankup.py
  65. 1 1
      route/go_api_user_setting_editor.py
  66. 1 1
      route/go_api_w_page_view.py
  67. 4 1
      route/go_api_w_random.py
  68. 4 1
      route/go_api_w_raw.py
  69. 7 4
      route/go_api_w_render.py
  70. 1 1
      route/go_api_w_set_reset.py
  71. 1 1
      route/go_api_w_watch_list.py
  72. 1 1
      route/go_api_w_xref.py
  73. 2 2
      route/go_main_func_easter_egg.py
  74. 2 2
      route/list_acl.py
  75. 3 3
      route/list_admin.py
  76. 4 4
      route/list_admin_auth_use.py
  77. 3 3
      route/list_admin_group.py
  78. 2 2
      route/list_image_file.py
  79. 2 2
      route/list_long_page.py
  80. 2 2
      route/list_no_link.py
  81. 2 2
      route/list_please.py
  82. 2 2
      route/list_title_index.py
  83. 3 3
      route/list_user.py
  84. 8 8
      route/list_user_check.py
  85. 4 4
      route/list_user_check_delete.py
  86. 2 2
      route/login_find.py
  87. 8 8
      route/login_find_email.py
  88. 5 5
      route/login_find_email_check.py
  89. 6 6
      route/login_find_key.py
  90. 10 10
      route/login_login.py
  91. 8 8
      route/login_login_2fa.py
  92. 8 8
      route/login_login_2fa_email.py
  93. 1 1
      route/login_logout.py
  94. 14 14
      route/login_register.py
  95. 4 4
      route/login_register_email.py
  96. 2 2
      route/login_register_email_check.py
  97. 3 3
      route/login_register_submit.py
  98. 3 3
      route/main_func_error_404.py
  99. 1 1
      route/main_search.py
  100. 2 2
      route/main_search_deep.py

+ 25 - 12
app.py

@@ -148,7 +148,13 @@ with get_db_connect(init_mode = True) as conn:
             pass
 
         if setup_tool == 'update':
-            update(conn, int(ver_set_data[0][0]), data_db_set)
+            try:
+                loop = asyncio.get_running_loop()
+                loop.create_task(update(conn, int(ver_set_data[0][0]), data_db_set))
+            except RuntimeError:
+                loop = asyncio.new_event_loop()
+                asyncio.set_event_loop(loop)
+                loop.run_until_complete(update(conn, int(ver_set_data[0][0]), data_db_set))
         else:
             set_init(conn)
 
@@ -335,7 +341,7 @@ def back_up(data_db_set):
 
         threading.Timer(60 * 60 * back_time, back_up, [data_db_set]).start()
 
-def do_every_day():
+async def do_every_day():
     with get_db_connect() as conn:
         curs = conn.cursor()
         
@@ -406,7 +412,7 @@ def do_every_day():
         # 칭호 관리
         curs.execute(db_change("select id from user_set where name = 'user_title' and data = '✅'"))
         for for_a in curs.fetchall():
-            if acl_check('', 'all_admin_auth', '', for_a[0]) == 1:
+            if await acl_check('', 'all_admin_auth', '', for_a[0]) == 1:
                 curs.execute(db_change("update user_set set data = '☑️' where name = 'user_title' and data = '✅' and id = ?"), [for_a[0]])
 
         threading.Timer(60 * 60 * 24, do_every_day).start()
@@ -415,7 +421,13 @@ def auto_do_something(data_db_set):
     if data_db_set['type'] == 'sqlite':
         back_up(data_db_set)
 
-    do_every_day()
+    try:
+        loop = asyncio.get_running_loop()
+        loop.create_task(do_every_day())
+    except RuntimeError:
+        loop = asyncio.new_event_loop()
+        asyncio.set_event_loop(loop)
+        loop.run_until_complete(do_every_day())
 
 auto_do_something(data_db_set)
 
@@ -799,8 +811,8 @@ app.route('/api/xref_this/<int:page>/<everything:name>', defaults = { 'xref_type
 app.route('/api/random')(api_w_random)
 
 app.route('/api/bbs/w/<sub_code>')(api_bbs_w)
-app.route('/api/bbs/w/comment/<sub_code>')(api_bbs_w_comment)
-app.route('/api/bbs/w/comment_one/<sub_code>')(api_bbs_w_comment_one)
+app.route('/api/bbs/w/comment/<sub_code>')(api_bbs_w_comment_exter)
+app.route('/api/bbs/w/comment_one/<sub_code>')(api_bbs_w_comment_one_exter)
 
 app.route('/api/version', defaults = { 'version_list' : version_list })(api_version)
 app.route('/api/skin_info')(api_skin_info)
@@ -811,10 +823,10 @@ app.route('/api/thread/<int:topic_num>/<int:s_num>/<int:e_num>')(api_topic)
 app.route('/api/thread/<int:topic_num>/<tool>')(api_topic)
 app.route('/api/thread/<int:topic_num>')(api_topic)
 
-app.route('/api/search/<everything:name>')(api_func_search)
-app.route('/api/search_page/<int:num>/<everything:name>')(api_func_search)
-app.route('/api/search_data/<everything:name>', defaults = { 'search_type' : 'data' })(api_func_search)
-app.route('/api/search_data_page/<int:num>/<everything:name>', defaults = { 'search_type' : 'data' })(api_func_search)
+app.route('/api/search/<everything:name>')(api_func_search_exter)
+app.route('/api/search_page/<int:num>/<everything:name>')(api_func_search_exter)
+app.route('/api/search_data/<everything:name>', defaults = { 'search_type' : 'data' })(api_func_search_exter)
+app.route('/api/search_data_page/<int:num>/<everything:name>', defaults = { 'search_type' : 'data' })(api_func_search_exter)
 
 app.route('/api/recent_change')(api_list_recent_change)
 app.route('/api/recent_changes')(api_list_recent_change)
@@ -859,8 +871,8 @@ app.route('/api/v2/bbs/set/<int:bbs_num>/<name>', methods = ['GET', 'PUT'])(api_
 app.route('/api/v2/bbs/in/<int:bbs_num>/<int:page>')(api_bbs)
 app.route('/api/v2/bbs/w/<sub_code>', defaults = { 'legacy' : '' })(api_bbs_w)
 app.route('/api/v2/bbs/w/tabom/<sub_code>', methods = ['GET', 'POST'])(api_bbs_w_tabom)
-app.route('/api/v2/bbs/w/comment/<sub_code>/<tool>', defaults = { 'legacy' : '' })(api_bbs_w_comment)
-app.route('/api/v2/bbs/w/comment_one/<sub_code>/<tool>', defaults = { 'legacy' : '' })(api_bbs_w_comment_one)
+app.route('/api/v2/bbs/w/comment/<sub_code>/<tool>', defaults = { 'legacy' : '' })(api_bbs_w_comment_exter)
+app.route('/api/v2/bbs/w/comment_one/<sub_code>/<tool>', defaults = { 'legacy' : '' })(api_bbs_w_comment_one_exter)
 
 app.route('/api/v2/doc_star_doc/<int:num>/<everything:name>', defaults = { 'do_type' : 'star_doc' })(api_w_watch_list)
 app.route('/api/v2/doc_watch_list/<int:num>/<everything:name>')(api_w_watch_list)
@@ -914,6 +926,7 @@ app.route('/setting/sitemap', methods = ['POST', 'GET'])(main_setting_sitemap)
 app.route('/setting/sitemap_set', methods = ['POST', 'GET'])(main_setting_sitemap_set)
 app.route('/setting/skin_set', methods = ['POST', 'GET'])(main_setting_skin_set)
 app.route('/setting/404_page', methods = ['POST', 'GET'])(setting_404_page)
+app.route('/setting/email_test', methods = ['POST', 'GET'])(main_setting_email_test)
 
 app.route('/easter_egg')(main_func_easter_egg)
 

+ 6 - 0
lang/en-US.json

@@ -56,6 +56,12 @@
     "login_able_and_regsiter_disable": "Login-able and Registration-disable",
     "private": "Private",
     "upvote": "Upvote",
+    "template_var" : "Template variable",
+    "edit_only_bottom_text" : "Editing only textarea bottom notice",
+    "move_bottom_text" : "Move textarea bottom notice",
+    "delete_bottom_text" : "Delete textarea bottom notice",
+    "revert_bottom_text" : "Revert textarea bottom notice",
+
 
     "_comment_": "Common",
     "data": "Data",

+ 6 - 1
lang/ko-KR.json

@@ -703,5 +703,10 @@
     "login_able_and_regsiter_disable": "로그인 허용 및 회원가입 비허용",
     "private": "비공개",
     "password_same_as_id_error": "비밀번호는 사용자 ID와 같을 수 없습니다.",
-    "upvote": "추천"
+    "upvote": "추천",
+    "template_var" : "템플릿 변수",
+    "edit_only_bottom_text" : "편집 전용 하단 문구",
+    "move_bottom_text" : "이동 하단 문구",
+    "delete_bottom_text" : "삭제 하단 문구",
+    "revert_bottom_text" : "되돌리기 하단 문구"
 }

+ 9 - 8
route/__init__.py

@@ -78,6 +78,7 @@ from route.main_setting_sitemap import main_setting_sitemap
 from route.main_setting_sitemap_set import main_setting_sitemap_set
 from route.main_setting_skin_set import main_setting_skin_set
 from route.main_setting_top_menu import main_setting_top_menu
+from route.main_setting_email_test import main_setting_email_test
 
 from route.main_sys_restart import main_sys_restart
 from route.main_sys_shutdown import main_sys_shutdown
@@ -185,15 +186,15 @@ from route.go_api_func_sha224 import api_func_sha224
 from route.go_api_func_ip import api_func_ip
 from route.go_api_func_ip_menu import api_func_ip_menu
 from route.go_api_func_auth import api_func_auth
-
-from route.go_api_func_search import api_func_search
+from route.go_api_func_email import api_func_email, api_func_email_exter
+from route.go_api_func_search import api_func_search, api_func_search_exter
 
 from route.go_api_give_auth import api_give_auth
 
 from route.go_api_list_recent_change import api_list_recent_change
 from route.go_api_list_recent_discuss import api_list_recent_discuss
 from route.go_api_list_recent_block import api_list_recent_block
-from route.go_api_list_recent_edit_request import api_list_recent_edit_request
+from route.go_api_list_recent_edit_request import api_list_recent_edit_request, api_list_recent_edit_request_exter
 from route.go_api_list_old_page import api_list_old_page
 from route.go_api_list_title_index import api_list_title_index
 from route.go_api_list_acl import api_list_acl
@@ -206,8 +207,8 @@ from route.go_api_bbs_list import api_bbs_list
 from route.go_api_bbs_w import api_bbs_w
 from route.go_api_bbs_w_set import api_bbs_w_set
 from route.go_api_bbs_w_tabom import api_bbs_w_tabom
-from route.go_api_bbs_w_comment import api_bbs_w_comment
-from route.go_api_bbs_w_comment_one import api_bbs_w_comment_one
+from route.go_api_bbs_w_comment import api_bbs_w_comment, api_bbs_w_comment_exter
+from route.go_api_bbs_w_comment_one import api_bbs_w_comment_one, api_bbs_w_comment_one_exter
 
 from route.go_api_setting import api_setting
 
@@ -217,11 +218,11 @@ from route.go_api_topic_list import api_topic_list
 from route.go_api_user_rankup import api_user_rankup
 from route.go_api_user_setting_editor import api_user_setting_editor
 
-from route.go_api_w_raw import api_w_raw
-from route.go_api_w_random import api_w_random
+from route.go_api_w_raw import api_w_raw, api_w_raw_exter
+from route.go_api_w_random import api_w_random, api_w_random_exter
 from route.go_api_w_xref import api_w_xref
 from route.go_api_w_watch_list import api_w_watch_list
-from route.go_api_w_render import api_w_render
+from route.go_api_w_render import api_w_render, api_w_render_exter
 from route.go_api_w_set_reset import api_w_set_reset
 from route.go_api_w_page_view import api_w_page_view
 

+ 1 - 1
route/api_image_view.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def api_image_view(name = 'Test'):
+async def api_image_view(name = 'Test'):
     with get_db_connect() as conn:
         if os.path.exists(os.path.join(load_image_url(conn), name)):
             return flask.jsonify({ "exist" : "1" })

+ 1 - 1
route/api_skin_info.py

@@ -2,7 +2,7 @@ import urllib.request
 
 from .tool.func import *
 
-def api_skin_info(name = ''):
+async def api_skin_info(name = ''):
     with get_db_connect() as conn:
         name = skin_check(conn) if name == '' else './views/' + name + '/index.html'
 

+ 3 - 3
route/api_user_info.py

@@ -1,13 +1,13 @@
 from .tool.func import *
 
-def api_user_info(user_name = ''):
+async def api_user_info(user_name = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         data_result = {}
         
         # name part
-        data_result['render'] = ip_pas(user_name)
+        data_result['render'] = await ip_pas(user_name)
         
         # auth part
         curs.execute(db_change("select data from user_set where id = ? and name = 'acl'"), [user_name])
@@ -32,7 +32,7 @@ def api_user_info(user_name = ''):
         data_result['max_exp'] = level_data[2]
             
         # ban part
-        ban = ban_check(user_name)
+        ban = await ban_check(user_name)
         if ban[0] == 0:
             data_result['ban'] = '0'
         else:

+ 1 - 1
route/api_version.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def api_version(version_list):
+async def api_version(version_list):
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 3 - 3
route/bbs_delete.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def bbs_delete(bbs_num = ''):
+async def bbs_delete(bbs_num = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -13,7 +13,7 @@ def bbs_delete(bbs_num = ''):
         
         bbs_num_str = str(bbs_num)
 
-        if acl_check('', 'owner_auth', '', '') == 1:
+        if await acl_check('', 'owner_auth', '', '') == 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
         if bbs_num_str == 0:
@@ -27,7 +27,7 @@ def bbs_delete(bbs_num = ''):
             return redirect(conn, '/bbs/main')
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'bbs_delete'), wiki_set(conn), wiki_custom(conn), wiki_css(['(' + bbs_name + ')', 0])],
+                imp = [get_lang(conn, 'bbs_delete'), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + bbs_name + ')', 0])],
                 data = render_simple_set(conn, '''
                     <form method="post">
                         <span>''' + get_lang(conn, 'delete_warning') + '''</span>

+ 4 - 4
route/bbs_make.py

@@ -1,11 +1,11 @@
 from .tool.func import *
 
-def bbs_make():   
+async def bbs_make():   
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if acl_check('', 'owner_auth', '', '') == 1:
-            return re_error(conn, 3)
+        if await acl_check('', 'owner_auth', '', '') == 1:
+            return await re_error(conn, 3)
         
         if flask.request.method == 'POST':
             curs.execute(db_change('select set_id from bbs_set where set_name = "bbs_name" order by set_id + 0 desc'))
@@ -22,7 +22,7 @@ def bbs_make():
             return redirect(conn, '/bbs/main')
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'bbs_make'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'bbs_make'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         <input placeholder="''' + get_lang(conn, 'bbs_name') + '''" name="bbs_name">

+ 5 - 5
route/bbs_w.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
+async def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
         
@@ -9,7 +9,7 @@ def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
         sub = ''
         bbs_name_dict = {}
 
-        admin_auth = acl_check(tool = 'owner_auth')
+        admin_auth = await acl_check(tool = 'owner_auth')
         admin_auth = 1 if admin_auth == 0 else 0
 
         if tool == 'bbs':
@@ -151,7 +151,7 @@ def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
                     
                 data += '''
                     <tr>
-                        <td>''' + ip_pas(temp_dict['comment_user_id']) + '''</td>
+                        <td>''' + await ip_pas(temp_dict['comment_user_id']) + '''</td>
                         <td>''' + temp_dict['comment_date'] + '''</td>
                         <td>''' + ('#' + comment_link) + '''</td>
                     </tr>
@@ -173,7 +173,7 @@ def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
             
                 data += '''
                     <tr class="''' + ('opennamu_comment_color_red' if notice == 1 else '') + '''">
-                        <td>''' + ip_pas(temp_dict['user_id']) + '''</td>
+                        <td>''' + await ip_pas(temp_dict['user_id']) + '''</td>
                         <td>''' + temp_dict['date'] + '''</td>
                         <td>''' + last_comment_date + '''</td>
                     </tr>
@@ -189,7 +189,7 @@ def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
         data += '</table>'
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [title_name, wiki_set(conn), wiki_custom(conn), wiki_css([sub, 0])],
+            imp = [title_name, wiki_set(conn), await wiki_custom(conn), wiki_css([sub, 0])],
             data = data,
             menu = menu
         ))

+ 3 - 3
route/bbs_w_comment_tool.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def bbs_w_comment_tool(bbs_num = '', post_num = '', comment_num = ''):
+async def bbs_w_comment_tool(bbs_num = '', post_num = '', comment_num = ''):
     with get_db_connect() as conn:
         data = ''
         
@@ -15,7 +15,7 @@ def bbs_w_comment_tool(bbs_num = '', post_num = '', comment_num = ''):
             </ul>
         '''
 
-        if acl_check('', 'owner_auth', '', '') != 1:
+        if await acl_check('', 'owner_auth', '', '') != 1:
             data += '''
                 <h3>''' + get_lang(conn, 'owner') + '''</h2>
                 <ul>
@@ -24,7 +24,7 @@ def bbs_w_comment_tool(bbs_num = '', post_num = '', comment_num = ''):
             '''
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'bbs_comment_tool'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'bbs_comment_tool'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = data,
             menu = [['bbs/w/' + url_pas(bbs_num_str) + '/' + url_pas(post_num_str) + '#' + url_pas(comment_num), get_lang(conn, 'return')]]
         ))

+ 4 - 4
route/bbs_w_delete.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 from .go_api_bbs_w import api_bbs_w
 
-def bbs_w_delete(bbs_num = '', post_num = '', comment_num = ''):
+async def bbs_w_delete(bbs_num = '', post_num = '', comment_num = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -16,10 +16,10 @@ def bbs_w_delete(bbs_num = '', post_num = '', comment_num = ''):
         bbs_num_str = str(bbs_num)
         post_num_str = str(post_num)
 
-        if acl_check('', 'owner_auth', '') == 1:
+        if await acl_check('', 'owner_auth', '') == 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
-        temp_dict = orjson.loads(api_bbs_w(bbs_num_str + '-' + post_num_str).data)
+        temp_dict = await api_bbs_w(bbs_num_str + '-' + post_num_str)
         if not 'user_id' in temp_dict:
             return redirect(conn, '/bbs/main')
         
@@ -54,7 +54,7 @@ def bbs_w_delete(bbs_num = '', post_num = '', comment_num = ''):
                 sub += ' (' + comment_num + ')'
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css([sub, 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css([sub, 0])],
                 data = render_simple_set(conn, '''
                     <form method="post">
                         <span>''' + get_lang(conn, 'delete_warning') + '''</span>

+ 18 - 18
route/bbs_w_edit.py

@@ -19,28 +19,28 @@ async def bbs_w_edit(bbs_num = '', post_num = '', comment_num = ''):
             return redirect(conn, '/bbs/main')
         
         if comment_num != '':
-            temp_dict = orjson.loads((await api_bbs_w_comment_one(bbs_num_str + '-' + post_num_str + '-' + comment_num)).get_data(as_text = True))
+            temp_dict = await api_bbs_w_comment_one(bbs_num_str + '-' + post_num_str + '-' + comment_num)
             if 'comment_user_id' in temp_dict:
-                if not temp_dict['comment_user_id'] == ip and acl_check('', 'owner_auth', '', '') == 1:
-                    return re_error(conn, 0)
+                if not temp_dict['comment_user_id'] == ip and await acl_check('', 'owner_auth', '', '') == 1:
+                    return await re_error(conn, 0)
             else:
                 return redirect(conn, '/bbs/main')
         elif post_num != '':
-            temp_dict = orjson.loads(api_bbs_w(bbs_num_str + '-' + post_num_str).data)
+            temp_dict = await api_bbs_w(bbs_num_str + '-' + post_num_str)
             if 'user_id' in temp_dict:
-                if not temp_dict['user_id'] == ip and acl_check('', 'owner_auth', '', '') == 1:
-                    return re_error(conn, 0)
+                if not temp_dict['user_id'] == ip and await acl_check('', 'owner_auth', '', '') == 1:
+                    return await re_error(conn, 0)
             else:
                 return redirect(conn, '/bbs/main')
             
-        if acl_check(bbs_num_str, 'bbs_edit') == 1:
+        if await acl_check(bbs_num_str, 'bbs_edit') == 1:
             return redirect(conn, '/bbs/set/' + bbs_num_str)
         
         i_list = ['post_view_acl', 'post_comment_acl']
 
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
         
             if post_num == '':
                 curs.execute(db_change('select set_code from bbs_data where set_name = "title" and set_id = ? order by set_code + 0 desc'), [bbs_num_str])
@@ -56,11 +56,11 @@ async def bbs_w_edit(bbs_num = '', post_num = '', comment_num = ''):
                 # re_error로 대체 예정
                 return redirect(conn, '/bbs/in/' + bbs_num_str)
             
-            if do_edit_filter(conn, title) == 1:
-                return re_error(conn, 21)
+            if await do_edit_filter(conn, title) == 1:
+                return await re_error(conn, 21)
 
-            if do_edit_filter(conn, data) == 1:
-                return re_error(conn, 21)
+            if await do_edit_filter(conn, data) == 1:
+                return await re_error(conn, 21)
             
             date = get_time()
 
@@ -92,7 +92,7 @@ async def bbs_w_edit(bbs_num = '', post_num = '', comment_num = ''):
             option_display = ''
 
             if comment_num != '':
-                temp_dict = orjson.loads((await api_bbs_w_comment_one(bbs_num_str + '-' + post_num_str + '-' + comment_num)).get_data(as_text = True))
+                temp_dict = await api_bbs_w_comment_one(bbs_num_str + '-' + post_num_str + '-' + comment_num)
 
                 title = ''
                 data = temp_dict['comment']
@@ -101,13 +101,13 @@ async def bbs_w_edit(bbs_num = '', post_num = '', comment_num = ''):
                 title = ''
                 data = ''
             else:
-                temp_dict = orjson.loads(api_bbs_w(bbs_num_str + '-' + post_num_str).data)
+                temp_dict = await api_bbs_w(bbs_num_str + '-' + post_num_str)
 
                 title = temp_dict['title']
                 data = temp_dict['data']
 
             acl_div = ['' for _ in range(0, len(i_list))]
-            acl_list = get_acl_list()
+            acl_list = await get_acl_list()
             for for_a in range(0, len(i_list)):
                 for data_list in acl_list:
                     acl_div[for_a] += '<option value="' + data_list + '">' + (data_list if data_list != '' else 'normal') + '</option>'
@@ -125,13 +125,13 @@ async def bbs_w_edit(bbs_num = '', post_num = '', comment_num = ''):
                 bbs_title = get_lang(conn, 'post_edit')
     
             return easy_minify(conn, flask.render_template(skin_check(conn), 
-                imp = [bbs_title, wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [bbs_title, wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data =  editor_top_text + '''
                     <form method="post">                        
                         <input style="''' + option_display + '''" placeholder="''' + get_lang(conn, 'title') + '''" name="title" value="''' + html.escape(title) + '''">
                         <hr style="''' + option_display + '''" class="main_hr">
 
-                        ''' + edit_editor(conn, ip, data, 'bbs') + '''
+                        ''' + await edit_editor(conn, ip, data, 'bbs') + '''
 
                         <!--
                         <div style="''' + option_display + '''">

+ 3 - 3
route/bbs_w_hide.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def bbs_w_hide(bbs_num = '', post_num = ''):
+async def bbs_w_hide(bbs_num = '', post_num = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -14,14 +14,14 @@ def bbs_w_hide(bbs_num = '', post_num = ''):
         bbs_num_str = str(bbs_num)
         post_num_str = str(post_num)
 
-        if acl_check('', 'bbs_auth', '', '') == 1:
+        if await acl_check('', 'bbs_auth', '', '') == 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
         if flask.request.method == 'POST':
             pass
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'bbs_post_hide'), wiki_set(conn), wiki_custom(conn), wiki_css(['(' + bbs_name + ')' + ' (' + post_num_str + ')', 0])],
+                imp = [get_lang(conn, 'bbs_post_hide'), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + bbs_name + ')' + ' (' + post_num_str + ')', 0])],
                 data = render_simple_set(conn, '''
                     <form method="post">
                         <button type="submit">''' + get_lang(conn, 'hide') + '''</button>

+ 4 - 4
route/bbs_w_pinned.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 from .go_api_bbs_w import api_bbs_w
 
-def bbs_w_pinned(bbs_num = '', post_num = ''):
+async def bbs_w_pinned(bbs_num = '', post_num = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -16,10 +16,10 @@ def bbs_w_pinned(bbs_num = '', post_num = ''):
         bbs_num_str = str(bbs_num)
         post_num_str = str(post_num)
 
-        if acl_check('', 'bbs_auth', '', '') == 1:
+        if await acl_check('', 'bbs_auth', '', '') == 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
-        temp_dict = orjson.loads(api_bbs_w(bbs_num_str + '-' + post_num_str).data)
+        temp_dict = await api_bbs_w(bbs_num_str + '-' + post_num_str)
         if not 'user_id' in temp_dict:
             return redirect(conn, '/bbs/main')
         
@@ -36,7 +36,7 @@ def bbs_w_pinned(bbs_num = '', post_num = ''):
             pinned = get_lang(conn, 'pinned') if not curs.fetchall() else get_lang(conn, 'pinned_release')
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'bbs_post_pinned'), wiki_set(conn), wiki_custom(conn), wiki_css(['(' + bbs_name + ')' + ' (' + post_num_str + ')', 0])],
+                imp = [get_lang(conn, 'bbs_post_pinned'), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + bbs_name + ')' + ' (' + post_num_str + ')', 0])],
                 data = render_simple_set(conn, '''
                     <form method="post">
                         <button type="submit">''' + pinned + '''</button>

+ 17 - 17
route/bbs_w_post.py

@@ -14,7 +14,7 @@ async def bbs_w_post_comment(conn, user_id, sub_code, comment_num, bbs_num_str,
     comment_count = 0
     comment_add_count = 0
 
-    thread_data = orjson.loads((await api_bbs_w_comment(sub_code)).get_data(as_text = True))
+    thread_data = await api_bbs_w_comment(sub_code)
 
     for temp_dict in thread_data:
         if temp_dict['comment_user_id'] != '':
@@ -37,7 +37,7 @@ async def bbs_w_post_comment(conn, user_id, sub_code, comment_num, bbs_num_str,
 
             comment_data += '<span style="padding-left: 20px;"></span>' * margin_count
             comment_data += api_topic_thread_make(
-                ip_pas(temp_dict['comment_user_id']),
+                await ip_pas(temp_dict['comment_user_id']),
                 date,
                 render_set(conn, doc_data = temp_dict['comment']),
                 sub_code_check,
@@ -66,10 +66,10 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
 
         bbs_num_str = str(bbs_num)
         post_num_str = str(post_num)
-        bbs_comment_acl = acl_check(bbs_num_str, 'bbs_comment')
+        bbs_comment_acl = await acl_check(bbs_num_str, 'bbs_comment')
         ip = ip_check()
 
-        temp_dict = orjson.loads(api_bbs_w(bbs_num_str + '-' + post_num_str).data)
+        temp_dict = await api_bbs_w(bbs_num_str + '-' + post_num_str)
         if temp_dict == {}:
             return redirect(conn, '/bbs/main')
         
@@ -83,8 +83,8 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
                     if bbs_comment_acl == 1:
                         return redirect(conn, '/bbs/set/' + bbs_num_str)
                     
-                    if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                        return re_error(conn, 13)
+                    if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                        return await re_error(conn, 13)
 
                     set_id = bbs_num_str + '-' + post_num_str
 
@@ -98,7 +98,7 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
                         return redirect(conn, '/bbs/w/' + bbs_num_str + '/' + post_num_str)
                     
                     data = data.replace('\r', '')
-                    data = api_topic_thread_pre_render(conn, data, id_data, ip, set_id, bbs_name, temp_dict['title'], 'post')
+                    data = await api_topic_thread_pre_render(conn, data, id_data, ip, set_id, bbs_name, temp_dict['title'], 'post')
                     
                     date = get_time()
 
@@ -106,15 +106,15 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
                     curs.execute(db_change("insert into bbs_data (set_name, set_code, set_id, set_data) values ('comment_date', ?, ?, ?)"), [id_data, set_id, date])
                     curs.execute(db_change("insert into bbs_data (set_name, set_code, set_id, set_data) values ('comment_user_id', ?, ?, ?)"), [id_data, set_id, ip])
 
-                    add_alarm(temp_dict['user_id'], ip, 'BBS <a href="/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + id_data + '">' + html.escape(bbs_name) + ' - ' + html.escape(temp_dict['title']) + '#' + id_data + '</a>')
+                    await add_alarm(temp_dict['user_id'], ip, 'BBS <a href="/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + id_data + '">' + html.escape(bbs_name) + ' - ' + html.escape(temp_dict['title']) + '#' + id_data + '</a>')
 
                     return redirect(conn, '/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + id_data)
                 else:
                     if bbs_comment_acl == 1:
                         return redirect(conn, '/bbs/set/' + bbs_num_str)
                     
-                    if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                        return re_error(conn, 13)
+                    if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                        return await re_error(conn, 13)
                     
                     select = flask.request.form.get('comment_select', '0')
                     select = '' if select == '0' else select
@@ -165,14 +165,14 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
                         set_id += '-' if set_id != '' else ''
                         end_id = set_id + id_data
 
-                    add_alarm(temp_dict['user_id'], ip, 'BBS <a href="/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + end_id + '">' + html.escape(bbs_name) + ' - ' + html.escape(temp_dict['title']) + '#' + end_id + '</a>')
+                    await add_alarm(temp_dict['user_id'], ip, 'BBS <a href="/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + end_id + '">' + html.escape(bbs_name) + ' - ' + html.escape(temp_dict['title']) + '#' + end_id + '</a>')
                     if comment_user_name != '':
-                        add_alarm(comment_user_name, ip, 'BBS <a href="/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + end_id + '">' + html.escape(bbs_name) + ' - ' + html.escape(temp_dict['title']) + '#' + end_id + '</a>')
+                        await add_alarm(comment_user_name, ip, 'BBS <a href="/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + end_id + '">' + html.escape(bbs_name) + ' - ' + html.escape(temp_dict['title']) + '#' + end_id + '</a>')
 
                     return redirect(conn, '/bbs/w/' + bbs_num_str + '/' + post_num_str + '#' + end_id)
             else:
-                if acl_check(bbs_num_str, 'bbs_view') == 1:
-                    return re_error(conn, 0)
+                if await acl_check(bbs_num_str, 'bbs_view') == 1:
+                    return await re_error(conn, 0)
 
                 date = ''
                 date += '<a href="javascript:opennamu_change_comment(\'0\');">(' + get_lang(conn, 'comment') + ')</a> '
@@ -181,7 +181,7 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
                 data = ''
                 data += '<h2>' + html.escape(temp_dict['title']) + '</h2>'
                 data += api_topic_thread_make(
-                    ip_pas(temp_dict['user_id']),
+                    await ip_pas(temp_dict['user_id']),
                     date,
                     render_set(conn, doc_data = temp_dict['data']),
                     '0',
@@ -200,7 +200,7 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
                     bbs_comment_form += '''
                         <div id="opennamu_bbs_w_post_tabom"></div>
                         <div id="opennamu_bbs_w_post_select"></div>
-                        ''' + edit_editor(conn, ip, '', 'bbs_comment') + '''
+                        ''' + await edit_editor(conn, ip, '', 'bbs_comment') + '''
                     '''
 
                 data += '''
@@ -210,7 +210,7 @@ async def bbs_w_post(bbs_num = '', post_num = ''):
                 '''
 
                 return easy_minify(conn, flask.render_template(skin_check(conn),
-                    imp = [bbs_name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'bbs') + ')', 0])],
+                    imp = [bbs_name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'bbs') + ')', 0])],
                     data = data,
                     menu = [['bbs/in/' + bbs_num_str, get_lang(conn, 'return')], ['bbs/edit/' + bbs_num_str + '/' + post_num_str, get_lang(conn, 'edit')], ['bbs/tool/' + bbs_num_str + '/' + post_num_str, get_lang(conn, 'tool')]]
                 ))

+ 3 - 3
route/bbs_w_tool.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def bbs_w_tool(bbs_num = '', post_num = ''):
+async def bbs_w_tool(bbs_num = '', post_num = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -16,7 +16,7 @@ def bbs_w_tool(bbs_num = '', post_num = ''):
             </ul>
         '''
 
-        if acl_check('', 'bbs_auth', '', '') != 1:
+        if await acl_check('', 'bbs_auth', '', '') != 1:
             curs.execute(db_change('select set_data from bbs_data where set_code = ? and set_id = ? and set_name = "pinned"'), [post_num_str, bbs_num_str])
             pinned = get_lang(conn, 'pinned') if not curs.fetchall() else get_lang(conn, 'pinned_release')
 
@@ -36,7 +36,7 @@ def bbs_w_tool(bbs_num = '', post_num = ''):
             '''
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'bbs_post_tool'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'bbs_post_tool'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = data,
             menu = [['bbs/w/' + url_pas(bbs_num_str) + '/' + url_pas(post_num_str), get_lang(conn, 'return')]]
         ))

+ 24 - 24
route/edit.py

@@ -25,7 +25,7 @@ def edit_timeout(func, args = (), timeout = 3):
         pool.join()
         return 0
         
-def edit_editor(conn, ip, data_main = '', do_type = 'edit', addon = '', name = ''):
+async def edit_editor(conn, ip, data_main = '', do_type = 'edit', addon = '', name = ''):
     curs = conn.cursor()
 
     monaco_editor_top = ''
@@ -82,7 +82,7 @@ def edit_editor(conn, ip, data_main = '', do_type = 'edit', addon = '', name = '
 
     textarea_size = 'opennamu_textarea_500' if do_type == 'edit' else 'opennamu_textarea_100'
 
-    out_field = captcha_get(conn) + ip_warning(conn) + addon
+    out_field = await captcha_get(conn) + ip_warning(conn) + addon
     if out_field != '':
         out_field += '<hr class="main_hr">'
 
@@ -118,27 +118,27 @@ def edit_editor(conn, ip, data_main = '', do_type = 'edit', addon = '', name = '
         <div id="opennamu_preview_area"></div>
     '''
 
-def edit(name = 'Test', section = 0, do_type = ''):
+async def edit(name = 'Test', section = 0, do_type = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
     
         ip = ip_check()
 
         edit_req_mode = 0
-        if acl_check(name, 'document_edit') == 1:
+        if await acl_check(name, 'document_edit') == 1:
             edit_req_mode = 1
-            if acl_check(name, 'document_edit_request') == 1:
+            if await acl_check(name, 'document_edit_request') == 1:
                 return redirect(conn, '/raw_acl/' + url_pas(name))
             
         if do_title_length_check(conn, name) == 1:
-            return re_error(conn, 38)
+            return await re_error(conn, 38)
         
         curs.execute(db_change("select id from history where title = ? order by id + 0 desc"), [name])
         doc_ver = curs.fetchall()
         doc_ver = doc_ver[0][0] if doc_ver else '0'
 
         if doc_ver == '0':
-            if acl_check(name, 'document_make_acl') == 1:
+            if await acl_check(name, 'document_make_acl') == 1:
                 edit_req_mode = 1
 
         curs.execute(db_change("select set_data from data_set where doc_name = ? and doc_rev = ? and set_name = 'edit_request_data'"), [name, doc_ver])
@@ -153,28 +153,28 @@ def edit(name = 'Test', section = 0, do_type = ''):
             edit_repeat = 'get'
         
         if edit_repeat == 'post':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
     
-            if do_edit_slow_check(conn) == 1:
-                return re_error(conn, 24)
+            if await do_edit_slow_check(conn) == 1:
+                return await re_error(conn, 24)
     
             today = get_time()
             content = flask.request.form.get('content', '').replace('\r', '')
             send = flask.request.form.get('send', '')
             agree = flask.request.form.get('copyright_agreement', '')
             
-            if do_edit_filter(conn, content) == 1:
-                return re_error(conn, 21)
+            if await do_edit_filter(conn, content) == 1:
+                return await re_error(conn, 21)
             
-            if do_edit_filter(conn, send) == 1:
-                return re_error(conn, 21)
+            if await do_edit_filter(conn, send) == 1:
+                return await re_error(conn, 21)
 
-            if do_edit_send_check(conn, send) == 1:
-                return re_error(conn, 37)
+            if await do_edit_send_check(conn, send) == 1:
+                return await re_error(conn, 37)
 
             if do_edit_text_bottom_check_box_check(conn, agree) == 1:
-                return re_error(conn, 29)
+                return await re_error(conn, 29)
             
             curs.execute(db_change("select data from data where title = ?"), [name])
             db_data = curs.fetchall()
@@ -208,7 +208,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
             db_data_3 = curs.fetchall()
             if db_data_3 and db_data_3[0][0] != '':
                 if int(number_check(db_data_3[0][0])) < len(content):
-                    return re_error(conn, 44)
+                    return await re_error(conn, 44)
 
             curs.execute(db_change("select data from other where name = 'edit_timeout'"))
             db_data_2 = curs.fetchall()
@@ -219,7 +219,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
                 timeout = 0
 
             if timeout == 1:
-                return re_error(conn, 41)
+                return await re_error(conn, 41)
             
             if edit_req_mode == 0:
                 # 진짜 기록 부분
@@ -228,7 +228,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
         
                 curs.execute(db_change("select id from user_set where name = 'watchlist' and data = ?"), [name])
                 for scan_user in curs.fetchall():
-                    add_alarm(scan_user[0], ip, '<a href="/w/' + url_pas(name) + '">' + html.escape(name) + '</a>')
+                    await add_alarm(scan_user[0], ip, '<a href="/w/' + url_pas(name) + '">' + html.escape(name) + '</a>')
                         
                 history_plus(conn, 
                     name,
@@ -257,7 +257,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
 
                 curs.execute(db_change("select id from user_set where name = 'watchlist' and data = ?"), [name])
                 for scan_user in curs.fetchall():
-                    add_alarm(scan_user[0], ip, '<a href="/edit_request/' + url_pas(name) + '">' + html.escape(name) + '</a> edit_request')
+                    await add_alarm(scan_user[0], ip, '<a href="/edit_request/' + url_pas(name) + '">' + html.escape(name) + '</a> edit_request')
             
                 return redirect(conn, '/edit_request_from/' + url_pas(name))
         else:
@@ -361,7 +361,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
             sub_title = '(' + get_lang(conn, 'edit_request') + ')' if edit_req_mode == 1 else '(' + get_lang(conn, 'edit') + ')'
 
             return easy_minify(conn, flask.render_template(skin_check(conn), 
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css([sub_title + sub_menu, 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css([sub_title + sub_menu, 0])],
                 data = editor_top_text + '''
                     <form method="post">
                         <textarea style="display: none;" name="doc_section_data_where">''' + data_section_where + '''</textarea>
@@ -373,7 +373,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send">
                         <hr class="main_hr">
                         
-                        ''' + edit_editor(conn, ip, data_section, addon = get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn) , name = name) + '''
+                        ''' + await edit_editor(conn, ip, data_section, addon = get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'edit') , name = name) + '''
                     </form>
                 ''',
                 menu = [

+ 1 - 1
route/edit_backlink_reset.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def edit_backlink_reset(name = 'Test'):
+async def edit_backlink_reset(name = 'Test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 12 - 12
route/edit_delete.py

@@ -1,32 +1,32 @@
 from .tool.func import *
 
-def edit_delete(name):
+async def edit_delete(name):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         ip = ip_check()
-        if acl_check(name, 'document_delete') == 1:
-            return re_error(conn, 0)
+        if await acl_check(name, 'document_delete') == 1:
+            return await re_error(conn, 0)
 
         curs.execute(db_change("select title from data where title = ?"), [name])
         if not curs.fetchall():
             return redirect(conn, '/w/' + url_pas(name))
 
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
-            if do_edit_slow_check(conn) == 1:
-                return re_error(conn, 24)
+            if await do_edit_slow_check(conn) == 1:
+                return await re_error(conn, 24)
             
             send = flask.request.form.get('send', '')
             agree = flask.request.form.get('copyright_agreement', '')
             
-            if do_edit_send_check(conn, send) == 1:
-                return re_error(conn, 37)
+            if await do_edit_send_check(conn, send) == 1:
+                return await re_error(conn, 37)
             
             if do_edit_text_bottom_check_box_check(conn, agree) == 1:
-                return re_error(conn, 29)
+                return await re_error(conn, 29)
 
             curs.execute(db_change("select data from data where title = ?"), [name])
             data = curs.fetchall()
@@ -54,12 +54,12 @@ def edit_delete(name):
             return redirect(conn, '/w/' + url_pas(name))
         else:            
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'delete') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'delete') + ')', 0])],
                 data = '''
                     <form method="post">
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send">
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + await captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'delete')  + '''
                         <button type="submit">''' + get_lang(conn, 'delete') + '''</button>
                     </form>
                 ''',

+ 6 - 6
route/edit_delete_file.py

@@ -2,10 +2,10 @@ from .tool.func import *
 
 from .edit_delete import edit_delete
 
-def edit_delete_file(name = 'test.jpg'):
+async def edit_delete_file(name = 'test.jpg'):
     with get_db_connect() as conn:
-        if acl_check('', 'owner_auth', '', '') != 0:
-            return re_error(conn, 0)
+        if await acl_check('', 'owner_auth', '', '') != 0:
+            return await re_error(conn, 0)
 
         mime_type = re.search(r'([^.]+)$', name)
         mime_type_str = 'jpg'
@@ -22,16 +22,16 @@ def edit_delete_file(name = 'test.jpg'):
             return redirect(conn, '/w/' + url_pas(name))
 
         if flask.request.method == 'POST':
-            acl_check(tool = 'owner_auth', memo = 'file del (' + name + ')')
+            await acl_check(tool = 'owner_auth', memo = 'file del (' + name + ')')
             os.remove(file_directory)
 
             if flask.request.form.get('with_doc', '') != '':
-                edit_delete(name)
+                await edit_delete(name)
 
             return redirect(conn, '/w/' + url_pas(name))
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'file_delete') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'file_delete') + ')', 0])],
                 data = '''
                     <form method="post">
                         <img src="/image/''' + url_pas(file_all_name) + '''">

+ 9 - 9
route/edit_delete_multiple.py

@@ -2,36 +2,36 @@ from .tool.func import *
 
 from .edit_delete import edit_delete
 
-def edit_delete_multiple():
+async def edit_delete_multiple():
     with get_db_connect() as conn:
-        if acl_check('', 'acl_auth', '', '') == 1:
-            return re_error(conn, 0)
+        if await acl_check('', 'acl_auth', '', '') == 1:
+            return await re_error(conn, 0)
 
         if flask.request.method == 'POST':
             send = flask.request.form.get('send', '')
             agree = flask.request.form.get('copyright_agreement', '')
             
-            if do_edit_send_check(conn, send) == 1:
-                return re_error(conn, 37)
+            if await do_edit_send_check(conn, send) == 1:
+                return await re_error(conn, 37)
             
             if do_edit_text_bottom_check_box_check(conn, agree) == 1:
-                return re_error(conn, 29)
+                return await re_error(conn, 29)
             
             all_title = re.findall(r'([^\n]+)\n', flask.request.form.get('content', '').replace('\r', '') + '\n')
             for name in all_title:
-                edit_delete(name)
+                await edit_delete(name)
 
             return redirect(conn, '/recent_change')
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'many_delete'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'many_delete'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         <textarea class="opennamu_textarea_500" placeholder="''' + get_lang(conn, 'many_delete_help') + '''" name="content"></textarea>
                         <hr class="main_hr">
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send" type="text">
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + await captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'edit')  + '''
                         <button type="submit">''' + get_lang(conn, 'delete') + '''</button>
                     </form>
                 ''',

+ 19 - 19
route/edit_move.py

@@ -1,25 +1,25 @@
 from .tool.func import *
 
-def edit_move(name):
+async def edit_move(name):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if acl_check(name, 'document_move') == 1:
-            return re_error(conn, 0)
+        if await acl_check(name, 'document_move') == 1:
+            return await re_error(conn, 0)
         
         if do_title_length_check(conn, name) == 1:
-            return re_error(conn, 38)
+            return await re_error(conn, 38)
 
         if flask.request.method == 'POST':
             move_title = flask.request.form.get('title', 'test')
-            if acl_check(move_title) == 1:
-                return re_error(conn, 0)
+            if await acl_check(move_title) == 1:
+                return await re_error(conn, 0)
 
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
-            if do_edit_slow_check(conn) == 1:
-                return re_error(conn, 24)
+            if await do_edit_slow_check(conn) == 1:
+                return await re_error(conn, 24)
             
             send = flask.request.form.get('send', '')
             agree = flask.request.form.get('copyright_agreement', '')
@@ -33,18 +33,18 @@ def edit_move(name):
             move_option_topic = flask.request.form.get('move_topic_option', 'none')
             document_set_option = flask.request.form.get('document_set_option', 'none')
             
-            if do_edit_send_check(conn, send) == 1:
-                return re_error(conn, 37)
+            if await do_edit_send_check(conn, send) == 1:
+                return await re_error(conn, 37)
             
             if do_edit_text_bottom_check_box_check(conn, agree) == 1:
-                return re_error(conn, 29)
+                return await re_error(conn, 29)
 
             # 역링크 관련 패치 해야할 듯
 
             # 문서 이동 파트 S
             curs.execute(db_change("select title from history where title = ?"), [move_title])
             if curs.fetchall():
-                if move_option == 'merge' and acl_check(tool = 'owner_auth', memo = 'merge documents (' + name + ') (' + move_title + ')') != 1:
+                if move_option == 'merge' and await acl_check(tool = 'owner_auth', memo = 'merge documents (' + name + ') (' + move_title + ')') != 1:
                     curs.execute(db_change("select data from data where title = ?"), [move_title])
                     data = curs.fetchall()
                     if data:
@@ -160,7 +160,7 @@ def edit_move(name):
             # 토론 이동 파트 S
             curs.execute(db_change("select title from rd where title = ?"), [move_title])
             if curs.fetchall():
-                if move_option_topic == 'merge' and acl_check(tool = 'owner_auth', memo = 'merge document\'s topics (' + name + ') (' + move_title + ')') != 1:
+                if move_option_topic == 'merge' and await acl_check(tool = 'owner_auth', memo = 'merge document\'s topics (' + name + ') (' + move_title + ')') != 1:
                     curs.execute(db_change("update rd set title = ? where title = ?"), [move_title, name])
                 elif move_option_topic == 'reverse':
                     i = 0
@@ -208,13 +208,13 @@ def edit_move(name):
             if has_error == 0:
                 return redirect(conn, '/w/' + url_pas(move_title))
             else:
-                return re_error(conn, 19)
+                return await re_error(conn, 19)
         else:
-            owner_auth = acl_check(tool = 'owner_auth')
+            owner_auth = await acl_check(tool = 'owner_auth')
             owner_auth = 1 if owner_auth == 0 else 0
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'move') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'move') + ')', 0])],
                 data = '''
                     <form method="post">
                         <span>''' + get_lang(conn, 'document_name') + '''</span>
@@ -256,7 +256,7 @@ def edit_move(name):
                             '''
                         ) if owner_auth == 1 else '') + '''
 
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + await captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'move')  + '''
                         
                         <button type="submit">''' + get_lang(conn, 'move') + '''</button>
                     </form>

+ 5 - 5
route/edit_request.py

@@ -2,12 +2,12 @@ from .tool.func import *
 
 from .view_diff import view_diff_do
 
-def edit_request(name = 'Test', do_type = ''):
+async def edit_request(name = 'Test', do_type = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         disabled = ""
-        if acl_check(name, 'document_edit') == 1:
+        if await acl_check(name, 'document_edit') == 1:
             disabled = "disabled"
 
         curs.execute(db_change("select id from history where title = ? order by id + 0 desc"), [name])
@@ -15,7 +15,7 @@ def edit_request(name = 'Test', do_type = ''):
         doc_ver = doc_ver[0][0] if doc_ver else '0'
 
         if doc_ver == '0':
-            if acl_check(name, 'document_make_acl') == 1:
+            if await acl_check(name, 'document_make_acl') == 1:
                 disabled = "disabled"
 
         curs.execute(db_change("select set_data from data_set where doc_name = ? and doc_rev = ? and set_name = 'edit_request_data'"), [name, doc_ver])
@@ -47,7 +47,7 @@ def edit_request(name = 'Test', do_type = ''):
             
             curs.execute(db_change("select id from user_set where name = 'watchlist' and data = ?"), [name])
             for scan_user in curs.fetchall():
-                add_alarm(scan_user[0], edit_request_user, '<a href="/w/' + url_pas(name) + '">' + html.escape(name) + '</a>')
+                await add_alarm(scan_user[0], edit_request_user, '<a href="/w/' + url_pas(name) + '">' + html.escape(name) + '</a>')
 
             if flask.request.form.get('check', '') == 'Y':
                 curs.execute(db_change("delete from data where title = ?"), [name])
@@ -91,7 +91,7 @@ def edit_request(name = 'Test', do_type = ''):
             result = view_diff_do(old_data, edit_request_data, 'r' + doc_ver, get_lang(conn, 'edit_request'))
 
             return easy_minify(conn, flask.render_template(skin_check(conn), 
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'edit_request_check') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'edit_request_check') + ')', 0])],
                 data = '''
                     <div id="opennamu_get_user_info">''' + html.escape(edit_request_user) + '''</div>
                     <hr class="main_hr">

+ 17 - 17
route/edit_revert.py

@@ -1,15 +1,15 @@
 from .tool.func import *
 
-def edit_revert(name, num):
+async def edit_revert(name, num):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, str(num)])
-        if curs.fetchall() and acl_check(tool = 'hidel_auth') == 1:
-            return re_error(conn, 3)
+        if curs.fetchall() and await acl_check(tool = 'hidel_auth') == 1:
+            return await re_error(conn, 3)
 
-        if acl_check(name, 'document_edit') == 1:
-            return re_error(conn, 0)
+        if await acl_check(name, 'document_edit') == 1:
+            return await re_error(conn, 0)
         
         curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
         data = curs.fetchall()
@@ -17,29 +17,29 @@ def edit_revert(name, num):
             return redirect(conn, '/w/' + url_pas(name))
 
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
-            if do_edit_slow_check(conn) == 1:
-                return re_error(conn, 24)
+            if await do_edit_slow_check(conn) == 1:
+                return await re_error(conn, 24)
             
             send = flask.request.form.get('send', '')
             agree = flask.request.form.get('copyright_agreement', '')
             
-            if do_edit_send_check(conn, send) == 1:
-                return re_error(conn, 37)
+            if await do_edit_send_check(conn, send) == 1:
+                return await re_error(conn, 37)
             
             if do_edit_text_bottom_check_box_check(conn, agree) == 1:
-                return re_error(conn, 29)
+                return await re_error(conn, 29)
 
-            if do_edit_filter(conn, data[0][0]) == 1:
-                return re_error(conn, 21)
+            if await do_edit_filter(conn, data[0][0]) == 1:
+                return await re_error(conn, 21)
             
             curs.execute(db_change("select data from other where name = 'document_content_max_length'"))
             db_data = curs.fetchall()
             if db_data and db_data[0][0] != '':
                 if int(number_check(db_data[0][0])) < len(data[0][0]):
-                    return re_error(conn, 44)
+                    return await re_error(conn, 44)
 
             curs.execute(db_change("select data from data where title = ?"), [name])
             data_old = curs.fetchall()
@@ -75,12 +75,12 @@ def edit_revert(name, num):
                 preview = ''
             
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(r' + str(num) + ') (' + get_lang(conn, 'revert') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(r' + str(num) + ') (' + get_lang(conn, 'revert') + ')', 0])],
                 data = '''
                     <form method="post">
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send" type="text">
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + await captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'revert')  + '''
                         <button type="submit">''' + get_lang(conn, 'revert') + '''</button>
                     </form>
                 ''' + preview,

+ 15 - 15
route/edit_upload.py

@@ -1,11 +1,11 @@
 from .tool.func import *
 
-def edit_upload():
+async def edit_upload():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if acl_check('', 'upload') == 1:
-            return re_error(conn, 0)
+        if await acl_check('', 'upload') == 1:
+            return await re_error(conn, 0)
         
         curs.execute(db_change('select data from other where name = "upload"'))
         db_data = curs.fetchall()
@@ -13,8 +13,8 @@ def edit_upload():
         file_max = int(file_max)
 
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
             file_data = flask.request.files.getlist("f_data[]")
             file_len = len(file_data)
@@ -24,20 +24,20 @@ def edit_upload():
                 file_size_all = 0
 
             if (file_max * 1000 * 1000 * file_len) < file_size_all or file_size_all == 0:
-                return re_error(conn, 17)
+                return await re_error(conn, 17)
 
             if file_len == 1:
                 file_num = None
             else:
-                if acl_check('', 'many_upload') == 1:
-                    return re_error(conn, 0)
+                if await acl_check('', 'many_upload') == 1:
+                    return await re_error(conn, 0)
 
                 file_num = 1
 
             for data in file_data:
                 file_name = data.filename if data.filename else ''
                 if file_name == '':
-                    return re_error(conn, 9)
+                    return await re_error(conn, 9)
                 
                 value_tmp = os.path.splitext(file_name)
                 value = ''
@@ -47,7 +47,7 @@ def edit_upload():
                 curs.execute(db_change("select html from html_filter where kind = 'extension'"))
                 extension = [i[0].lower() for i in curs.fetchall()]
                 if not re.sub(r'^\.', '', value).lower() in extension:
-                    return re_error(conn, 14)
+                    return await re_error(conn, 14)
 
                 name = ''
                 if flask.request.form.get('f_name', None):
@@ -57,13 +57,13 @@ def edit_upload():
 
                 piece = os.path.splitext(name)
                 if re.search(r'\.', piece[0]):
-                    return re_error(conn, 22)
+                    return await re_error(conn, 22)
 
                 e_data = sha224_replace(piece[0]) + piece[1]
 
                 curs.execute(db_change("select title from data where title = ?"), ['file:' + name])
                 if curs.fetchall():
-                    return re_error(conn, 16)
+                    return await re_error(conn, 16)
 
                 curs.execute(db_change("select html from html_filter where kind = 'file'"))
                 db_data = curs.fetchall()
@@ -74,7 +74,7 @@ def edit_upload():
 
                 data_url_image = load_image_url(conn)
                 if os.path.exists(os.path.join(data_url_image, e_data)):
-                    return re_error(conn, 16)
+                    return await re_error(conn, 16)
                 else:
                     data.save(os.path.join(data_url_image, e_data))
 
@@ -136,7 +136,7 @@ def edit_upload():
             upload_default = html.escape(db_data[0][0]) if db_data and db_data[0][0] != '' else ''
             
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'upload'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'upload'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <a href="/filter/file_filter">(''' + get_lang(conn, 'file_filter_list') + ''')</a> <a href="/filter/extension_filter">(''' + get_lang(conn, 'extension_filter_list') + ''')</a>
                     ''' + upload_help + '''
@@ -154,7 +154,7 @@ def edit_upload():
                         <hr class="main_hr">
                         <textarea class="opennamu_textarea_100" placeholder="''' + get_lang(conn, 'other') + '''" name="f_lice">''' + upload_default + '''</textarea>
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + '''
+                        ''' + await captcha_get(conn) + '''
                         <button id="opennamu_save_button" type="submit">''' + get_lang(conn, 'save') + '''</button>
                     </form>
                 ''',

+ 5 - 5
route/filter_all.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def filter_all(tool):
+async def filter_all(tool):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -13,12 +13,12 @@ def filter_all(tool):
 
         div += '</tr>'
 
-        admin = acl_check(tool = 'owner_auth')
+        admin = await acl_check(tool = 'owner_auth')
         admin = 1 if admin == 0 else 0
 
         if tool == 'edit_filter':
-            if acl_check('', 'edit_filter_view', '', '') == 1:
-                return re_error(conn, 0)
+            if await acl_check('', 'edit_filter_view', '', '') == 1:
+                return await re_error(conn, 0)
 
         if tool == 'inter_wiki':
             title = get_lang(conn, 'interwiki_list')
@@ -88,7 +88,7 @@ def filter_all(tool):
             div += '<a href="/filter/' + tool + '/add">(' + get_lang(conn, 'add') + ')</a>'
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [title, wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [title, wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = div,
             menu = [['manager/1', get_lang(conn, 'return')]]
         ))

+ 20 - 20
route/filter_all_add.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def filter_all_add(tool, name = None):
+async def filter_all_add(tool, name = None):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -8,8 +8,8 @@ def filter_all_add(tool, name = None):
             return redirect(conn, '/manager/9')
 
         if flask.request.method == 'POST':
-            if acl_check('', 'owner_auth', '', '') == 1:
-                return re_error(conn, 3)
+            if await acl_check('', 'owner_auth', '', '') == 1:
+                return await re_error(conn, 3)
 
             title = flask.request.form.get('title', 'test')
             if tool in ('inter_wiki', 'outer_link'):
@@ -23,7 +23,7 @@ def filter_all_add(tool, name = None):
                     curs.execute(db_change("delete from html_filter where html = ? and kind = 'inter_wiki_sub'"), [title])
                     curs.execute(db_change('insert into html_filter (html, plus, plus_t, kind) values (?, "inter_wiki_type", ?, "inter_wiki_sub")'), [title, inter_type])
                 
-                acl_check(tool = 'owner_auth', memo = tool + ' edit')
+                await acl_check(tool = 'owner_auth', memo = tool + ' edit')
             elif tool == 'edit_filter':
                 day = flask.request.form.get('day', '0')
                 end = 'X' if day == '0' else day
@@ -35,11 +35,11 @@ def filter_all_add(tool, name = None):
                 try:
                     re.compile(content)
                 except:
-                    return re_error(conn, 23)
+                    return await re_error(conn, 23)
                 
                 curs.execute(db_change("delete from html_filter where html = ? and kind = 'regex_filter'"), [name])
                 curs.execute(db_change("insert into html_filter (html, plus, plus_t, kind) values (?, ?, ?, 'regex_filter')"), [name, content, end])
-                acl_check(tool = 'owner_auth', memo = 'edit_filter edit')
+                await acl_check(tool = 'owner_auth', memo = 'edit_filter edit')
             elif tool == 'document':
                 post_name = flask.request.form.get('name', '')
                 if post_name == '':
@@ -50,46 +50,46 @@ def filter_all_add(tool, name = None):
                 try:
                     re.compile(post_regex)
                 except:
-                    return re_error(conn, 23)
+                    return await re_error(conn, 23)
                 
                 curs.execute(db_change('insert into html_filter (html, kind, plus, plus_t) values (?, "document", ?, ?)'), [post_name, post_regex, post_acl])
-                acl_check(tool = 'owner_auth', memo = 'document_filter edit')
+                await acl_check(tool = 'owner_auth', memo = 'document_filter edit')
             else:
                 plus_d = ''
                 if tool == 'name_filter':
                     try:
                         re.compile(title)
                     except:
-                        return re_error(conn, 23)
+                        return await re_error(conn, 23)
 
-                    acl_check(tool = 'owner_auth', memo = 'name_filter edit')
+                    await acl_check(tool = 'owner_auth', memo = 'name_filter edit')
                     type_d = 'name'
                 elif tool == 'file_filter':
                     try:
                         re.compile(title)
                     except:
-                        return re_error(conn, 23)
+                        return await re_error(conn, 23)
 
-                    acl_check(tool = 'owner_auth', memo = 'file_filter edit')
+                    await acl_check(tool = 'owner_auth', memo = 'file_filter edit')
                     type_d = 'file'
                 elif tool == 'email_filter':
-                    acl_check(tool = 'owner_auth', memo = 'email_filter edit')
+                    await acl_check(tool = 'owner_auth', memo = 'email_filter edit')
                     type_d = 'email'
                 elif tool == 'image_license':
-                    acl_check(tool = 'owner_auth', memo = 'image_license edit')
+                    await acl_check(tool = 'owner_auth', memo = 'image_license edit')
                     type_d = 'image_license'
                 elif tool == 'extension_filter':
-                    acl_check(tool = 'owner_auth', memo = 'extension_filter edit')
+                    await acl_check(tool = 'owner_auth', memo = 'extension_filter edit')
                     type_d = 'extension'
                     plus_d = flask.request.form.get('max_file_size', '')
                     if plus_d != '':
                         plus_d = number_check(plus_d)
                 elif tool == 'template':
-                    acl_check(tool = 'owner_auth', memo = 'template_document edit')
+                    await acl_check(tool = 'owner_auth', memo = 'template_document edit')
                     type_d = 'template'
                     plus_d = flask.request.form.get('exp', 'test')
                 else:
-                    acl_check(tool = 'owner_auth', memo = 'edit_top edit')
+                    await acl_check(tool = 'owner_auth', memo = 'edit_top edit')
                     type_d = 'edit_top'
                     plus_d = flask.request.form.get('markup', 'test')
 
@@ -101,7 +101,7 @@ def filter_all_add(tool, name = None):
             return redirect(conn, '/filter/' + tool)
         else:
             get_sub = 0
-            stat = 'disabled' if acl_check('', 'owner_auth', '', '') == 1 else ''
+            stat = 'disabled' if await acl_check('', 'owner_auth', '', '') == 1 else ''
             name = name if name else ''
 
             if tool in ('inter_wiki', 'outer_link'):
@@ -208,7 +208,7 @@ def filter_all_add(tool, name = None):
                     '<input value="" type="text" name="max_file_size">' + \
                 ''
             elif tool == 'document':
-                acl_list = get_acl_list()
+                acl_list = await get_acl_list()
                 
                 curs.execute(db_change("select plus, plus_t from html_filter where html = ? and kind = 'document'"), [name])
                 db_data = curs.fetchall()
@@ -269,7 +269,7 @@ def filter_all_add(tool, name = None):
                 '''
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [title, wiki_set(conn), wiki_custom(conn), wiki_css([get_sub, 0])],
+                imp = [title, wiki_set(conn), await wiki_custom(conn), wiki_css([get_sub, 0])],
                 data =  '''
                         <form method="post">
                             ''' + form_data + '''

+ 3 - 3
route/filter_all_delete.py

@@ -1,11 +1,11 @@
 from .tool.func import *
 
-def filter_all_delete(tool, name = 'Test'):
+async def filter_all_delete(tool, name = 'Test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
         
-        if acl_check(tool = 'owner_auth', memo = 'del_' + tool) == 1:
-            return re_error(conn, 3)
+        if await acl_check(tool = 'owner_auth', memo = 'del_' + tool) == 1:
+            return await re_error(conn, 3)
 
         if tool == 'inter_wiki':
             curs.execute(db_change("delete from html_filter where html = ? and kind = 'inter_wiki'"), [name])

+ 6 - 6
route/give_admin_groups.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def give_admin_groups(name = 'test'):
+async def give_admin_groups(name = 'test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -69,11 +69,11 @@ def give_admin_groups(name = 'test'):
         ]
 
         if html.escape(name) != name:
-            return re_error(conn, 48)
+            return await re_error(conn, 48)
 
         if flask.request.method == 'POST':
-            if acl_check(tool = 'owner_auth', memo = 'auth list add (' + name + ')') == 1:
-                return re_error(conn, 3)
+            if await acl_check(tool = 'owner_auth', memo = 'auth list add (' + name + ')') == 1:
+                return await re_error(conn, 3)
 
             curs.execute(db_change("delete from alist where name = ?"), [name])
             for for_a in acl_name_list:
@@ -84,7 +84,7 @@ def give_admin_groups(name = 'test'):
 
             return redirect(conn, '/auth/list/add/' + url_pas(name))
         else:
-            state = 'disabled' if acl_check('', 'owner_auth', '', '') == 1 else ''
+            state = 'disabled' if await acl_check('', 'owner_auth', '', '') == 1 else ''
 
             curs.execute(db_change('select acl from alist where name = ?'), [name])
             acl_list = curs.fetchall()
@@ -109,7 +109,7 @@ def give_admin_groups(name = 'test'):
             data += '</ul>'
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'admin_group') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'admin_group') + ')', 0])],
                 data = '''
                     <form method="post">
                         ''' + data + '''

+ 6 - 6
route/give_delete_admin_group.py

@@ -1,28 +1,28 @@
 from .tool.func import *
 
-def give_delete_admin_group_2(name = 'test'):
+async def give_delete_admin_group_2(name = 'test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         if name in get_default_admin_group():
             return redirect(conn, '/auth/list')
 
-        if acl_check('', 'owner_auth', '', '') == 1:
-            return re_error(conn, 3)
+        if await acl_check('', 'owner_auth', '', '') == 1:
+            return await re_error(conn, 3)
 
         if flask.request.method == 'POST':
             curs.execute(db_change("select name from user_set where name = 'acl' and data = ? limit 1"), [name])
             if not curs.fetchall():
-                acl_check(tool = 'owner_auth', memo = 'auth list delete (' + name + ')')
+                await acl_check(tool = 'owner_auth', memo = 'auth list delete (' + name + ')')
 
                 curs.execute(db_change("delete from alist where name = ?"), [name])
 
                 return redirect(conn, '/auth/list')
             else:
-                return re_error(conn, 47)
+                return await re_error(conn, 47)
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, "delete_admin_group"), wiki_set(conn), wiki_custom(conn), wiki_css(['(' + name + ')', 0])],
+                imp = [get_lang(conn, "delete_admin_group"), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + name + ')', 0])],
                 data = '' + \
                     '<form method="post">' + \
                         '<button type="submit">' + get_lang(conn, 'delete') + '</button>' + \

+ 16 - 16
route/give_user_ban.py

@@ -1,17 +1,17 @@
 from .tool.func import *
 
-def give_user_ban(name = None, ban_type = ''):
+async def give_user_ban(name = None, ban_type = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         ip = ip_check()
         
-        if ban_check(ip = ip, tool = 'login')[0] == 1:
-            if ip_or_user(ip) == 1 or acl_check(tool = 'all_admin_auth', ip = ip) != 0:
-                return re_error(conn, 0)
+        if (await ban_check(ip = ip, tool = 'login'))[0] == 1:
+            if ip_or_user(ip) == 1 or await acl_check(tool = 'all_admin_auth', ip = ip) != 0:
+                return await re_error(conn, 0)
         else:
-            if acl_check(tool = 'ban_auth', ip = ip) == 1:
-                return re_error(conn, 3)
+            if await acl_check(tool = 'ban_auth', ip = ip) == 1:
+                return await re_error(conn, 3)
 
         if flask.request.method == 'POST':
             end = '0'
@@ -63,7 +63,7 @@ def give_user_ban(name = None, ban_type = ''):
                     try:
                         re.compile(name)
                     except:
-                        return re_error(conn, 23)
+                        return await re_error(conn, 23)
                 elif regex_get == 'cidr':
                     type_d = 'cidr'
 
@@ -73,22 +73,22 @@ def give_user_ban(name = None, ban_type = ''):
                         try:
                             ipaddress.IPv6Network(name, False)
                         except:
-                            return re_error(conn, 45)
+                            return await re_error(conn, 45)
                 elif regex_get == 'private':
                     type_d = 'private'
 
-                    if acl_check(tool = 'owner_auth', ip = ip) == 1:
-                        return re_error(conn, 0)
+                    if await acl_check(tool = 'owner_auth', ip = ip) == 1:
+                        return await re_error(conn, 0)
                 else:
                     type_d = None
 
                 if regex_get != 'private':
                     if name == ip:
-                        if acl_check(tool = 'all_admin_auth', memo = 'ban (' + name + ')') == 1:
-                            return re_error(conn, 3)
+                        if await acl_check(tool = 'all_admin_auth', memo = 'ban (' + name + ')') == 1:
+                            return await re_error(conn, 3)
                     else:
-                        if acl_check(tool = 'ban_auth', memo = 'ban (' + name + ')') == 1:
-                            return re_error(conn, 3)
+                        if await acl_check(tool = 'ban_auth', memo = 'ban (' + name + ')') == 1:
+                            return await re_error(conn, 3)
 
                 ban_insert(conn, 
                     name,
@@ -128,11 +128,11 @@ def give_user_ban(name = None, ban_type = ''):
                     info_data = '<div id="opennamu_get_user_info">' + html.escape(name) + '</div>'
 
             owner_option = ''
-            if acl_check(tool = 'owner_auth', ip = ip) != 1:
+            if await acl_check(tool = 'owner_auth', ip = ip) != 1:
                 owner_option = '<option value="private" ' + ('selected' if ban_type == 'private' else '') + '>' + get_lang(conn, 'private') + '</option>'
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [main_name, wiki_set(conn), wiki_custom(conn), wiki_css([now, 0])],
+                imp = [main_name, wiki_set(conn), await wiki_custom(conn), wiki_css([now, 0])],
                 data = info_data + '''
                     <form method="post" ''' + action + '''>
                         <h2>''' + get_lang(conn, 'method') + '''</h2>

+ 8 - 8
route/give_user_fix.py

@@ -1,20 +1,20 @@
 from .tool.func import *
 
-def give_user_fix(user_name = ''):
+async def give_user_fix(user_name = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         curs.execute(db_change("select data from user_set where id = ? and name = 'pw'"), [user_name])
         if not curs.fetchall():
-            return re_error(conn, 2)
+            return await re_error(conn, 2)
 
-        if acl_check('', 'owner_auth', '', '') == 1:
-            return re_error(conn, 3)
+        if await acl_check('', 'owner_auth', '', '') == 1:
+            return await re_error(conn, 3)
 
         if flask.request.method == 'POST':
             select = flask.request.form.get('select', '')
 
-            acl_check(tool = 'owner_auth', memo = 'user_fix (' + user_name + ') (' + select + ')')
+            await acl_check(tool = 'owner_auth', memo = 'user_fix (' + user_name + ') (' + select + ')')
             if select == 'password_change':
                 password = flask.request.form.get('new_password', '')
                 check_password = flask.request.form.get('password_check', '')
@@ -26,7 +26,7 @@ def give_user_fix(user_name = ''):
                         user_name
                     ])
                 else:
-                    return re_error(conn, 20)
+                    return await re_error(conn, 20)
             elif select == '2fa_password_change':
                 password = flask.request.form.get('new_password', '')
                 check_password = flask.request.form.get('password_check', '')
@@ -39,7 +39,7 @@ def give_user_fix(user_name = ''):
                     else:
                         curs.execute(db_change("insert into user_set (name, id, data) values ('2fa_pw', ?, ?)"), [user_name, hashed])
                 else:
-                    return re_error(conn, 20)
+                    return await re_error(conn, 20)
             elif select == '2fa_off':
                 curs.execute(db_change('select data from user_set where name = "2fa" and id = ?'), [user_name])
                 if curs.fetchall():
@@ -48,7 +48,7 @@ def give_user_fix(user_name = ''):
             return redirect(conn, '/user/' + url_pas(user_name))
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'user_fix'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'user_fix'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         <div id="opennamu_get_user_info">''' + html.escape(user_name) + '''</div>

+ 1 - 1
route/go_api_bbs.py

@@ -6,4 +6,4 @@ async def api_bbs(bbs_num = "", page = 1):
     other_set["page"] = str(page)
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_bbs_list.py

@@ -1,4 +1,4 @@
 from .tool.func import *
 
 async def api_bbs_list():
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name))

+ 5 - 2
route/go_api_bbs_w.py

@@ -1,9 +1,12 @@
 from .tool.func import *
 
-def api_bbs_w(sub_code = '', legacy = 'on'):
+async def api_bbs_w(sub_code = '', legacy = 'on'):
     other_set = {}
     other_set['ip'] = ip_check()
     other_set["legacy"] = legacy
     other_set['sub_code'] = sub_code
 
-    return flask.Response(response = python_to_golang_sync(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_bbs_w_exter(sub_code = '', legacy = 'on'):
+    return flask.jsonify(await api_bbs_w(sub_code, legacy))

+ 4 - 1
route/go_api_bbs_w_comment.py

@@ -7,4 +7,7 @@ async def api_bbs_w_comment(sub_code = '', tool = "", legacy = 'on'):
     other_set["legacy"] = legacy
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_bbs_w_comment_exter(sub_code = '', tool = "", legacy = 'on'):
+    return flask.jsonify(await api_bbs_w_comment(sub_code, tool, legacy))

+ 4 - 1
route/go_api_bbs_w_comment_one.py

@@ -7,4 +7,7 @@ async def api_bbs_w_comment_one(sub_code = '', legacy = 'on', tool = ''):
     other_set["tool"] = tool
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_bbs_w_comment_one_exter(sub_code = '', legacy = 'on', tool = ''):
+    return flask.jsonify(await api_bbs_w_comment_one(sub_code, legacy, tool))

+ 1 - 1
route/go_api_bbs_w_set.py

@@ -11,4 +11,4 @@ async def api_bbs_w_set(name = 'Test', bbs_num = 1):
         func_name += '_put'
         other_set['data'] = flask.request.form.get('data', 'Test')
     
-    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(func_name, other_set))

+ 1 - 1
route/go_api_bbs_w_tabom.py

@@ -9,4 +9,4 @@ async def api_bbs_w_tabom(sub_code = ''):
     if flask.request.method == 'POST':
         func_name += '_post'
 
-    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(func_name, other_set))

+ 1 - 1
route/go_api_func_auth.py

@@ -4,4 +4,4 @@ async def api_func_auth(user_name = ''):
     other_set = {}
     other_set["ip"] = ip_check() if user_name == '' else user_name
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 19 - 0
route/go_api_func_email.py

@@ -0,0 +1,19 @@
+from .tool.func import *
+
+async def api_func_email():
+    if flask.request.method == 'POST':
+        func_name = sys._getframe().f_code.co_name
+        func_name += '_post'
+
+        other_set = {}
+        other_set["ip"] = ip_check()
+        other_set["who"] = flask.request.form.get('email', '')
+        other_set["title"] = flask.request.form.get('title', '')
+        other_set["data"] = flask.request.form.get('data', '')
+
+        return await python_to_golang(func_name, other_set)
+    else:
+        return {}
+
+async def api_func_email_exter():
+    return flask.jsonify(await api_func_email())

+ 1 - 1
route/go_api_func_ip.py

@@ -21,4 +21,4 @@ async def api_func_ip(data = 'Test'):
     else:
         other_set["data"] = data
 
-    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(func_name, other_set))

+ 1 - 1
route/go_api_func_ip_menu.py

@@ -6,4 +6,4 @@ async def api_func_ip_menu(ip = "Test", option = ""):
     other_set["my_ip"] = ip_check()
     other_set["option"] = option
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_func_language.py

@@ -10,4 +10,4 @@ async def api_func_language(legacy = 'on', data = 'Test'):
 
     other_set["legacy"] = legacy
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_func_llm.py

@@ -6,6 +6,6 @@ async def api_func_llm():
         other_set["prompt"] = flask.request.form.get('prompt', '')
         other_set["ip"] = ip_check()
 
-        return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+        return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))
     else:
         return flask.jsonify({})

+ 4 - 1
route/go_api_func_search.py

@@ -6,4 +6,7 @@ async def api_func_search(name = 'Test', search_type = 'title', num = 1):
     other_set["search_type"] = search_type
     other_set["num"] = str(num)
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_func_search_exter(name = 'Test', search_type = 'title', num = 1):
+    return flask.jsonify(await api_func_search(name, search_type, num))

+ 1 - 1
route/go_api_func_sha224.py

@@ -4,4 +4,4 @@ async def api_func_sha224(data = 'Test'):
     other_set = {}
     other_set["data"] = data
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_give_auth.py

@@ -11,6 +11,6 @@ async def api_give_auth():
         other_set['auth'] = flask.request.form.get('auth', '')
         other_set['change_auth'] = flask.request.form.get('change_auth', '')
 
-        return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')
+        return flask.jsonify(await python_to_golang(func_name, other_set))
     else:
         return flask.jsonify({}) 

+ 1 - 1
route/go_api_list_acl.py

@@ -4,4 +4,4 @@ async def api_list_acl(data_type = ''):
     other_set = {}
     other_set = data_type
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_list_auth.py

@@ -3,4 +3,4 @@ from .tool.func import *
 async def api_list_auth():
     other_set = {}
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_list_history.py

@@ -7,4 +7,4 @@ async def api_list_history(num = 1, set_type = 'normal', doc_name = 'Test'):
     other_set["set_type"] = set_type
     other_set["ip"] = ip_check()
     
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 3
route/go_api_list_markup.py

@@ -1,6 +1,4 @@
 from .tool.func import *
 
 async def api_list_markup():
-    other_set = {}
-
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name))

+ 1 - 1
route/go_api_list_old_page.py

@@ -5,4 +5,4 @@ async def api_list_old_page(num = 1, set_type = 'old'):
     other_set["num"] = str(num)
     other_set["set_type"] = set_type
     
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_list_recent_block.py

@@ -8,4 +8,4 @@ async def api_list_recent_block(num = 1, set_type = 'all', user_name = 'Test', w
     other_set["why"] = why
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_list_recent_change.py

@@ -8,7 +8,7 @@ async def api_list_recent_change(num = 1, set_type = 'normal', limit = 10, legac
     other_set["legacy"] = legacy
     other_set["ip"] = ip_check()
 
-    response = flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    response = flask.make_response(flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set)))
     
     response.headers.add("Access-Control-Allow-Origin", "*")
     response.headers.add('Access-Control-Allow-Headers', "Content-Type")

+ 1 - 1
route/go_api_list_recent_discuss.py

@@ -8,7 +8,7 @@ async def api_list_recent_discuss(num = 1, set_type = 'normal', limit = 10, lega
     other_set["legacy"] = legacy
     other_set["ip"] = ip_check()
 
-    response = flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    response = flask.make_response(flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set)))
     
     response.headers.add("Access-Control-Allow-Origin", "*")
     response.headers.add('Access-Control-Allow-Headers', "Content-Type")

+ 4 - 1
route/go_api_list_recent_edit_request.py

@@ -7,4 +7,7 @@ async def api_list_recent_edit_request(num = 1, set_type = 'normal', limit = 50)
     other_set["set_type"] = set_type
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_list_recent_edit_request_exter(num = 1, set_type = 'normal', limit = 50):
+    return flask.jsonify(await api_list_recent_edit_request_exter(num, set_type, limit))

+ 1 - 1
route/go_api_list_title_index.py

@@ -4,4 +4,4 @@ async def api_list_title_index(num = 1):
     other_set = {}
     other_set["num"] = str(num)
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_setting.py

@@ -10,4 +10,4 @@ async def api_setting(name = 'Test'):
         func_name += '_put'
         other_set['data'] = flask.request.form.get('data', 'Test')
     
-    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(func_name, other_set))

+ 7 - 7
route/go_api_topic.py

@@ -38,7 +38,7 @@ def api_topic_thread_make(user_id, date, data, code, color = '', blind = '', add
         </span>
     '''
 
-def api_topic_thread_pre_render(conn, data, num, ip, topic_num = '', name = '', sub = '', do_type = 'thread'):
+async def api_topic_thread_pre_render(conn, data, num, ip, topic_num = '', name = '', sub = '', do_type = 'thread'):
     curs = conn.cursor()
 
     # 이거 좀 엉성해서 언젠간 손 보고 싶음
@@ -79,12 +79,12 @@ def api_topic_thread_pre_render(conn, data, num, ip, topic_num = '', name = '',
             ip_data = curs.fetchall()
             if ip_data and ip_or_user(ip_data[0][0]) == 0:
                 if do_type == 'thread':
-                    add_alarm(ip_data[0][0], ip, '<a href="/thread/' + topic_num + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
+                    await add_alarm(ip_data[0][0], ip, '<a href="/thread/' + topic_num + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
                 else:
                     set_id = topic_num.split('-')
                     set_id = ['', ''] if len(set_id) < 2 else set_id
 
-                    add_alarm(ip_data[0][0], ip, 'BBS <a href="/bbs/w/' + set_id[0] + '/' + set_id[1] + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
+                    await add_alarm(ip_data[0][0], ip, 'BBS <a href="/bbs/w/' + set_id[0] + '/' + set_id[1] + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
 
             data = re.sub(call_thread_regex, rd_data[0] + '<topic_a_' + do_type + '>#' + view_data + '</topic_a_' + do_type + '>' + rd_data[3], data, 1)
 
@@ -109,10 +109,10 @@ def api_topic_thread_pre_render(conn, data, num, ip, topic_num = '', name = '',
 
             if ip_data and ip_or_user(ip_data[0][0]) == 0:
                 if do_type == 'thread':
-                    add_alarm(ip_data[0][0], ip, '<a href="/thread/' + topic_num + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
+                    await add_alarm(ip_data[0][0], ip, '<a href="/thread/' + topic_num + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
                 else:
                     set_id = topic_num.split('-')
-                    add_alarm(ip_data[0][0], ip, 'BBS <a href="/bbs/w/' + set_id[0] + '/' + set_id[1] + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
+                    await add_alarm(ip_data[0][0], ip, 'BBS <a href="/bbs/w/' + set_id[0] + '/' + set_id[1] + '#' + num + '">' + html.escape(name) + ' - ' + html.escape(sub) + '#' + num + '</a>')
 
             data = re.sub(call_user_regex, rd_data[0] + '<topic_call>@' + rd_data[1] + '</topic_call>' + rd_data[2], data, 1)
 
@@ -124,7 +124,7 @@ async def api_topic(topic_num = 1, tool = 'normal', s_num = '', e_num = ''):
     with get_db_connect() as conn:
         topic_num = str(topic_num)
 
-        if acl_check('', 'topic_view', topic_num) != 1:
+        if await acl_check('', 'topic_view', topic_num) != 1:
             other_set = {}
             other_set["topic_num"] = topic_num
             other_set["tool"] = tool
@@ -132,6 +132,6 @@ async def api_topic(topic_num = 1, tool = 'normal', s_num = '', e_num = ''):
             other_set["e_num"] = str(e_num)
             other_set["ip"] = ip_check()
 
-            return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+            return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))
         else:
             return flask.jsonify({})

+ 1 - 1
route/go_api_topic_list.py

@@ -6,4 +6,4 @@ async def api_topic_list(name = 'Test', set_type = 'normal', num = 1):
     other_set["set_type"] = set_type
     other_set["num"] = str(num)
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_user_rankup.py

@@ -8,4 +8,4 @@ async def api_user_rankup():
     if flask.request.method == 'PATCH':
         func_name += '_patch'
 
-    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(func_name, other_set))

+ 1 - 1
route/go_api_user_setting_editor.py

@@ -12,4 +12,4 @@ async def api_user_setting_editor():
         func_name += '_delete'
         other_set['data'] = flask.request.form.get('data', 'Test')
 
-    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(func_name, other_set))

+ 1 - 1
route/go_api_w_page_view.py

@@ -4,4 +4,4 @@ async def api_w_page_view(name = 'Test'):
     other_set = {}
     other_set["doc_name"] = name
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 4 - 1
route/go_api_w_random.py

@@ -1,4 +1,7 @@
 from .tool.func import *
 
 async def api_w_random():
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name)), status = 200, mimetype = 'application/json')
+    return await python_to_golang(sys._getframe().f_code.co_name)
+
+async def api_w_random_exter():
+    return flask.jsonify(await api_w_random())

+ 4 - 1
route/go_api_w_raw.py

@@ -7,4 +7,7 @@ async def api_w_raw(name = 'Test', rev = '', exist_check = ''):
     other_set["exist_check"] = exist_check
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_w_raw_exter(name = 'Test', rev = '', exist_check = ''):
+    return flask.jsonify(await api_w_raw(name, rev, exist_check))

+ 7 - 4
route/go_api_w_render.py

@@ -81,16 +81,19 @@ async def api_w_render(name = '', tool = '', request_method = '', request_data =
                     data_type = data_type
                 )
 
-                return flask.jsonify({
+                return {
                     "data" : data_pas[0], 
                     "js_data" : data_pas[1]
-                })
+                }
             else:
                 other_set = {}
                 other_set["doc_name"] = name
                 other_set["render_type"] = data_type
                 other_set["data"] = data_org
 
-                return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+                return await python_to_golang(sys._getframe().f_code.co_name, other_set)
         else:
-            return flask.jsonify({})
+            return {}
+
+async def api_w_render_exter(name = '', tool = '', request_method = '', request_data = {}):
+    return flask.jsonify(await api_w_render(name, tool, request_method, request_data))

+ 1 - 1
route/go_api_w_set_reset.py

@@ -5,4 +5,4 @@ async def api_w_set_reset(name = 'Test'):
     other_set["name"] = name
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_w_watch_list.py

@@ -7,4 +7,4 @@ async def api_w_watch_list(name = 'Test', do_type = 'watch_list', num = 1):
     other_set["ip"] = ip_check()
     other_set["num"] = str(num)
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 1 - 1
route/go_api_w_xref.py

@@ -6,4 +6,4 @@ async def api_w_xref(name = 'Test', page = 1, xref_type = '1'):
     other_set["page"] = str(page)
     other_set["do_type"] = xref_type
 
-    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
+    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))

+ 2 - 2
route/go_main_func_easter_egg.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def main_func_easter_egg():
+async def main_func_easter_egg():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -28,7 +28,7 @@ def main_func_easter_egg():
             data = ''
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = ['Easter Egg', wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = ['Easter Egg', wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = data,
             menu = 0
         ))

+ 2 - 2
route/list_acl.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_acl(arg_num = 1):
+async def list_acl(arg_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -33,7 +33,7 @@ def list_acl(arg_num = 1):
         div += next_fix(conn, '/list/document/acl/', arg_num, list_data)
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'acl_document_list'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'acl_document_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = div,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 3 - 3
route/list_admin.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_admin():
+async def list_admin():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -11,7 +11,7 @@ def list_admin():
         ))
         for data in curs.fetchall():
             name = '' + \
-                ip_pas(data[0]) + ' ' + \
+                await ip_pas(data[0]) + ' ' + \
                 '<a href="/auth/list/add/' + url_pas(data[1]) + '">(' + data[1] + ')</a>' + \
             ''
 
@@ -20,7 +20,7 @@ def list_admin():
         div += '</ul>'
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'admin_list'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'admin_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = div,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 4 - 4
route/list_admin_auth_use.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_admin_auth_use(arg_num = 1, arg_search = 'normal'):
+async def list_admin_auth_use(arg_num = 1, arg_search = 'normal'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -26,13 +26,13 @@ def list_admin_auth_use(arg_num = 1, arg_search = 'normal'):
                     curs.execute(db_change("select data from other where name = 'ip_view'"))
                     db_data = curs.fetchall()
                     ip_view = db_data[0][0] if db_data else ''
-                    ip_view = '' if acl_check(tool = 'ban_auth') != 1 else ip_view
+                    ip_view = '' if await acl_check(tool = 'ban_auth') != 1 else ip_view
                     
                     if ip_view != '':
                         do_data = do_data.split(' ')
                         do_data = do_data[0] if do_data[0] in ('ban') else data[1]
 
-                list_data += '<li>' + ip_pas(data[0]) + ' | ' + html.escape(do_data) + ' | ' + data[2] + '</li>'
+                list_data += '<li>' + await ip_pas(data[0]) + ' | ' + html.escape(do_data) + ' | ' + data[2] + '</li>'
 
             list_data += '</ul>'
             list_data += get_next_page_bottom(conn, '/list/admin/auth_use_page/{}/' + url_pas(arg_search), arg_num, get_list)
@@ -40,7 +40,7 @@ def list_admin_auth_use(arg_num = 1, arg_search = 'normal'):
             arg_search = html.escape(arg_search) if arg_search != 'normal' else ''
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'authority_use_list'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'authority_use_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         <input class="opennamu_width_200" name="search" placeholder="''' + get_lang(conn, 'start_with_search') + '''" value="''' + arg_search + '''">

+ 3 - 3
route/list_admin_group.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_admin_group_2():
+async def list_admin_group_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -9,7 +9,7 @@ def list_admin_group_2():
 
         curs.execute(db_change("select distinct name from alist order by name asc"))
         for data in curs.fetchall():
-            if acl_check('', 'owner_auth', '', '') != 1 and not data[0] in org_acl_list:
+            if await acl_check('', 'owner_auth', '', '') != 1 and not data[0] in org_acl_list:
                 delete_admin_group = ' <a href="/auth/list/delete/' + url_pas(data[0]) + '">(' + get_lang(conn, "delete") + ')</a>'
             else:
                 delete_admin_group = ''
@@ -28,7 +28,7 @@ def list_admin_group_2():
         ''
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'admin_group_list'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'admin_group_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = list_data,
             menu = [['manager', get_lang(conn, 'return')]]
         ))

+ 2 - 2
route/list_image_file.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_image_file(arg_num = 1, do_type = 0):
+async def list_image_file(arg_num = 1, do_type = 0):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -59,7 +59,7 @@ def list_image_file(arg_num = 1, do_type = 0):
             list_data += next_fix(conn, '/list/image/', arg_num, data_list)
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'image_file_list'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'image_file_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = list_data,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 2 - 2
route/list_long_page.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_long_page(tool = 'long_page', arg_num = 1):
+async def list_long_page(tool = 'long_page', arg_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -26,7 +26,7 @@ def list_long_page(tool = 'long_page', arg_num = 1):
         div += '</ul>' + next_fix(conn, '/list/document/' + ('long' if title == 'long_page' else 'short') + '/', arg_num, n_list)
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, title), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, title), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = div,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 2 - 2
route/list_no_link.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_no_link(num = 1):
+async def list_no_link(num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
         
@@ -24,7 +24,7 @@ def list_no_link(num = 1):
         div += '</ul>' + next_fix(conn, '/list/document/no_link/', num, n_list)
         
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'no_link_document_list'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'no_link_document_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = div,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 2 - 2
route/list_please.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_please(arg_num = 1):
+async def list_please(arg_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -20,7 +20,7 @@ def list_please(arg_num = 1):
         div += '</ul>' + next_fix(conn, '/list/document/need/', arg_num, data_list)
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'need_document'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'need_document'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = div,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 2 - 2
route/list_title_index.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_title_index(num = 1):
+async def list_title_index(num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -59,7 +59,7 @@ def list_title_index(num = 1):
         sub = ' (' + str(num) + ')'
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'all_document_list'), wiki_set(conn), wiki_custom(conn), wiki_css([sub, 0])],
+            imp = [get_lang(conn, 'all_document_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([sub, 0])],
             data = data,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 3 - 3
route/list_user.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_user(arg_num = 1):
+async def list_user(arg_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -12,14 +12,14 @@ def list_user(arg_num = 1):
         user_list = curs.fetchall()
         for data in user_list:
             list_data += '<li>'
-            list_data += ip_pas(data[0])
+            list_data += await ip_pas(data[0])
             list_data += ' | ' + data[1] if data[1] != '' else ''
             list_data += '</li>'
 
         list_data += '</ul>' + next_fix(conn, '/list/user/', arg_num, user_list)
 
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'member_list'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'member_list'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = list_data,
             menu = [['other', get_lang(conn, 'return')]]
         ))

+ 8 - 8
route/list_user_check.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def list_user_check(name = 'test', plus_name = None, arg_num = 1, do_type = 'normal'):
+async def list_user_check(name = 'test', plus_name = None, arg_num = 1, do_type = 'normal'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -12,14 +12,14 @@ def list_user_check(name = 'test', plus_name = None, arg_num = 1, do_type = 'nor
         num = arg_num
         sql_num = (num * 50 - 50) if num * 50 > 0 else 0
 
-        if acl_check(tool = 'all_admin_auth', ip = name) != 1 or (plus_id and acl_check(tool = 'all_admin_auth', ip = plus_id) != 1):
-            if acl_check('', 'owner_auth', '', '') == 1:
-                return re_error(conn, 4)
+        if await acl_check(tool = 'all_admin_auth', ip = name) != 1 or (plus_id and await acl_check(tool = 'all_admin_auth', ip = plus_id) != 1):
+            if await acl_check('', 'owner_auth', '', '') == 1:
+                return await re_error(conn, 4)
 
         div = ''
 
-        if acl_check(tool = 'check_auth', memo = (check_type + ' ' if check_type != '' else '') + 'check (' + name + ')') == 1:
-            return re_error(conn, 3)
+        if await acl_check(tool = 'check_auth', memo = (check_type + ' ' if check_type != '' else '') + 'check (' + name + ')') == 1:
+            return await re_error(conn, 3)
 
         if check_type == '':
             if ip_or_user(name) == 0:
@@ -156,7 +156,7 @@ def list_user_check(name = 'test', plus_name = None, arg_num = 1, do_type = 'nor
                 name += ', ' + plus_id
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'check') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'check') + ')', 0])],
                 data = div,
                 menu = [['manager', get_lang(conn, 'return')]]
             ))
@@ -185,7 +185,7 @@ def list_user_check(name = 'test', plus_name = None, arg_num = 1, do_type = 'nor
             '' + div
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'simple_check') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'simple_check') + ')', 0])],
                 data = div,
                 menu = [['check/' + url_pas(name), get_lang(conn, 'return')]]
             ))

+ 4 - 4
route/list_user_check_delete.py

@@ -1,11 +1,11 @@
 from .tool.func import *
 
-def list_user_check_delete(name = None, ip = None, time = None, do_type = 1):
+async def list_user_check_delete(name = None, ip = None, time = None, do_type = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if acl_check('', 'owner_auth', '', '') == 1:
-            return re_error(conn, 4)
+        if await acl_check('', 'owner_auth', '', '') == 1:
+            return await re_error(conn, 4)
 
         user_id = name
         user_ip = ip
@@ -18,7 +18,7 @@ def list_user_check_delete(name = None, ip = None, time = None, do_type = 1):
                 return redirect(conn, '/list/user/check/' + url_pas(user_id if return_type == '0' else user_ip))
             else:
                 return easy_minify(conn, flask.render_template(skin_check(conn),
-                    imp = [get_lang(conn, 'check'), wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'delete') + ')', 0])],
+                    imp = [get_lang(conn, 'check'), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'delete') + ')', 0])],
                     data = '''
                         ''' + get_lang(conn, 'name') + ''' : ''' + user_id + '''
                         <hr class="main_hr">

+ 2 - 2
route/login_find.py

@@ -1,9 +1,9 @@
 from .tool.func import *
 
-def login_find():
+async def login_find():
     with get_db_connect() as conn:
         return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'password_search'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            imp = [get_lang(conn, 'password_search'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
             data = '''
                 <ul>
                     <li><a href="/login/find/email">''' + get_lang(conn, 'email') + '''</a></li>

+ 8 - 8
route/login_find_email.py

@@ -1,7 +1,7 @@
 from .tool.func import *
 
 # 개편 필요
-def login_find_email(tool):
+async def login_find_email(tool):
     with get_db_connect() as conn:
         curs = conn.cursor()
         
@@ -37,7 +37,7 @@ def login_find_email(tool):
                     for i in re_set_list:
                         flask.session.pop(i, None)
                     
-                    return re_error(conn, 36)
+                    return await re_error(conn, 36)
         
             curs.execute(db_change('select data from other where name = "email_title"'))
             sql_d = curs.fetchall()
@@ -50,10 +50,10 @@ def login_find_email(tool):
             if tool == 'pass_find':
                 curs.execute(db_change("select id from user_set where id = ? and name = 'email' and data = ?"), [user_id, user_email])
                 if not curs.fetchall():
-                    return re_error(conn, 12)
+                    return await re_error(conn, 12)
                     
                 if send_email(conn, user_email, t_text, i_text) == 0:
-                    return re_error(conn, 18)
+                    return await re_error(conn, 18)
         
                 return redirect(conn, '/pass_find/email')
             else:
@@ -62,13 +62,13 @@ def login_find_email(tool):
                     for i in re_set_list:
                         flask.session.pop(i, None)
         
-                    return re_error(conn, 35)
+                    return await re_error(conn, 35)
                 
                 if send_email(conn, user_email, t_text, i_text) == 0:
                     for i in re_set_list:
                         flask.session.pop(i, None)
         
-                    return re_error(conn, 18)
+                    return await re_error(conn, 18)
         
                 flask.session['c_email'] = user_email
         
@@ -80,7 +80,7 @@ def login_find_email(tool):
                 b_text = (sql_d[0][0] + '<hr class="main_hr">') if sql_d and sql_d[0][0] != '' else ''
         
                 return easy_minify(conn, flask.render_template(skin_check(conn),
-                    imp = [get_lang(conn, 'password_search'), wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'email') + ')', 0])],
+                    imp = [get_lang(conn, 'password_search'), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'email') + ')', 0])],
                     data = b_text + '''
                         <form method="post">
                             <input placeholder="''' + get_lang(conn, 'id') + '''" name="id" type="text">
@@ -101,7 +101,7 @@ def login_find_email(tool):
                 b_text = (sql_d[0][0] + '<hr class="main_hr">') if sql_d and sql_d[0][0] != '' else ''
         
                 return easy_minify(conn, flask.render_template(skin_check(conn),
-                    imp = [get_lang(conn, 'email'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                    imp = [get_lang(conn, 'email'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                     data = '''
                         <a href="/filter/email_filter">(''' + get_lang(conn, 'email_filter_list') + ''')</a>
                         <hr class="main_hr">

+ 5 - 5
route/login_find_email_check.py

@@ -1,7 +1,7 @@
 from .tool.func import *
 
 # 개편 필요
-def login_find_email_check(tool):
+async def login_find_email_check(tool):
     with get_db_connect() as conn:
         curs = conn.cursor()
         
@@ -31,7 +31,7 @@ def login_find_email_check(tool):
                 b_text = (sql_d[0][0] + '<hr class="main_hr">') if sql_d and sql_d[0][0] != '' else ''
         
                 return easy_minify(conn, flask.render_template(skin_check(conn),
-                    imp = [get_lang(conn, 'reset_user_ok'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                    imp = [get_lang(conn, 'reset_user_ok'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                     data = '' + \
                         b_text + \
                         get_lang(conn, 'id') + ' : ' + user_id + \
@@ -56,14 +56,14 @@ def login_find_email_check(tool):
                         for i in re_set_list:
                             flask.session.pop(i, None)
         
-                        return re_error(conn, 8)
+                        return await re_error(conn, 8)
                 
                     curs.execute(db_change("select id from user_set where id = ? and name = 'application'"), [flask.session['c_id']])
                     if curs.fetchall():
                         for i in re_set_list:
                             flask.session.pop(i, None)
         
-                        return re_error(conn, 8)
+                        return await re_error(conn, 8)
         
                     curs.execute(db_change('select data from other where name = "requires_approval"'))
                     requires_approval = curs.fetchall()
@@ -122,7 +122,7 @@ def login_find_email_check(tool):
             b_text = (sql_d[0][0] + '<hr class="main_hr">') if sql_d and sql_d[0][0] != '' else ''
         
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'check_key'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'check_key'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         ''' + b_text + '''

+ 6 - 6
route/login_find_key.py

@@ -1,11 +1,11 @@
 from .tool.func import *
 
-def login_find_key():
+async def login_find_key():
     with get_db_connect() as conn:
         curs = conn.cursor()
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
             
             input_key = flask.request.form.get('key', '')
             curs.execute(db_change('select id from user_set where name = "random_key" and data = ?'), [input_key])
@@ -30,7 +30,7 @@ def login_find_key():
             b_text = (sql_d[0][0] + '<hr class="main_hr">') if sql_d and sql_d[0][0] != '' else ''
             
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                    imp = [get_lang(conn, 'reset_user_ok'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                    imp = [get_lang(conn, 'reset_user_ok'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                     data = '' + \
                         b_text + \
                         get_lang(conn, 'id') + ' : ' + user_id + \
@@ -41,12 +41,12 @@ def login_find_key():
                 ))
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'password_search'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'password_search'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         <input placeholder="''' + get_lang(conn, 'key') + '''" name="key" type="password">
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + '''
+                        ''' + await captcha_get(conn) + '''
                         <button type="submit">''' + get_lang(conn, 'send') + '''</button>
                     </form>
                 ''',

+ 10 - 10
route/login_login.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def login_login_2():
+async def login_login_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -8,12 +8,12 @@ def login_login_2():
         if ip_or_user(ip) == 0:
             return redirect(conn, '/user')
 
-        if ban_check(None, 'login')[0] == 1:
-            return re_error(conn, 0)
+        if (await ban_check(None, 'login'))[0] == 1:
+            return await re_error(conn, 0)
 
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
             user_agent = flask.request.headers.get('User-Agent', '')
             user_id = flask.request.form.get('id', '')
@@ -22,19 +22,19 @@ def login_login_2():
             curs.execute(db_change("select data from user_set where id = ? and name = 'pw'"), [user_id])
             db_data = curs.fetchall()
             if not db_data:
-                return re_error(conn, 2)
+                return await re_error(conn, 2)
             else:
                 db_user_pw = db_data[0][0]
                 
             curs.execute(db_change("select data from user_set where id = ? and name = 'encode'"), [user_id])
             db_data = curs.fetchall()
             if not db_data:
-                return re_error(conn, 2)
+                return await re_error(conn, 2)
             else:
                 db_user_encode = db_data[0][0]
 
             if pw_check(conn, user_pw, db_user_pw, db_user_encode, user_id) != 1:
-                return re_error(conn, 10)
+                return await re_error(conn, 10)
 
             curs.execute(db_change('select data from user_set where name = "2fa" and id = ?'), [user_id])
             fa_data = curs.fetchall()
@@ -50,7 +50,7 @@ def login_login_2():
                 return redirect(conn, '/user')
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'login'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'login'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data =  '''
                         <form method="post">
                             <input placeholder="''' + get_lang(conn, 'id') + '''" name="id" type="text">
@@ -59,7 +59,7 @@ def login_login_2():
                             <hr class="main_hr">
                             <!-- <label><input type="checkbox" name="auto_login"> ''' + get_lang(conn, 'auto_login') + ''' (''' + get_lang(conn, 'not_working') + ''')</label>
                             <hr class="main_hr"> -->
-                            ''' + captcha_get(conn) + '''
+                            ''' + await captcha_get(conn) + '''
                             <button type="submit">''' + get_lang(conn, 'login') + '''</button>
                             ''' + http_warning(conn) + '''
                         </form>

+ 8 - 8
route/login_login_2fa.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def login_login_2fa_2():
+async def login_login_2fa_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -14,12 +14,12 @@ def login_login_2fa_2():
         if ip_or_user(ip) == 0:
             return redirect(conn, '/user')
 
-        if ban_check(None, 'login')[0] == 1:
-            return re_error(conn, 0)
+        if (await ban_check(None, 'login'))[0] == 1:
+            return await re_error(conn, 0)
 
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
             user_agent = flask.request.headers.get('User-Agent', '')
             user_id = flask.session['login_id']
@@ -34,7 +34,7 @@ def login_login_2fa_2():
 
                 pw_check_d = pw_check(conn, user_pw, user_1, user_2, user_id)
                 if pw_check_d != 1:
-                    return re_error(conn, 10)
+                    return await re_error(conn, 10)
 
             flask.session['id'] = user_id
 
@@ -50,12 +50,12 @@ def login_login_2fa_2():
             return redirect(conn, '/user')
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'login'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'login'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data =  '''
                         <form method="post">
                             <input placeholder="''' + get_lang(conn, '2fa_password') + '''" name="pw" type="password">
                             <hr class="main_hr">
-                            ''' + captcha_get(conn) + '''
+                            ''' + await captcha_get(conn) + '''
                             <button type="submit">''' + get_lang(conn, 'login') + '''</button>
                             ''' + http_warning(conn) + '''
                         </form>

+ 8 - 8
route/login_login_2fa_email.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def login_login_2fa_email_2():
+async def login_login_2fa_email_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -14,12 +14,12 @@ def login_login_2fa_email_2():
         if ip_or_user(ip) == 0:
             return redirect(conn, '/user')
 
-        if ban_check(None, 'login')[0] == 1:
-            return re_error(conn, 0)
+        if (await ban_check(None, 'login'))[0] == 1:
+            return await re_error(conn, 0)
 
         if flask.request.method == 'POST':
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
             user_agent = flask.request.headers.get('User-Agent', '')
             user_id = flask.session['b_id']
@@ -34,7 +34,7 @@ def login_login_2fa_email_2():
 
                 pw_check_d = pw_check(conn, user_pw, user_1, user_2, user_id)
                 if pw_check_d != 1:
-                    return re_error(conn, 10)
+                    return await re_error(conn, 10)
 
             flask.session['id'] = user_id
 
@@ -45,12 +45,12 @@ def login_login_2fa_email_2():
             return redirect(conn, '/user')
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'login'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'login'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data =  '''
                         <form method="post">
                             <input placeholder="''' + get_lang(conn, '2fa_password') + '''" name="pw" type="password">
                             <hr class=\"main_hr\">
-                            ''' + captcha_get(conn) + '''
+                            ''' + await captcha_get(conn) + '''
                             <button type="submit">''' + get_lang(conn, 'login') + '''</button>
                             ''' + http_warning(conn) + '''
                         </form>

+ 1 - 1
route/login_logout.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def login_logout():
+async def login_logout():
     with get_db_connect() as conn:
         flask.session.pop('state', None)
         flask.session.pop('id', None)

+ 14 - 14
route/login_register.py

@@ -1,14 +1,14 @@
 from .tool.func import *
 
-def login_register_2():
+async def login_register_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if ban_check(None, 'register')[0] == 1:
-            return re_error(conn, 0)
+        if (await ban_check(None, 'register'))[0] == 1:
+            return await re_error(conn, 0)
 
         ip = ip_check()
-        admin = acl_check(tool = 'owner_auth')
+        admin = await acl_check(tool = 'owner_auth')
         admin = 1 if admin == 0 else 0
 
         if admin != 1 and ip_or_user(ip) == 0:
@@ -18,12 +18,12 @@ def login_register_2():
             curs.execute(db_change('select data from other where name = "reg"'))
             set_d = curs.fetchall()
             if set_d and set_d[0][0] == 'on':
-                return re_error(conn, 0)
+                return await re_error(conn, 0)
 
         if flask.request.method == 'POST':
             # 리캡차
-            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                return re_error(conn, 13)
+            if await captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return await re_error(conn, 13)
 
             user_id = flask.request.form.get('id', '')
             user_pw = flask.request.form.get('pw', '')
@@ -31,14 +31,14 @@ def login_register_2():
 
             # PW 검증
             if user_id == '' or user_pw == '':
-                return re_error(conn, 27)
+                return await re_error(conn, 27)
 
             if user_pw != user_repeat:
-                return re_error(conn, 20)
+                return await re_error(conn, 20)
             
             # ID와 PW 동일성 검증
             if user_id == user_pw:
-                return re_error(conn, 49)
+                return await re_error(conn, 49)
 
             # PW 길이 제한
             curs.execute(db_change("select data from other where name = 'password_min_length'"))
@@ -46,10 +46,10 @@ def login_register_2():
             if db_data and db_data[0][0] != '':
                 password_min_length = int(number_check(db_data[0][0]))
                 if password_min_length > len(user_pw):
-                    return re_error(conn, 40)
+                    return await re_error(conn, 40)
 
             if do_user_name_check(conn, user_id) == 1:
-                return re_error(conn, 8)
+                return await re_error(conn, 8)
 
             if admin != 1:
                 # 이메일 필요시 /register/email로 발송
@@ -88,7 +88,7 @@ def login_register_2():
                 password_min_length = ''
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'register'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'register'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         ''' + contract + '''
@@ -102,7 +102,7 @@ def login_register_2():
                         <input placeholder="''' + get_lang(conn, 'password_confirm') + '''" name="pw2" type="password">
                         <hr class="main_hr">
 
-                        ''' + captcha_get(conn) + '''
+                        ''' + await captcha_get(conn) + '''
 
                         <button type="submit">''' + get_lang(conn, 'save') + '''</button>
 

+ 4 - 4
route/login_register_email.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def login_register_email_2():
+async def login_register_email_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -38,10 +38,10 @@ def login_register_email_2():
 
             curs.execute(db_change('select id from user_set where name = "email" and data = ?'), [user_email])
             if curs.fetchall():
-                return re_error(conn, 35)
+                return await re_error(conn, 35)
 
             if send_email(conn, user_email, t_text, i_text) == 0:
-                return re_error(conn, 18)
+                return await re_error(conn, 18)
 
             flask.session['reg_email'] = user_email
 
@@ -52,7 +52,7 @@ def login_register_email_2():
             b_text = (sql_d[0][0] + '<hr class="main_hr">') if sql_d and sql_d[0][0] != '' else ''
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'email'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'email'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <a href="/filter/email_filter">(''' + get_lang(conn, 'email_filter_list') + ''')</a>
                     <hr class="main_hr">

+ 2 - 2
route/login_register_email_check.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def login_register_email_check_2():
+async def login_register_email_check_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -35,7 +35,7 @@ def login_register_email_check_2():
             b_text = (sql_d[0][0] + '<hr class="main_hr">') if sql_d and sql_d[0][0] != '' else ''
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'check_key'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'check_key'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         ''' + b_text + '''

+ 3 - 3
route/login_register_submit.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def login_register_submit_2():
+async def login_register_submit_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -50,10 +50,10 @@ def login_register_submit_2():
 
             curs.execute(db_change("insert into user_set (id, name, data) values (?, ?, ?)"), [user_app_data['id'], 'application', json.dumps(user_app_data)])
 
-            return re_error(conn, 43)
+            return await re_error(conn, 43)
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [get_lang(conn, 'approval_question'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                imp = [get_lang(conn, 'approval_question'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         ''' + get_lang(conn, 'approval_question') + ' : ' + data_que + '''

+ 3 - 3
route/main_func_error_404.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def main_func_error_404(e = ''):
+async def main_func_error_404(e = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -24,9 +24,9 @@ def main_func_error_404(e = ''):
 
                 if db_data != '':
                     return easy_minify(conn, flask.render_template(skin_check(conn),
-                        imp = ['404', wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+                        imp = ['404', wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                         data = db_data,
                         menu = 0
                     )), 404
                 else:
-                    return re_error(conn, 46)
+                    return await re_error(conn, 46)

+ 1 - 1
route/main_search.py

@@ -1,5 +1,5 @@
 from .tool.func import *
 
-def main_search():
+async def main_search():
     with get_db_connect() as conn:
         return redirect(conn, '/search/' + url_pas(flask.request.form.get('search', 'test')))

+ 2 - 2
route/main_search_deep.py

@@ -51,7 +51,7 @@ async def main_search_deep(name = 'Test', search_type = 'title', num = 1):
                 <ul>
             '''
 
-            all_list = orjson.loads((await api_func_search(name, search_type, num)).get_data(as_text = True))
+            all_list = await api_func_search(name, search_type, num)
             for data in all_list:
                 div += '<li><a href="/w/' + url_pas(data) + '">' + data + '</a></li>'
 
@@ -63,7 +63,7 @@ async def main_search_deep(name = 'Test', search_type = 'title', num = 1):
                 div += get_next_page_bottom(conn, '/search_data_page/{}/' + url_pas(name), num, all_list)
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
-                imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'search') + ')', 0])],
+                imp = [name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'search') + ')', 0])],
                 data = div,
                 menu = 0
             ))

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů