Просмотр исходного кода

뒷 공백 제거, 버그 수정

Surplus_Up (2DU) 6 лет назад
Родитель
Сommit
9ea13d75e2
100 измененных файлов с 994 добавлено и 993 удалено
  1. 77 77
      app.py
  2. 19 19
      emergency_tool.py
  3. 11 11
      language/en-US.json
  4. 1 1
      readme-en.md
  5. 1 1
      readme.md
  6. 4 4
      route/alarm.py
  7. 1 1
      route/alarm_del.py
  8. 1 1
      route/api_raw.py
  9. 1 1
      route/api_recent_change.py
  10. 1 1
      route/api_search.py
  11. 7 7
      route/api_topic_sub.py
  12. 1 1
      route/api_user_info.py
  13. 1 1
      route/api_version.py
  14. 3 3
      route/api_w.py
  15. 15 15
      route/edit.py
  16. 11 11
      route/edit_delete.py
  17. 11 11
      route/edit_many_delete.py
  18. 21 21
      route/edit_move.py
  19. 15 15
      route/edit_req.py
  20. 12 12
      route/edit_revert.py
  21. 14 14
      route/func_upload.py
  22. 25 25
      route/give_acl.py
  23. 8 8
      route/give_admin.py
  24. 9 9
      route/give_admin_groups.py
  25. 2 2
      route/give_history_hidden.py
  26. 12 12
      route/give_user_ban.py
  27. 11 11
      route/give_user_check.py
  28. 4 4
      route/inter_wiki.py
  29. 3 3
      route/inter_wiki_del.py
  30. 23 23
      route/inter_wiki_plus.py
  31. 5 5
      route/list_acl.py
  32. 5 5
      route/list_admin.py
  33. 3 3
      route/list_admin_use.py
  34. 14 14
      route/list_block.py
  35. 3 3
      route/list_give.py
  36. 3 3
      route/list_not_close_topic.py
  37. 3 3
      route/list_old_page.py
  38. 6 6
      route/list_please.py
  39. 5 5
      route/list_title_index.py
  40. 5 5
      route/list_user.py
  41. 9 9
      route/list_user_topic.py
  42. 14 14
      route/login.py
  43. 22 22
      route/login_check_key.py
  44. 7 7
      route/login_need_email.py
  45. 30 30
      route/login_oauth.py
  46. 5 5
      route/login_pw_change.py
  47. 11 11
      route/login_register.py
  48. 1 1
      route/main_file.py
  49. 1 1
      route/main_image_view.py
  50. 16 16
      route/main_manager.py
  51. 2 2
      route/main_other.py
  52. 1 1
      route/main_skin_set.py
  53. 1 1
      route/main_views.py
  54. 30 29
      route/recent_changes.py
  55. 8 8
      route/recent_discuss.py
  56. 1 1
      route/recent_history_delete.py
  57. 3 3
      route/recent_history_tool.py
  58. 8 8
      route/search_deep.py
  59. 2 2
      route/server_now_update.py
  60. 1 1
      route/server_restart.py
  61. 70 70
      route/setting.py
  62. 5 5
      route/setting_adsense.py
  63. 11 11
      route/setting_oauth.py
  64. 50 50
      route/tool/func.py
  65. 7 7
      route/tool/mark.py
  66. 2 2
      route/tool/set_mark/markdown.py
  67. 147 147
      route/tool/set_mark/namumark.py
  68. 8 8
      route/tool/set_mark/tool.py
  69. 18 18
      route/topic.py
  70. 2 2
      route/topic_admin.py
  71. 3 3
      route/topic_block.py
  72. 14 14
      route/topic_close_list.py
  73. 1 1
      route/topic_delete.py
  74. 7 7
      route/topic_stop.py
  75. 2 2
      route/topic_tool.py
  76. 3 3
      route/topic_top.py
  77. 1 1
      route/user_count_edit.py
  78. 3 3
      route/user_custom_head_view.py
  79. 3 3
      route/user_info.py
  80. 5 5
      route/user_setting.py
  81. 4 4
      route/user_tool.py
  82. 3 3
      route/view_diff_data.py
  83. 3 3
      route/view_down.py
  84. 9 9
      route/view_raw.py
  85. 24 24
      route/view_read.py
  86. 9 9
      route/view_xref.py
  87. 2 2
      route/watch_list.py
  88. 2 2
      route/watch_list_name.py
  89. 3 3
      views/main_css/js/do_insert_data.js
  90. 4 4
      views/main_css/js/do_open_folding.js
  91. 1 1
      views/main_css/js/do_open_foot.js
  92. 1 1
      views/main_css/js/do_stop_exit.js
  93. 5 5
      views/main_css/js/dummy_do_open_foot.js
  94. 2 2
      views/main_css/js/load_include.js
  95. 1 1
      views/main_css/js/load_preview.js
  96. 1 1
      views/main_css/js/load_user_info.js
  97. 1 1
      views/main_css/js/load_ver.js
  98. 3 3
      views/main_css/js/render_html.js
  99. 1 1
      views/main_css/js/render_markdown.js
  100. 3 3
      views/main_css/js/shotcuts_set.js

+ 77 - 77
app.py

@@ -32,13 +32,13 @@ while 1:
             break
             break
     except:
     except:
         if os.getenv('NAMU_DB') != None or os.getenv('NAMU_DB_TYPE') != None:
         if os.getenv('NAMU_DB') != None or os.getenv('NAMU_DB_TYPE') != None:
-            set_data = { 
-                "db" : os.getenv('NAMU_DB') if os.getenv('NAMU_DB') else 'data', 
+            set_data = {
+                "db" : os.getenv('NAMU_DB') if os.getenv('NAMU_DB') else 'data',
                 "db_type" : os.getenv('NAMU_DB_TYPE') if os.getenv('NAMU_DB_TYPE') else 'sqlite'
                 "db_type" : os.getenv('NAMU_DB_TYPE') if os.getenv('NAMU_DB_TYPE') else 'sqlite'
             }
             }
 
 
             break
             break
-        else:        
+        else:
             new_json = ['', '']
             new_json = ['', '']
             normal_db_type = ['sqlite', 'mysql']
             normal_db_type = ['sqlite', 'mysql']
 
 
@@ -61,14 +61,14 @@ while 1:
             new_json[1] = str(input())
             new_json[1] = str(input())
             if new_json[1] == '':
             if new_json[1] == '':
                 new_json[1] = 'data'
                 new_json[1] = 'data'
-                
+
             with open('data/set.json', 'w') as f:
             with open('data/set.json', 'w') as f:
                 f.write('{ "db" : "' + new_json[1] + '", "db_type" : "' + new_json[0] + '" }')
                 f.write('{ "db" : "' + new_json[1] + '", "db_type" : "' + new_json[0] + '" }')
-                
+
             set_data = json.loads(open('data/set.json').read())
             set_data = json.loads(open('data/set.json').read())
-            
+
             break
             break
-        
+
 print('DB name : ' + set_data['db'])
 print('DB name : ' + set_data['db'])
 print('DB type : ' + set_data['db_type'])
 print('DB type : ' + set_data['db_type'])
 
 
@@ -94,12 +94,12 @@ if set_data['db_type'] == 'mysql':
 
 
         with open('data/mysql.json', 'w') as f:
         with open('data/mysql.json', 'w') as f:
             f.write('{ "user" : "' + new_json[0] + '", "password" : "' + new_json[1] + '" }')
             f.write('{ "user" : "' + new_json[0] + '", "password" : "' + new_json[1] + '" }')
-                
+
         set_data_mysql = json.loads(open('data/mysql.json').read())
         set_data_mysql = json.loads(open('data/mysql.json').read())
 
 
     conn = pymysql.connect(
     conn = pymysql.connect(
-        host = 'localhost', 
-        user = set_data_mysql['user'], 
+        host = 'localhost',
+        user = set_data_mysql['user'],
         password = set_data_mysql['password'],
         password = set_data_mysql['password'],
         charset = 'utf8mb4'
         charset = 'utf8mb4'
     )
     )
@@ -114,7 +114,7 @@ if set_data['db_type'] == 'mysql':
 else:
 else:
     conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
     conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
     curs = conn.cursor()
     curs = conn.cursor()
-            
+
 if os.path.exists(set_data['db'] + '.db'):
 if os.path.exists(set_data['db'] + '.db'):
     setup_tool = 0
     setup_tool = 0
 else:
 else:
@@ -143,26 +143,26 @@ app.url_map.converters['everything'] = EverythingConverter
 
 
 create_data = {}
 create_data = {}
 create_data['all_data'] = [
 create_data['all_data'] = [
-    'data', 
-    'cache_data', 
-    'history', 
-    'rd', 
+    'data',
+    'cache_data',
+    'history',
+    'rd',
     'user',
     'user',
     'user_set',
     'user_set',
-    'ban', 
-    'topic', 
-    'rb', 
-    'back', 
-    'custom', 
-    'other', 
-    'alist', 
-    're_admin', 
-    'alarm', 
-    'ua_d', 
-    'filter', 
-    'scan', 
-    'acl', 
-    'inter', 
+    'ban',
+    'topic',
+    'rb',
+    'back',
+    'custom',
+    'other',
+    'alist',
+    're_admin',
+    'alarm',
+    'ua_d',
+    'filter',
+    'scan',
+    'acl',
+    'inter',
     'html_filter',
     'html_filter',
     'oauth_conn',
     'oauth_conn',
 ]
 ]
@@ -214,8 +214,8 @@ if setup_tool != 0:
                 curs.execute(db_change('select ' + create + ' from ' + create_table + ' limit 1'))
                 curs.execute(db_change('select ' + create + ' from ' + create_table + ' limit 1'))
             except:
             except:
                 curs.execute(db_change("alter table " + create_table + " add " + create + " longtext default ''"))
                 curs.execute(db_change("alter table " + create_table + " add " + create + " longtext default ''"))
-                
-            try:    
+
+            try:
                 curs.execute(db_change('create index index_' + create_table + '_' + create + ' on ' + create_table + '(' + create + ')'))
                 curs.execute(db_change('create index index_' + create_table + '_' + create + ' on ' + create_table + '(' + create + ')'))
             except:
             except:
                 pass
                 pass
@@ -230,7 +230,7 @@ if not curs.fetchall():
 
 
 if not os.path.exists(app_var['path_data_image']):
 if not os.path.exists(app_var['path_data_image']):
     os.makedirs(app_var['path_data_image'])
     os.makedirs(app_var['path_data_image'])
-    
+
 if not os.path.exists('views'):
 if not os.path.exists('views'):
     os.makedirs('views')
     os.makedirs('views')
 
 
@@ -245,14 +245,14 @@ for i in range(len(server_set_key)):
     server_set_val = curs.fetchall()
     server_set_val = curs.fetchall()
     if not server_set_val:
     if not server_set_val:
         server_set_val = server_init.init(server_set_key[i])
         server_set_val = server_init.init(server_set_key[i])
-        
+
         curs.execute(db_change('insert into other (name, data) values (?, ?)'), [server_set_key[i], server_set_val])
         curs.execute(db_change('insert into other (name, data) values (?, ?)'), [server_set_key[i], server_set_val])
         conn.commit()
         conn.commit()
     else:
     else:
         server_set_val = server_set_val[0][0]
         server_set_val = server_set_val[0][0]
-    
+
     print(dislay_set_key[i] + ' : ' + server_set_val)
     print(dislay_set_key[i] + ' : ' + server_set_val)
-    
+
     server_set[server_set_key[i]] = server_set_val
     server_set[server_set_key[i]] = server_set_val
 
 
 curs.execute(db_change('select data from other where name = "key"'))
 curs.execute(db_change('select data from other where name = "key"'))
@@ -278,7 +278,7 @@ if set_data['db_type'] == 'sqlite':
         print('----')
         print('----')
         try:
         try:
             shutil.copyfile(set_data['db'] + '.db', 'back_' + set_data['db'] + '.db')
             shutil.copyfile(set_data['db'] + '.db', 'back_' + set_data['db'] + '.db')
-            
+
             print('Back up : OK')
             print('Back up : OK')
         except:
         except:
             print('Back up : Error')
             print('Back up : Error')
@@ -288,15 +288,15 @@ if set_data['db_type'] == 'sqlite':
     try:
     try:
         curs.execute(db_change('select data from other where name = "back_up"'))
         curs.execute(db_change('select data from other where name = "back_up"'))
         back_up_time = curs.fetchall()
         back_up_time = curs.fetchall()
-        
+
         back_time = int(back_up_time[0][0])
         back_time = int(back_up_time[0][0])
     except:
     except:
         back_time = 0
         back_time = 0
-        
+
     print('----')
     print('----')
     if back_time != 0:
     if back_time != 0:
         print('Back up state : ' + str(back_time) + ' hours')
         print('Back up state : ' + str(back_time) + ' hours')
-        
+
         back_up()
         back_up()
     else:
     else:
         print('Back up state : Turn off')
         print('Back up state : Turn off')
@@ -360,15 +360,15 @@ def list_acl():
 @app.route('/admin_plus/<name>', methods=['POST', 'GET'])
 @app.route('/admin_plus/<name>', methods=['POST', 'GET'])
 def give_admin_groups(name = None):
 def give_admin_groups(name = None):
     return give_admin_groups_2(conn, name)
     return give_admin_groups_2(conn, name)
-        
+
 @app.route('/admin_list')
 @app.route('/admin_list')
 def list_admin():
 def list_admin():
     return list_admin_2(conn)
     return list_admin_2(conn)
-        
+
 @app.route('/hidden/<everything:name>')
 @app.route('/hidden/<everything:name>')
 def give_history_hidden(name = None):
 def give_history_hidden(name = None):
     return give_history_hidden_2(conn, name)
     return give_history_hidden_2(conn, name)
-        
+
 @app.route('/user_log')
 @app.route('/user_log')
 def list_user():
 def list_user():
     return list_user_2(conn)
     return list_user_2(conn)
@@ -396,7 +396,7 @@ def setting_oauth():
 @app.route('/adsense_setting', methods=['GET', 'POST'])
 @app.route('/adsense_setting', methods=['GET', 'POST'])
 def setting_adsense():
 def setting_adsense():
     return setting_adsense_2(conn)
     return setting_adsense_2(conn)
-        
+
 @app.route('/xref/<everything:name>')
 @app.route('/xref/<everything:name>')
 def view_xref(name = None):
 def view_xref(name = None):
     return view_xref_2(conn, name)
     return view_xref_2(conn, name)
@@ -404,7 +404,7 @@ def view_xref(name = None):
 @app.route('/please')
 @app.route('/please')
 def list_please():
 def list_please():
     return list_please_2(conn)
     return list_please_2(conn)
-        
+
 @app.route('/recent_discuss')
 @app.route('/recent_discuss')
 def recent_discuss():
 def recent_discuss():
     return recent_discuss_2(conn)
     return recent_discuss_2(conn)
@@ -413,7 +413,7 @@ def recent_discuss():
 @app.route('/<regex("block_user|block_admin"):tool>/<name>')
 @app.route('/<regex("block_user|block_admin"):tool>/<name>')
 def list_block(name = None, tool = None):
 def list_block(name = None, tool = None):
     return list_block_2(conn, name, tool)
     return list_block_2(conn, name, tool)
-            
+
 @app.route('/search', methods=['POST'])
 @app.route('/search', methods=['POST'])
 def search():
 def search():
     return search_2(conn)
     return search_2(conn)
@@ -426,12 +426,12 @@ def search_goto(name = 'test'):
 @app.route('/search/<everything:name>')
 @app.route('/search/<everything:name>')
 def search_deep(name = 'test'):
 def search_deep(name = 'test'):
     return search_deep_2(conn, name)
     return search_deep_2(conn, name)
-         
+
 @app.route('/raw/<everything:name>')
 @app.route('/raw/<everything:name>')
 @app.route('/thread/<int:topic_num>/raw/<int:num>')
 @app.route('/thread/<int:topic_num>/raw/<int:num>')
 def view_raw(name = None, topic_num = None, num = None):
 def view_raw(name = None, topic_num = None, num = None):
     return view_raw_2(conn, name, topic_num, num)
     return view_raw_2(conn, name, topic_num, num)
-        
+
 @app.route('/revert/<everything:name>', methods=['POST', 'GET'])
 @app.route('/revert/<everything:name>', methods=['POST', 'GET'])
 def edit_revert(name = None):
 def edit_revert(name = None):
     return edit_revert_2(conn, name)
     return edit_revert_2(conn, name)
@@ -443,15 +443,15 @@ def edit(name = 'Test'):
 @app.route('/edit_req/<everything:name>', methods=['POST', 'GET'])
 @app.route('/edit_req/<everything:name>', methods=['POST', 'GET'])
 def edit_req(name = 'Test'):
 def edit_req(name = 'Test'):
     return edit_req_2(conn, name)
     return edit_req_2(conn, name)
-        
+
 @app.route('/delete/<everything:name>', methods=['POST', 'GET'])
 @app.route('/delete/<everything:name>', methods=['POST', 'GET'])
 def edit_delete(name = None):
 def edit_delete(name = None):
-    return edit_delete_2(conn, name, app_var)  
+    return edit_delete_2(conn, name, app_var)
 
 
 @app.route('/many_delete', methods=['POST', 'GET'])
 @app.route('/many_delete', methods=['POST', 'GET'])
 def edit_many_delete(name = None):
 def edit_many_delete(name = None):
-    return edit_many_delete_2(conn, app_var)     
-            
+    return edit_many_delete_2(conn, app_var)
+
 @app.route('/move/<everything:name>', methods=['POST', 'GET'])
 @app.route('/move/<everything:name>', methods=['POST', 'GET'])
 def edit_move(name = None):
 def edit_move(name = None):
     return edit_move_2(conn, name)
     return edit_move_2(conn, name)
@@ -459,24 +459,24 @@ def edit_move(name = None):
 @app.route('/other')
 @app.route('/other')
 def main_other():
 def main_other():
     return main_other_2(conn)
     return main_other_2(conn)
-    
+
 @app.route('/manager', methods=['POST', 'GET'])
 @app.route('/manager', methods=['POST', 'GET'])
 @app.route('/manager/<int:num>', methods=['POST', 'GET'])
 @app.route('/manager/<int:num>', methods=['POST', 'GET'])
 def main_manager(num = 1):
 def main_manager(num = 1):
     return main_manager_2(conn, num, version_list['master']['r_ver'])
     return main_manager_2(conn, num, version_list['master']['r_ver'])
-        
+
 @app.route('/title_index')
 @app.route('/title_index')
 def list_title_index():
 def list_title_index():
     return list_title_index_2(conn)
     return list_title_index_2(conn)
-                
+
 @app.route('/thread/<int:topic_num>/b/<int:num>')
 @app.route('/thread/<int:topic_num>/b/<int:num>')
 def topic_block(topic_num = 1, num = 1):
 def topic_block(topic_num = 1, num = 1):
     return topic_block_2(conn, topic_num, num)
     return topic_block_2(conn, topic_num, num)
-        
+
 @app.route('/thread/<int:topic_num>/notice/<int:num>')
 @app.route('/thread/<int:topic_num>/notice/<int:num>')
 def topic_top(topic_num = 1, num = 1):
 def topic_top(topic_num = 1, num = 1):
     return topic_top_2(conn, topic_num, num)
     return topic_top_2(conn, topic_num, num)
-                
+
 @app.route('/thread/<int:topic_num>/setting', methods=['POST', 'GET'])
 @app.route('/thread/<int:topic_num>/setting', methods=['POST', 'GET'])
 def topic_stop(topic_num = 1):
 def topic_stop(topic_num = 1):
     return topic_stop_2(conn, topic_num)
     return topic_stop_2(conn, topic_num)
@@ -496,7 +496,7 @@ def topic_admin(topic_num = 1, num = 1):
 @app.route('/thread/<int:topic_num>', methods=['POST', 'GET'])
 @app.route('/thread/<int:topic_num>', methods=['POST', 'GET'])
 def topic(topic_num = 1):
 def topic(topic_num = 1):
     return topic_2(conn, topic_num)
     return topic_2(conn, topic_num)
-        
+
 @app.route('/topic/<everything:name>', methods=['POST', 'GET'])
 @app.route('/topic/<everything:name>', methods=['POST', 'GET'])
 def topic_close_list(name = 'test'):
 def topic_close_list(name = 'test'):
     return topic_close_list_2(conn, name)
     return topic_close_list_2(conn, name)
@@ -504,7 +504,7 @@ def topic_close_list(name = 'test'):
 @app.route('/tool/<name>')
 @app.route('/tool/<name>')
 def user_tool(name = None):
 def user_tool(name = None):
     return user_tool_2(conn, name)
     return user_tool_2(conn, name)
-            
+
 @app.route('/login', methods=['POST', 'GET'])
 @app.route('/login', methods=['POST', 'GET'])
 def login():
 def login():
     return login_2(conn)
     return login_2(conn)
@@ -512,11 +512,11 @@ def login():
 @app.route('/oauth/<regex("discord|naver|facebook|kakao"):platform>/<regex("init|callback"):func>', methods=['GET', 'POST'])
 @app.route('/oauth/<regex("discord|naver|facebook|kakao"):platform>/<regex("init|callback"):func>', methods=['GET', 'POST'])
 def login_oauth(platform = None, func = None):
 def login_oauth(platform = None, func = None):
     return login_oauth_2(conn, platform, func)
     return login_oauth_2(conn, platform, func)
-                
+
 @app.route('/change', methods=['POST', 'GET'])
 @app.route('/change', methods=['POST', 'GET'])
 def user_setting():
 def user_setting():
     return user_setting_2(conn, server_init)
     return user_setting_2(conn, server_init)
-    
+
 @app.route('/pw_change', methods=['POST', 'GET'])
 @app.route('/pw_change', methods=['POST', 'GET'])
 def login_pw_change():
 def login_pw_change():
     return login_pw_change_2(conn)
     return login_pw_change_2(conn)
@@ -524,7 +524,7 @@ def login_pw_change():
 @app.route('/check/<name>')
 @app.route('/check/<name>')
 def give_user_check(name = None):
 def give_user_check(name = None):
     return give_user_check_2(conn, name)
     return give_user_check_2(conn, name)
-                
+
 @app.route('/register', methods=['POST', 'GET'])
 @app.route('/register', methods=['POST', 'GET'])
 def login_register():
 def login_register():
     return login_register_2(conn)
     return login_register_2(conn)
@@ -536,31 +536,31 @@ def login_need_email(tool = 'pass_find'):
 @app.route('/<regex("check_key|check_pass_key|email_replace"):tool>', methods=['POST', 'GET'])
 @app.route('/<regex("check_key|check_pass_key|email_replace"):tool>', methods=['POST', 'GET'])
 def login_check_key(tool = 'check_pass_key'):
 def login_check_key(tool = 'check_pass_key'):
     return login_check_key_2(conn, tool)
     return login_check_key_2(conn, tool)
-           
+
 @app.route('/logout')
 @app.route('/logout')
 def login_logout():
 def login_logout():
     return login_logout_2(conn)
     return login_logout_2(conn)
-    
+
 @app.route('/ban', methods=['POST', 'GET'])
 @app.route('/ban', methods=['POST', 'GET'])
 @app.route('/ban/<name>', methods=['POST', 'GET'])
 @app.route('/ban/<name>', methods=['POST', 'GET'])
 def give_user_ban(name = None):
 def give_user_ban(name = None):
-    return give_user_ban_2(conn, name)         
-                
+    return give_user_ban_2(conn, name)
+
 @app.route('/acl/<everything:name>', methods=['POST', 'GET'])
 @app.route('/acl/<everything:name>', methods=['POST', 'GET'])
 def give_acl(name = None):
 def give_acl(name = None):
     return give_acl_2(conn, name)
     return give_acl_2(conn, name)
-            
+
 @app.route('/admin/<name>', methods=['POST', 'GET'])
 @app.route('/admin/<name>', methods=['POST', 'GET'])
 def give_admin(name = None):
 def give_admin(name = None):
     return give_admin_2(conn, name)
     return give_admin_2(conn, name)
-    
+
 @app.route('/diff/<everything:name>')
 @app.route('/diff/<everything:name>')
 def view_diff_data(name = None):
 def view_diff_data(name = None):
     return view_diff_data_2(conn, name)
     return view_diff_data_2(conn, name)
-        
+
 @app.route('/down/<everything:name>')
 @app.route('/down/<everything:name>')
 def view_down(name = None):
 def view_down(name = None):
-    return view_down_2(conn, name)   
+    return view_down_2(conn, name)
 
 
 @app.route('/w/<everything:name>')
 @app.route('/w/<everything:name>')
 def view_read(name = None):
 def view_read(name = None):
@@ -579,7 +579,7 @@ def recent_changes(name = None, tool = 'record'):
 @app.route('/history_tool/<everything:name>')
 @app.route('/history_tool/<everything:name>')
 def recent_history_tool(name = None):
 def recent_history_tool(name = None):
     return recent_history_tool_2(conn, name)
     return recent_history_tool_2(conn, name)
-    
+
 @app.route('/history_delete/<everything:name>', methods=['POST', 'GET'])
 @app.route('/history_delete/<everything:name>', methods=['POST', 'GET'])
 def recent_history_delete(name = None):
 def recent_history_delete(name = None):
     return recent_history_delete_2(conn, name)
     return recent_history_delete_2(conn, name)
@@ -587,7 +587,7 @@ def recent_history_delete(name = None):
 @app.route('/upload', methods=['GET', 'POST'])
 @app.route('/upload', methods=['GET', 'POST'])
 def func_upload():
 def func_upload():
     return func_upload_2(conn)
     return func_upload_2(conn)
-        
+
 @app.route('/user')
 @app.route('/user')
 def user_info():
 def user_info():
     return user_info_2(conn)
     return user_info_2(conn)
@@ -608,7 +608,7 @@ def user_custom_head_view():
 @app.route('/count/<name>')
 @app.route('/count/<name>')
 def user_count_edit(name = None):
 def user_count_edit(name = None):
     return user_count_edit_2(conn, name)
     return user_count_edit_2(conn, name)
-        
+
 @app.route('/random')
 @app.route('/random')
 def func_title_random():
 def func_title_random():
     return func_title_random_2(conn)
     return func_title_random_2(conn)
@@ -620,12 +620,12 @@ def main_image_view(name = None):
 @app.route('/skin_set')
 @app.route('/skin_set')
 def main_skin_set():
 def main_skin_set():
     return main_skin_set_2(conn)
     return main_skin_set_2(conn)
-    
+
 # API
 # API
 @app.route('/api/w/<everything:name>', methods=['POST', 'GET'])
 @app.route('/api/w/<everything:name>', methods=['POST', 'GET'])
 def api_w(name = ''):
 def api_w(name = ''):
     return api_w_2(conn, name)
     return api_w_2(conn, name)
-    
+
 @app.route('/api/raw/<everything:name>')
 @app.route('/api/raw/<everything:name>')
 def api_raw(name = ''):
 def api_raw(name = ''):
     return api_raw_2(conn, name)
     return api_raw_2(conn, name)
@@ -658,7 +658,7 @@ def api_search(name = ''):
 @app.route('/api/recent_changes')
 @app.route('/api/recent_changes')
 def api_recent_change():
 def api_recent_change():
     return api_recent_change_2(conn)
     return api_recent_change_2(conn)
-    
+
 # File
 # File
 @app.route('/views/<everything:name>')
 @app.route('/views/<everything:name>')
 def main_views(name = None):
 def main_views(name = None):
@@ -672,7 +672,7 @@ def main_file(data = None):
 @app.errorhandler(404)
 @app.errorhandler(404)
 def main_error_404(e):
 def main_error_404(e):
     return main_error_404_2(conn)
     return main_error_404_2(conn)
-    
+
 app.secret_key = rep_key
 app.secret_key = rep_key
 app.wsgi_app = werkzeug.debug.DebuggedApplication(app.wsgi_app, True)
 app.wsgi_app = werkzeug.debug.DebuggedApplication(app.wsgi_app, True)
 app.debug = True
 app.debug = True
@@ -680,5 +680,5 @@ app.debug = True
 if __name__ == "__main__":
 if __name__ == "__main__":
     http_server = tornado.httpserver.HTTPServer(tornado.wsgi.WSGIContainer(app))
     http_server = tornado.httpserver.HTTPServer(tornado.wsgi.WSGIContainer(app))
     http_server.listen(server_set['port'], address = server_set['host'])
     http_server.listen(server_set['port'], address = server_set['host'])
-    
+
     tornado.ioloop.IOLoop.instance().start()
     tornado.ioloop.IOLoop.instance().start()

+ 19 - 19
emergency_tool.py

@@ -15,13 +15,13 @@ while 1:
             break
             break
     except:
     except:
         if os.getenv('NAMU_DB') != None or os.getenv('NAMU_DB_TYPE') != None:
         if os.getenv('NAMU_DB') != None or os.getenv('NAMU_DB_TYPE') != None:
-            set_data = { 
-                "db" : os.getenv('NAMU_DB') if os.getenv('NAMU_DB') else 'data', 
+            set_data = {
+                "db" : os.getenv('NAMU_DB') if os.getenv('NAMU_DB') else 'data',
                 "db_type" : os.getenv('NAMU_DB_TYPE') if os.getenv('NAMU_DB_TYPE') else 'sqlite'
                 "db_type" : os.getenv('NAMU_DB_TYPE') if os.getenv('NAMU_DB_TYPE') else 'sqlite'
             }
             }
 
 
             break
             break
-        else:        
+        else:
             new_json = ['', '']
             new_json = ['', '']
             normal_db_type = ['sqlite', 'mysql']
             normal_db_type = ['sqlite', 'mysql']
 
 
@@ -44,14 +44,14 @@ while 1:
             new_json[1] = str(input())
             new_json[1] = str(input())
             if new_json[1] == '':
             if new_json[1] == '':
                 new_json[1] = 'data'
                 new_json[1] = 'data'
-                
+
             with open('data/set.json', 'w') as f:
             with open('data/set.json', 'w') as f:
                 f.write('{ "db" : "' + new_json[1] + '", "db_type" : "' + new_json[0] + '" }')
                 f.write('{ "db" : "' + new_json[1] + '", "db_type" : "' + new_json[0] + '" }')
-                
+
             set_data = json.loads(open('data/set.json').read())
             set_data = json.loads(open('data/set.json').read())
-            
+
             break
             break
-        
+
 print('DB name : ' + set_data['db'])
 print('DB name : ' + set_data['db'])
 print('DB type : ' + set_data['db_type'])
 print('DB type : ' + set_data['db_type'])
 
 
@@ -77,12 +77,12 @@ if set_data['db_type'] == 'mysql':
 
 
         with open('data/mysql.json', 'w') as f:
         with open('data/mysql.json', 'w') as f:
             f.write('{ "user" : "' + new_json[0] + '", "password" : "' + new_json[1] + '" }')
             f.write('{ "user" : "' + new_json[0] + '", "password" : "' + new_json[1] + '" }')
-                
+
         set_data_mysql = json.loads(open('data/mysql.json').read())
         set_data_mysql = json.loads(open('data/mysql.json').read())
 
 
     conn = pymysql.connect(
     conn = pymysql.connect(
-        host = 'localhost', 
-        user = set_data_mysql['user'], 
+        host = 'localhost',
+        user = set_data_mysql['user'],
         password = set_data_mysql['password'],
         password = set_data_mysql['password'],
         charset = 'utf8mb4'
         charset = 'utf8mb4'
     )
     )
@@ -131,7 +131,7 @@ if what_i_do == '1':
         num += 1
         num += 1
         if num % 100 == 0:
         if num % 100 == 0:
             print(num)
             print(num)
-            
+
         render_do(test[0], test[1], 1, None)
         render_do(test[0], test[1], 1, None)
 elif what_i_do == '2':
 elif what_i_do == '2':
     curs.execute(db_change("delete from other where name = 'recaptcha'"))
     curs.execute(db_change("delete from other where name = 'recaptcha'"))
@@ -146,12 +146,12 @@ elif what_i_do == '3':
     else:
     else:
         band = ''
         band = ''
 
 
-        curs.execute(db_change("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)"), 
-            [user_data, 
-            'release', 
-            get_time(), 
-            'tool:emergency', 
-            '', 
+        curs.execute(db_change("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)"),
+            [user_data,
+            'release',
+            get_time(),
+            'tool:emergency',
+            '',
             band
             band
         ])
         ])
     curs.execute(db_change("delete from ban where block = ?"), [user_data])
     curs.execute(db_change("delete from ban where block = ?"), [user_data])
@@ -177,7 +177,7 @@ elif what_i_do == '7':
     print('----')
     print('----')
     print('1. sha256')
     print('1. sha256')
     print('2. sha3')
     print('2. sha3')
-    
+
     print('----')
     print('----')
     print('Select : ', end = '')
     print('Select : ', end = '')
     what_i_do = int(input())
     what_i_do = int(input())
@@ -197,7 +197,7 @@ elif what_i_do == '7':
             hashed = sha3.sha3_256(bytes(user_pw, 'utf-8')).hexdigest()
             hashed = sha3.sha3_256(bytes(user_pw, 'utf-8')).hexdigest()
         else:
         else:
             hashed = hashlib.sha3_256(bytes(user_pw, 'utf-8')).hexdigest()
             hashed = hashlib.sha3_256(bytes(user_pw, 'utf-8')).hexdigest()
-       
+
     curs.execute(db_change("update user set pw = ? where id = ?"), [hashed, user_name])
     curs.execute(db_change("update user set pw = ? where id = ?"), [hashed, user_name])
 elif what_i_do == '8':
 elif what_i_do == '8':
     curs.execute(db_change("update other set data = '00000' where name = 'ver'"))
     curs.execute(db_change("update other set data = '00000' where name = 'ver'"))

+ 11 - 11
language/en-US.json

@@ -20,8 +20,8 @@
         "host" : "Host",
         "host" : "Host",
         "port" : "Port",
         "port" : "Port",
         "restart" : "Restart",
         "restart" : "Restart",
-        "document_name" : "Document's name",
-        "discussion_name" : "Discussion's topic",
+        "document_name" : "Document[s] name",
+        "discussion_name" : "Discussion[s] topic",
         "user_name" : "Username",
         "user_name" : "Username",
         "go" : "Go",
         "go" : "Go",
         "document" : "Document",
         "document" : "Document",
@@ -128,8 +128,8 @@
         "edit_filter_rule" : "Contents filter rule",
         "edit_filter_rule" : "Contents filter rule",
         "move_history" : "History of move",
         "move_history" : "History of move",
         "other_tool" : "Other tools",
         "other_tool" : "Other tools",
-        "admin_tool" : "Administrator's tools",
-        "check_user" : "Check user's login history",
+        "admin_tool" : "Administrator[s] tools",
+        "check_user" : "Check user[s] login history",
         "compare_target" : "Comparison target name",
         "compare_target" : "Comparison target name",
         "authorize" : "Authorize",
         "authorize" : "Authorize",
         "indexing" : "DB Indexing",
         "indexing" : "DB Indexing",
@@ -168,8 +168,8 @@
         "edit_button_paragraph" : "Paragraph",
         "edit_button_paragraph" : "Paragraph",
         "password_change" : "Password change",
         "password_change" : "Password change",
         "email_change" : "Change email",
         "email_change" : "Change email",
-        "acl_change" : "Change document's ACL",
-        "user_tool" : "User's tools",
+        "acl_change" : "Change document[s] ACL",
+        "user_tool" : "User[s] tools",
         "skin_info" : "Skin information",
         "skin_info" : "Skin information",
         "closed_discussion" : "Closed discussion",
         "closed_discussion" : "Closed discussion",
         "agreed_discussion" : "Agreed discussion",
         "agreed_discussion" : "Agreed discussion",
@@ -216,13 +216,13 @@
                 "main_body" : "Top of body",
                 "main_body" : "Top of body",
                 "main_bottom_body" : "Bottom of body",
                 "main_bottom_body" : "Bottom of body",
             "_comment_2.2.2_" : "Main",
             "_comment_2.2.2_" : "Main",
-                "wiki_name" : "Wiki's name",
-                "wiki_logo" : "Wiki's logo",
+                "wiki_name" : "Wiki[s] name",
+                "wiki_logo" : "Wiki[s] logo",
                 "main_page" : "Main page",
                 "main_page" : "Main page",
                 "bottom_text" : "Bottom text",
                 "bottom_text" : "Bottom text",
                 "max_file_size" : "Max file size",
                 "max_file_size" : "Max file size",
                 "backup_interval" : "Backup Cycles",
                 "backup_interval" : "Backup Cycles",
-                "wiki_skin" : "Wiki's default Skin",
+                "wiki_skin" : "Wiki[s] default Skin",
                 "no_register" : "No sign-up",
                 "no_register" : "No sign-up",
                 "hide_ip" : "Hide IP address",
                 "hide_ip" : "Hide IP address",
                 "wiki_host" : "Wiki host address",
                 "wiki_host" : "Wiki host address",
@@ -308,7 +308,7 @@
         "update_warring" : "Manual updates are recommended if your version is 0.2 or lower than the latest version. For Windows, the contents of the route folder disappear.",
         "update_warring" : "Manual updates are recommended if your version is 0.2 or lower than the latest version. For Windows, the contents of the route folder disappear.",
         "defalut_edit_help" : "Describe it here",
         "defalut_edit_help" : "Describe it here",
         "markup_enabled" : "Markup enabled",
         "markup_enabled" : "Markup enabled",
-        "many_delete_help" : "Please write down the document's name one by one on the line.",
+        "many_delete_help" : "Please write down the document[s] name one by one on the line.",
         "sqlite_only" : "SQLite only",
         "sqlite_only" : "SQLite only",
         "_comment_3.1_" : "Error",
         "_comment_3.1_" : "Error",
             "update_error" : "Auto update is not supported.",
             "update_error" : "Auto update is not supported.",
@@ -332,7 +332,7 @@
             "password_diffrent_error" : "Reconfirm password and input password are different.",
             "password_diffrent_error" : "Reconfirm password and input password are different.",
             "edit_filter_error" : "Censored by edit filter.",
             "edit_filter_error" : "Censored by edit filter.",
             "file_name_error" : "Only alphabet, hangul, space, underscore, and minus signs are allowed for file names.",
             "file_name_error" : "Only alphabet, hangul, space, underscore, and minus signs are allowed for file names.",
-            "topic_long_error" : "The discussion's topic must not exceed 256 characters.",
+            "topic_long_error" : "The discussion[s] topic must not exceed 256 characters.",
             "email_error" : "No one has this email.",
             "email_error" : "No one has this email.",
             "regex_error" : "There is an error in the regular expression.",
             "regex_error" : "There is an error in the regular expression.",
             "decument_404_error" : "This document does not exist.",
             "decument_404_error" : "This document does not exist.",

+ 1 - 1
readme-en.md

@@ -56,7 +56,7 @@ You can clone this repository by entering the following command at the terminal
 openNAMU may have some untested bugs. Your use of openNAMU and bug discovery will help develop openNAMU.
 openNAMU may have some untested bugs. Your use of openNAMU and bug discovery will help develop openNAMU.
 [[Create Issues]](https://github.com/2du/openNAMU/issues/new)
 [[Create Issues]](https://github.com/2du/openNAMU/issues/new)
 
 
-openNAMU is a complete open source project. Add new features and create pull requests. 
+openNAMU is a complete open source project. Add new features and create pull requests.
 [[Create Pull Requests]](https://github.com/2du/openNAMU/compare)
 [[Create Pull Requests]](https://github.com/2du/openNAMU/compare)
 
 
 # Lisence
 # Lisence

+ 1 - 1
readme.md

@@ -38,7 +38,7 @@
 
 
 ### 포함된 외부 프로젝트
 ### 포함된 외부 프로젝트
  * Quotes icon - [Dave Gandy](http://www.flaticon.com/free-icon/quote-left_25672)
  * Quotes icon - [Dave Gandy](http://www.flaticon.com/free-icon/quote-left_25672)
- * Syntax highlighting - [highlightjs](https://highlightjs.org/) 
+ * Syntax highlighting - [highlightjs](https://highlightjs.org/)
  * Numerical expression - [MathJax](https://www.mathjax.org/)
  * Numerical expression - [MathJax](https://www.mathjax.org/)
  * Handling Keyboard Shortcuts [shortcut.js](http://www.openjs.com/scripts/events/keyboard_shortcuts/)
  * Handling Keyboard Shortcuts [shortcut.js](http://www.openjs.com/scripts/events/keyboard_shortcuts/)
 
 

+ 4 - 4
route/alarm.py

@@ -9,8 +9,8 @@ def alarm_2(conn):
     else:
     else:
         sql_num = 0
         sql_num = 0
 
 
-    data = '<ul>'    
-    
+    data = '<ul>'
+
     curs.execute(db_change("select data, date from alarm where name = ? order by date desc limit ?, 50"), [ip_check(), sql_num])
     curs.execute(db_change("select data, date from alarm where name = ? order by date desc limit ?, 50"), [ip_check(), sql_num])
     data_list = curs.fetchall()
     data_list = curs.fetchall()
     if data_list:
     if data_list:
@@ -18,10 +18,10 @@ def alarm_2(conn):
 
 
         for data_one in data_list:
         for data_one in data_list:
             data += '<li>' + data_one[0] + ' (' + data_one[1] + ')</li>'
             data += '<li>' + data_one[0] + ' (' + data_one[1] + ')</li>'
-    
+
     data += '</ul>' + next_fix('/alarm?num=', num, data_list)
     data += '</ul>' + next_fix('/alarm?num=', num, data_list)
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('notice'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('notice'), wiki_set(), custom(), other2([0, 0])],
         data = data,
         data = data,
         menu = [['user', load_lang('return')]]
         menu = [['user', load_lang('return')]]

+ 1 - 1
route/alarm_del.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def alarm_del_2(conn):
 def alarm_del_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     curs.execute(db_change("delete from alarm where name = ?"), [ip_check()])
     curs.execute(db_change("delete from alarm where name = ?"), [ip_check()])
     conn.commit()
     conn.commit()
 
 

+ 1 - 1
route/api_raw.py

@@ -8,7 +8,7 @@ def api_raw_2(conn, name):
         data = curs.fetchall()
         data = curs.fetchall()
         if data:
         if data:
             json_data = { "title" : name, "data" : render_set(title = name, data = data[0][0], s_data = 1) }
             json_data = { "title" : name, "data" : render_set(title = name, data = data[0][0], s_data = 1) }
-        
+
             return flask.jsonify(json_data)
             return flask.jsonify(json_data)
         else:
         else:
             return flask.jsonify({})
             return flask.jsonify({})

+ 1 - 1
route/api_recent_change.py

@@ -14,7 +14,7 @@ def api_recent_change_2(conn):
     if page * num > 0:
     if page * num > 0:
         page = page * num - num
         page = page * num - num
     else:
     else:
-        page = 0   
+        page = 0
 
 
     curs.execute(db_change('' + \
     curs.execute(db_change('' + \
         'select id, title, date, ip, send, leng from history ' + \
         'select id, title, date, ip, send, leng from history ' + \

+ 1 - 1
route/api_search.py

@@ -14,7 +14,7 @@ def api_search_2(conn, name):
     if page * num > 0:
     if page * num > 0:
         page = page * num - num
         page = page * num - num
     else:
     else:
-        page = 0   
+        page = 0
 
 
     curs.execute(db_change('select data from other where name = "count_all_title"'))
     curs.execute(db_change('select data from other where name = "count_all_title"'))
     if int(curs.fetchall()[0][0]) < 10000:
     if int(curs.fetchall()[0][0]) < 10000:

+ 7 - 7
route/api_topic_sub.py

@@ -9,8 +9,8 @@ def api_topic_sub_2(conn, topic_num):
 
 
     if flask.request.args.get('num', None):
     if flask.request.args.get('num', None):
         curs.execute(db_change("select id, data, date, ip, block, top from topic where title = ? and sub = ? and id + 0 = ? + 0 order by id + 0 asc"), [
         curs.execute(db_change("select id, data, date, ip, block, top from topic where title = ? and sub = ? and id + 0 = ? + 0 order by id + 0 asc"), [
-            name, 
-            sub, 
+            name,
+            sub,
             flask.request.args.get('num', '')
             flask.request.args.get('num', '')
         ])
         ])
     elif flask.request.args.get('top', None):
     elif flask.request.args.get('top', None):
@@ -22,7 +22,7 @@ def api_topic_sub_2(conn, topic_num):
     if data:
     if data:
         json_data = {}
         json_data = {}
         admin = admin_check(3)
         admin = admin_check(3)
-                    
+
         for i in data:
         for i in data:
             ip = ip_pas(i[3])
             ip = ip_pas(i[3])
 
 
@@ -55,7 +55,7 @@ def api_topic_sub_2(conn, topic_num):
                             s_user = g_data[0][0]
                             s_user = g_data[0][0]
                         else:
                         else:
                             s_user = ''
                             s_user = ''
-                    
+
                 if flask.request.args.get('top', None):
                 if flask.request.args.get('top', None):
                     t_color = 'toron_color_red'
                     t_color = 'toron_color_red'
                 elif i[3] == s_user and i[5] != '1':
                 elif i[3] == s_user and i[5] != '1':
@@ -67,10 +67,10 @@ def api_topic_sub_2(conn, topic_num):
 
 
                 if admin == 1 or b_color != 'toron_color_not':
                 if admin == 1 or b_color != 'toron_color_not':
                     ip += ' <a href="/thread/' + str(topic_num) + '/admin/' + i[0] + '">(' + load_lang('discussion_tool') + ')</a>'
                     ip += ' <a href="/thread/' + str(topic_num) + '/admin/' + i[0] + '">(' + load_lang('discussion_tool') + ')</a>'
-                    
+
                 if t_data_f == '':
                 if t_data_f == '':
                     t_data_f = '[br]'
                     t_data_f = '[br]'
-            
+
                 all_data = '' + \
                 all_data = '' + \
                     '<table id="toron">' + \
                     '<table id="toron">' + \
                         '<tbody>' + \
                         '<tbody>' + \
@@ -86,7 +86,7 @@ def api_topic_sub_2(conn, topic_num):
                     '</table>' + \
                     '</table>' + \
                     '<hr class="main_hr">' + \
                     '<hr class="main_hr">' + \
                 ''
                 ''
-                
+
                 json_data[i[0]] = {
                 json_data[i[0]] = {
                     "data" : all_data
                     "data" : all_data
                 }
                 }

+ 1 - 1
route/api_user_info.py

@@ -28,7 +28,7 @@ def api_user_info_2(conn, name):
                 </tbody>
                 </tbody>
             </table>
             </table>
         '''
         '''
-        
+
         curs.execute(db_change("select acl from user where id = ?"), [name])
         curs.execute(db_change("select acl from user where id = ?"), [name])
         data = curs.fetchall()
         data = curs.fetchall()
         if data:
         if data:

+ 1 - 1
route/api_version.py

@@ -21,7 +21,7 @@ def api_version_2(conn, r_ver, c_ver):
                 n_ver = json_data[up_data]['r_ver']
                 n_ver = json_data[up_data]['r_ver']
         except:
         except:
             pass
             pass
-        
+
     json_data = { "version" : r_ver, "db_version" : c_ver, "lastest_version" : n_ver  }
     json_data = { "version" : r_ver, "db_version" : c_ver, "lastest_version" : n_ver  }
 
 
     return flask.jsonify(json_data)
     return flask.jsonify(json_data)

+ 3 - 3
route/api_w.py

@@ -13,7 +13,7 @@ def api_w_2(conn, name):
         if acl_check(name, 'render') != 1:
         if acl_check(name, 'render') != 1:
             if flask.request.method == 'POST':
             if flask.request.method == 'POST':
                 g_data = render_set(title = name, data = flask.request.form.get('data', ''), num = 2)
                 g_data = render_set(title = name, data = flask.request.form.get('data', ''), num = 2)
-                
+
                 return flask.jsonify({ "title" : name, "data" : g_data[0], "js_data" : g_data[1] })
                 return flask.jsonify({ "title" : name, "data" : g_data[0], "js_data" : g_data[1] })
             else:
             else:
                 curs.execute(db_change("select data from data where title = ?"), [name])
                 curs.execute(db_change("select data from data where title = ?"), [name])
@@ -22,10 +22,10 @@ def api_w_2(conn, name):
                     if flask.request.args.get('include', 'include_1'):
                     if flask.request.args.get('include', 'include_1'):
                         include_re = re.compile('\[include\(((?:(?!\)\]).)+)\)\]', re.I)
                         include_re = re.compile('\[include\(((?:(?!\)\]).)+)\)\]', re.I)
                         category_re = re.compile('\[\[(?:(?:category|분류):(?:(?!\[\[|\]\]).)+)\]\]', re.I)
                         category_re = re.compile('\[\[(?:(?:category|분류):(?:(?!\[\[|\]\]).)+)\]\]', re.I)
-                        
+
                         json_data = include_re.sub('', data[0][0])
                         json_data = include_re.sub('', data[0][0])
                         json_data = category_re.sub('', json_data, )
                         json_data = category_re.sub('', json_data, )
-                        
+
                         g_data = render_set(title = name, data = json_data, num = 2, include = flask.request.args.get('include', 'include_1'))
                         g_data = render_set(title = name, data = json_data, num = 2, include = flask.request.args.get('include', 'include_1'))
                     else:
                     else:
                         json_data = g_data[0]
                         json_data = g_data[0]

+ 15 - 15
route/edit.py

@@ -11,7 +11,7 @@ def edit_2(conn, name):
 
 
     if acl_check(name) == 1:
     if acl_check(name) == 1:
         return redirect('/edit_req/' + url_pas(name))
         return redirect('/edit_req/' + url_pas(name))
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')
             return re_error('/error/13')
@@ -26,15 +26,15 @@ def edit_2(conn, name):
 
 
         if flask.request.form.get('otent', '') == content:
         if flask.request.form.get('otent', '') == content:
             return redirect('/w/' + url_pas(name))
             return redirect('/w/' + url_pas(name))
-        
+
         if edit_filter_do(content) == 1:
         if edit_filter_do(content) == 1:
             return re_error('/error/21')
             return re_error('/error/21')
 
 
         content = savemark(content)
         content = savemark(content)
-        
+
         if old:
         if old:
             leng = leng_check(len(flask.request.form.get('otent', '')), len(content))
             leng = leng_check(len(flask.request.form.get('otent', '')), len(content))
-            
+
             if section:
             if section:
                 content = old[0][0].replace(flask.request.form.get('otent', ''), content)
                 content = old[0][0].replace(flask.request.form.get('otent', ''), content)
         else:
         else:
@@ -52,10 +52,10 @@ def edit_2(conn, name):
         for scan_user in curs.fetchall():
         for scan_user in curs.fetchall():
             curs.execute(db_change("insert into alarm (name, data, date) values (?, ?, ?)"), [
             curs.execute(db_change("insert into alarm (name, data, date) values (?, ?, ?)"), [
                 scan_user[0],
                 scan_user[0],
-                ip + ' | <a href="/w/' + url_pas(name) + '">' + name + '</a> | Edit', 
+                ip + ' | <a href="/w/' + url_pas(name) + '">' + name + '</a> | Edit',
                 today
                 today
             ])
             ])
-                
+
         history_plus(
         history_plus(
             name,
             name,
             content,
             content,
@@ -64,20 +64,20 @@ def edit_2(conn, name):
             flask.request.form.get('send', ''),
             flask.request.form.get('send', ''),
             leng
             leng
         )
         )
-        
+
         curs.execute(db_change("delete from back where link = ?"), [name])
         curs.execute(db_change("delete from back where link = ?"), [name])
         curs.execute(db_change("delete from back where title = ? and type = 'no'"), [name])
         curs.execute(db_change("delete from back where title = ? and type = 'no'"), [name])
-        
+
         render_set(
         render_set(
             title = name,
             title = name,
             data = content,
             data = content,
             num = 1
             num = 1
         )
         )
-        
+
         conn.commit()
         conn.commit()
-        
+
         return redirect('/w/' + url_pas(name))
         return redirect('/w/' + url_pas(name))
-    else:            
+    else:
         if old:
         if old:
             if section:
             if section:
                 data = re.sub('\n(?P<in>={1,6})', '<br>\g<in>', html.escape('\n' + re.sub('\r\n', '\n', old[0][0]) + '\n'))
                 data = re.sub('\n(?P<in>={1,6})', '<br>\g<in>', html.escape('\n' + re.sub('\r\n', '\n', old[0][0]) + '\n'))
@@ -88,7 +88,7 @@ def edit_2(conn, name):
                     if g_data:
                     if g_data:
                         if int(section) - 1 == i:
                         if int(section) - 1 == i:
                             data = html.unescape(re.sub('<br>(?P<in>={1,6})', '\n\g<in>', g_data.groups()[0]))
                             data = html.unescape(re.sub('<br>(?P<in>={1,6})', '\n\g<in>', g_data.groups()[0]))
-                            
+
                             break
                             break
                         else:
                         else:
                             data = re.sub('((?:<br>)(?:(?:(?!\n|<br>).)+)(?:\n*(?:(?:(?!<br>).)+\n*)+)?)', '\n', data, 1)
                             data = re.sub('((?:<br>)(?:(?:(?!\n|<br>).)+)(?:\n*(?:(?:(?!<br>).)+\n*)+)?)', '\n', data, 1)
@@ -100,7 +100,7 @@ def edit_2(conn, name):
                 data = old[0][0]
                 data = old[0][0]
         else:
         else:
             data = ''
             data = ''
-            
+
         data_old = data
         data_old = data
         get_name = ''
         get_name = ''
 
 
@@ -109,7 +109,7 @@ def edit_2(conn, name):
                 <a href="/manager/15?plus=''' + url_pas(name) + '">(' + load_lang('load') + ')</a> <a href="/edit_filter">(' + load_lang('edit_filter_rule') + ''')</a>
                 <a href="/manager/15?plus=''' + url_pas(name) + '">(' + load_lang('load') + ')</a> <a href="/edit_filter">(' + load_lang('edit_filter_rule') + ''')</a>
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
             '''
             '''
-            
+
         if flask.request.args.get('plus', None):
         if flask.request.args.get('plus', None):
             curs.execute(db_change("select data from data where title = ?"), [flask.request.args.get('plus', 'test')])
             curs.execute(db_change("select data from data where title = ?"), [flask.request.args.get('plus', 'test')])
             get_data = curs.fetchall()
             get_data = curs.fetchall()
@@ -134,7 +134,7 @@ def edit_2(conn, name):
         else:
         else:
             p_text = load_lang('defalut_edit_help')
             p_text = load_lang('defalut_edit_help')
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],
             data =  get_name + '''
             data =  get_name + '''
                 <form method="post">
                 <form method="post">

+ 11 - 11
route/edit_delete.py

@@ -6,7 +6,7 @@ def edit_delete_2(conn, name, app_var):
     ip = ip_check()
     ip = ip_check()
     if acl_check(name) == 1:
     if acl_check(name) == 1:
         return re_error('/ban')
         return re_error('/ban')
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')
             return re_error('/error/13')
@@ -21,21 +21,21 @@ def edit_delete_2(conn, name, app_var):
         if data:
         if data:
             today = get_time()
             today = get_time()
             leng = '-' + str(len(data[0][0]))
             leng = '-' + str(len(data[0][0]))
-            
+
             history_plus(
             history_plus(
-                name, 
-                '', 
-                today, 
-                ip, 
-                flask.request.form.get('send', ''), 
+                name,
+                '',
+                today,
+                ip,
+                flask.request.form.get('send', ''),
                 leng,
                 leng,
                 'delete'
                 'delete'
             )
             )
-            
+
             curs.execute(db_change("select title, link from back where title = ? and not type = 'cat' and not type = 'no'"), [name])
             curs.execute(db_change("select title, link from back where title = ? and not type = 'cat' and not type = 'no'"), [name])
             for data in curs.fetchall():
             for data in curs.fetchall():
                 curs.execute(db_change("insert into back (title, link, type) values (?, ?, 'no')"), [data[0], data[1]])
                 curs.execute(db_change("insert into back (title, link, type) values (?, ?, 'no')"), [data[0], data[1]])
-            
+
             curs.execute(db_change("delete from back where link = ?"), [name])
             curs.execute(db_change("delete from back where link = ?"), [name])
             curs.execute(db_change("delete from data where title = ?"), [name])
             curs.execute(db_change("delete from data where title = ?"), [name])
             conn.commit()
             conn.commit()
@@ -50,14 +50,14 @@ def edit_delete_2(conn, name, app_var):
 
 
         curs.execute(db_change('select data from other where name = "count_all_title"'))
         curs.execute(db_change('select data from other where name = "count_all_title"'))
         curs.execute(db_change("update other set data = ? where name = 'count_all_title'"), [str(int(curs.fetchall()[0][0]) - 1)])
         curs.execute(db_change("update other set data = ? where name = 'count_all_title'"), [str(int(curs.fetchall()[0][0]) - 1)])
-            
+
         return redirect('/w/' + url_pas(name))
         return redirect('/w/' + url_pas(name))
     else:
     else:
         curs.execute(db_change("select title from data where title = ?"), [name])
         curs.execute(db_change("select title from data where title = ?"), [name])
         if not curs.fetchall():
         if not curs.fetchall():
             return redirect('/w/' + url_pas(name))
             return redirect('/w/' + url_pas(name))
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('delete') + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('delete') + ')', 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 11 - 11
route/edit_many_delete.py

@@ -6,7 +6,7 @@ def edit_many_delete_2(conn, app_var):
     ip = ip_check()
     ip = ip_check()
     if admin_check() != 1:
     if admin_check() != 1:
         return re_error('/ban')
         return re_error('/ban')
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         all_title = re.findall(r'([^\n]+)\n', flask.request.form.get('content', '').replace('\r\n', '\n') + '\n')
         all_title = re.findall(r'([^\n]+)\n', flask.request.form.get('content', '').replace('\r\n', '\n') + '\n')
         for name in all_title:
         for name in all_title:
@@ -15,21 +15,21 @@ def edit_many_delete_2(conn, app_var):
             if data:
             if data:
                 today = get_time()
                 today = get_time()
                 leng = '-' + str(len(data[0][0]))
                 leng = '-' + str(len(data[0][0]))
-                
+
                 history_plus(
                 history_plus(
-                    name, 
-                    '', 
-                    today, 
-                    ip, 
-                    flask.request.form.get('send', ''), 
+                    name,
+                    '',
+                    today,
+                    ip,
+                    flask.request.form.get('send', ''),
                     leng,
                     leng,
                     'delete'
                     'delete'
                 )
                 )
-                
+
                 curs.execute(db_change("select title, link from back where title = ? and not type = 'cat' and not type = 'no'"), [name])
                 curs.execute(db_change("select title, link from back where title = ? and not type = 'cat' and not type = 'no'"), [name])
                 for data in curs.fetchall():
                 for data in curs.fetchall():
                     curs.execute(db_change("insert into back (title, link, type) values (?, ?, 'no')"), [data[0], data[1]])
                     curs.execute(db_change("insert into back (title, link, type) values (?, ?, 'no')"), [data[0], data[1]])
-                
+
                 curs.execute(db_change("delete from back where link = ?"), [name])
                 curs.execute(db_change("delete from back where link = ?"), [name])
                 curs.execute(db_change("delete from data where title = ?"), [name])
                 curs.execute(db_change("delete from data where title = ?"), [name])
                 conn.commit()
                 conn.commit()
@@ -44,10 +44,10 @@ def edit_many_delete_2(conn, app_var):
 
 
             curs.execute(db_change('select data from other where name = "count_all_title"'))
             curs.execute(db_change('select data from other where name = "count_all_title"'))
             curs.execute(db_change("update other set data = ? where name = 'count_all_title'"), [str(int(curs.fetchall()[0][0]) - 1)])
             curs.execute(db_change("update other set data = ? where name = 'count_all_title'"), [str(int(curs.fetchall()[0][0]) - 1)])
-                
+
         return redirect('/recent_changes')
         return redirect('/recent_changes')
     else:
     else:
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('many_delete'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('many_delete'), wiki_set(), custom(), other2([0, 0])],
             data = '''
             data = '''
                 <form method="post">
                 <form method="post">

+ 21 - 21
route/edit_move.py

@@ -20,26 +20,26 @@ def edit_move_2(conn, name):
             if admin_check(None, 'merge documents') == 1:
             if admin_check(None, 'merge documents') == 1:
                 curs.execute(db_change("select data from data where title = ?"), [flask.request.form.get('title', None)])
                 curs.execute(db_change("select data from data where title = ?"), [flask.request.form.get('title', None)])
                 data = curs.fetchall()
                 data = curs.fetchall()
-                if data:            
+                if data:
                     curs.execute(db_change("delete from data where title = ?"), [flask.request.form.get('title', None)])
                     curs.execute(db_change("delete from data where title = ?"), [flask.request.form.get('title', None)])
                     curs.execute(db_change("delete from back where link = ?"), [flask.request.form.get('title', None)])
                     curs.execute(db_change("delete from back where link = ?"), [flask.request.form.get('title', None)])
-                
+
                 curs.execute(db_change("select data from data where title = ?"), [name])
                 curs.execute(db_change("select data from data where title = ?"), [name])
                 data = curs.fetchall()
                 data = curs.fetchall()
-                if data:            
+                if data:
                     curs.execute(db_change("update data set title = ? where title = ?"), [flask.request.form.get('title', None), name])
                     curs.execute(db_change("update data set title = ? where title = ?"), [flask.request.form.get('title', None), name])
                     curs.execute(db_change("update back set link = ? where link = ?"), [flask.request.form.get('title', None), name])
                     curs.execute(db_change("update back set link = ? where link = ?"), [flask.request.form.get('title', None), name])
-                    
+
                     data_in = data[0][0]
                     data_in = data[0][0]
                 else:
                 else:
                     data_in = ''
                     data_in = ''
 
 
                 history_plus(
                 history_plus(
-                    name, 
-                    data_in, 
-                    get_time(), 
-                    ip_check(), 
-                    flask.request.form.get('send', ''), 
+                    name,
+                    data_in,
+                    get_time(),
+                    ip_check(),
+                    flask.request.form.get('send', ''),
                     '0',
                     '0',
                     'marge <a>' + name + '</a> - <a>' + flask.request.form.get('title', 'test') + '</a> move'
                     'marge <a>' + name + '</a> - <a>' + flask.request.form.get('title', 'test') + '</a> move'
                 )
                 )
@@ -49,7 +49,7 @@ def edit_move_2(conn, name):
 
 
                 curs.execute(db_change("select id from history where title = ? order by id + 0 desc limit 1"), [flask.request.form.get('title', None)])
                 curs.execute(db_change("select id from history where title = ? order by id + 0 desc limit 1"), [flask.request.form.get('title', None)])
                 data = curs.fetchall()
                 data = curs.fetchall()
-                
+
                 num = data[0][0]
                 num = data[0][0]
 
 
                 curs.execute(db_change("select id from history where title = ? order by id + 0 asc"), [name])
                 curs.execute(db_change("select id from history where title = ? order by id + 0 asc"), [name])
@@ -65,24 +65,24 @@ def edit_move_2(conn, name):
         else:
         else:
             curs.execute(db_change("select data from data where title = ?"), [name])
             curs.execute(db_change("select data from data where title = ?"), [name])
             data = curs.fetchall()
             data = curs.fetchall()
-            if data:            
+            if data:
                 curs.execute(db_change("update data set title = ? where title = ?"), [flask.request.form.get('title', None), name])
                 curs.execute(db_change("update data set title = ? where title = ?"), [flask.request.form.get('title', None), name])
                 curs.execute(db_change("update back set link = ? where link = ?"), [flask.request.form.get('title', None), name])
                 curs.execute(db_change("update back set link = ? where link = ?"), [flask.request.form.get('title', None), name])
-                
+
                 data_in = data[0][0]
                 data_in = data[0][0]
             else:
             else:
                 data_in = ''
                 data_in = ''
-                
+
             history_plus(
             history_plus(
-                name, 
-                data_in, 
-                get_time(), 
-                ip_check(), 
-                flask.request.form.get('send', ''), 
+                name,
+                data_in,
+                get_time(),
+                ip_check(),
+                flask.request.form.get('send', ''),
                 '0',
                 '0',
                 '<a>' + name + '</a> - <a>' + flask.request.form.get('title', 'test') + '</a> move'
                 '<a>' + name + '</a> - <a>' + flask.request.form.get('title', 'test') + '</a> move'
             )
             )
-            
+
             curs.execute(db_change("update back set type = 'no' where title = ? and not type = 'cat' and not type = 'no'"), [name])
             curs.execute(db_change("update back set type = 'no' where title = ? and not type = 'cat' and not type = 'no'"), [name])
             curs.execute(db_change("delete from back where title = ? and not type = 'cat' and type = 'no'"), [flask.request.form.get('title', None)])
             curs.execute(db_change("delete from back where title = ? and not type = 'cat' and type = 'no'"), [flask.request.form.get('title', None)])
 
 
@@ -90,8 +90,8 @@ def edit_move_2(conn, name):
             conn.commit()
             conn.commit()
 
 
             return redirect('/w/' + url_pas(flask.request.form.get('title', None)))
             return redirect('/w/' + url_pas(flask.request.form.get('title', None)))
-    else:            
-        return easy_minify(flask.render_template(skin_check(), 
+    else:
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('move') + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('move') + ')', 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 15 - 15
route/edit_req.py

@@ -18,7 +18,7 @@ def edit_req_2(conn, name):
             return redirect('/edit/' + url_pas(name))
             return redirect('/edit/' + url_pas(name))
         else:
         else:
             get_ver = int(number_check(get_ver))
             get_ver = int(number_check(get_ver))
-        
+
     if not get_ver:
     if not get_ver:
         curs.execute(db_change("select data from data where title = ?"), [name])
         curs.execute(db_change("select data from data where title = ?"), [name])
         old = curs.fetchall()
         old = curs.fetchall()
@@ -29,7 +29,7 @@ def edit_req_2(conn, name):
         old = curs.fetchall()
         old = curs.fetchall()
         if not old:
         if not old:
             return redirect('/w/' + url_pas(name))
             return redirect('/w/' + url_pas(name))
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')
             return re_error('/error/13')
@@ -47,15 +47,15 @@ def edit_req_2(conn, name):
 
 
             if flask.request.form.get('otent', '') == content:
             if flask.request.form.get('otent', '') == content:
                 return redirect('/w/' + url_pas(name))
                 return redirect('/w/' + url_pas(name))
-            
+
             if edit_filter_do(content) == 1:
             if edit_filter_do(content) == 1:
                 return re_error('/error/21')
                 return re_error('/error/21')
 
 
         content = savemark(content)
         content = savemark(content)
-        
+
         if old:
         if old:
             leng = leng_check(len(flask.request.form.get('otent', '')), len(content))
             leng = leng_check(len(flask.request.form.get('otent', '')), len(content))
-            
+
             if section:
             if section:
                 content = old[0][0].replace(flask.request.form.get('otent', ''), content)
                 content = old[0][0].replace(flask.request.form.get('otent', ''), content)
         else:
         else:
@@ -74,21 +74,21 @@ def edit_req_2(conn, name):
             for scan_user in curs.fetchall():
             for scan_user in curs.fetchall():
                 curs.execute(db_change("insert into alarm (name, data, date) values (?, ?, ?)"), [
                 curs.execute(db_change("insert into alarm (name, data, date) values (?, ?, ?)"), [
                     scan_user[0],
                     scan_user[0],
-                    ip + ' | <a href="/w/' + url_pas(name) + '">' + name + '</a> | Edit', 
+                    ip + ' | <a href="/w/' + url_pas(name) + '">' + name + '</a> | Edit',
                     today
                     today
                 ])
                 ])
 
 
             curs.execute(db_change("update history set type = '', send = ? where title = ? and id = ? and ip = ? and date = ? and type = 'req'"), [
             curs.execute(db_change("update history set type = '', send = ? where title = ? and id = ? and ip = ? and date = ? and type = 'req'"), [
-                old[0][1] + ' (' + ip + ' pass)', 
+                old[0][1] + ' (' + ip + ' pass)',
                 name,
                 name,
                 str(get_ver),
                 str(get_ver),
                 old[0][2],
                 old[0][2],
                 old[0][3]
                 old[0][3]
             ])
             ])
-            
+
             curs.execute(db_change("delete from back where link = ?"), [name])
             curs.execute(db_change("delete from back where link = ?"), [name])
             curs.execute(db_change("delete from back where title = ? and type = 'no'"), [name])
             curs.execute(db_change("delete from back where title = ? and type = 'no'"), [name])
-            
+
             render_set(
             render_set(
                 title = name,
                 title = name,
                 data = content,
                 data = content,
@@ -105,23 +105,23 @@ def edit_req_2(conn, name):
                 '',
                 '',
                 'req'
                 'req'
             )
             )
-        
+
         conn.commit()
         conn.commit()
-        
+
         if get_ver:
         if get_ver:
             return redirect('/w/' + url_pas(name))
             return redirect('/w/' + url_pas(name))
         else:
         else:
             return redirect('/recent_changes?set=req')
             return redirect('/recent_changes?set=req')
-    else:            
+    else:
         if old:
         if old:
             data = old[0][0]
             data = old[0][0]
         else:
         else:
             data = ''
             data = ''
-            
+
         data_old = data
         data_old = data
         get_name = ''
         get_name = ''
 
 
-        save_button = load_lang('edit_req') if not get_ver else load_lang('edit_req_check') 
+        save_button = load_lang('edit_req') if not get_ver else load_lang('edit_req_check')
         menu_plus = [[]]
         menu_plus = [[]]
         sub = load_lang('edit_req')
         sub = load_lang('edit_req')
         disable = '' if not get_ver else 'disabled'
         disable = '' if not get_ver else 'disabled'
@@ -140,7 +140,7 @@ def edit_req_2(conn, name):
         else:
         else:
             p_text = load_lang('defalut_edit_help')
             p_text = load_lang('defalut_edit_help')
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],
             data =  get_name + '''
             data =  get_name + '''
                 <form method="post">
                 <form method="post">

+ 12 - 12
route/edit_revert.py

@@ -20,7 +20,7 @@ def edit_revert_2(conn, name):
 
 
         if slow_edit_check() == 1:
         if slow_edit_check() == 1:
             return re_error('/error/24')
             return re_error('/error/24')
-    
+
         curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
         curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
         data = curs.fetchall()
         data = curs.fetchall()
         if data:
         if data:
@@ -29,8 +29,8 @@ def edit_revert_2(conn, name):
 
 
         curs.execute(db_change("delete from back where link = ?"), [name])
         curs.execute(db_change("delete from back where link = ?"), [name])
         conn.commit()
         conn.commit()
-        
-        if data:                                
+
+        if data:
             curs.execute(db_change("select data from data where title = ?"), [name])
             curs.execute(db_change("select data from data where title = ?"), [name])
             data_old = curs.fetchall()
             data_old = curs.fetchall()
             if data_old:
             if data_old:
@@ -39,13 +39,13 @@ def edit_revert_2(conn, name):
             else:
             else:
                 leng = '+' + str(len(data[0][0]))
                 leng = '+' + str(len(data[0][0]))
                 curs.execute(db_change("insert into data (title, data) values (?, ?)"), [name, data[0][0]])
                 curs.execute(db_change("insert into data (title, data) values (?, ?)"), [name, data[0][0]])
-                
+
             history_plus(
             history_plus(
-                name, 
-                data[0][0], 
-                get_time(), 
-                ip_check(), 
-                flask.request.form.get('send', ''), 
+                name,
+                data[0][0],
+                get_time(),
+                ip_check(),
+                flask.request.form.get('send', ''),
                 leng,
                 leng,
                 'r' + str(num) + ''
                 'r' + str(num) + ''
             )
             )
@@ -55,16 +55,16 @@ def edit_revert_2(conn, name):
                 data = data[0][0],
                 data = data[0][0],
                 num = 1
                 num = 1
             )
             )
-            
+
             conn.commit()
             conn.commit()
-            
+
         return redirect('/w/' + url_pas(name))
         return redirect('/w/' + url_pas(name))
     else:
     else:
         curs.execute(db_change("select title from history where title = ? and id = ?"), [name, str(num)])
         curs.execute(db_change("select title from history where title = ? and id = ?"), [name, str(num)])
         if not curs.fetchall():
         if not curs.fetchall():
             return redirect('/w/' + url_pas(name))
             return redirect('/w/' + url_pas(name))
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('revert') + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('revert') + ')', 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 14 - 14
route/func_upload.py

@@ -5,7 +5,7 @@ def func_upload_2(conn):
 
 
     if acl_check(None, 'upload') == 1:
     if acl_check(None, 'upload') == 1:
         return re_error('/ban')
         return re_error('/ban')
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')
             return re_error('/error/13')
@@ -18,16 +18,16 @@ def func_upload_2(conn):
 
 
         if int(wiki_set(3)) * 1024 * 1024 < flask.request.content_length:
         if int(wiki_set(3)) * 1024 * 1024 < flask.request.content_length:
             return re_error('/error/17')
             return re_error('/error/17')
-        
+
         value = os.path.splitext(data.filename)[1]
         value = os.path.splitext(data.filename)[1]
         if not value in ['.jpeg', '.jpg', '.gif', '.png', '.webp', '.JPEG', '.JPG', '.GIF', '.PNG', '.WEBP']:
         if not value in ['.jpeg', '.jpg', '.gif', '.png', '.webp', '.JPEG', '.JPG', '.GIF', '.PNG', '.WEBP']:
             return re_error('/error/14')
             return re_error('/error/14')
-    
+
         if flask.request.form.get('f_name', None):
         if flask.request.form.get('f_name', None):
             name = flask.request.form.get('f_name', None) + value
             name = flask.request.form.get('f_name', None) + value
         else:
         else:
             name = data.filename
             name = data.filename
-        
+
         piece = os.path.splitext(name)
         piece = os.path.splitext(name)
         if re.search('[^ㄱ-힣0-9a-zA-Z_\- ]', piece[0]):
         if re.search('[^ㄱ-힣0-9a-zA-Z_\- ]', piece[0]):
             return re_error('/error/22')
             return re_error('/error/22')
@@ -44,7 +44,7 @@ def func_upload_2(conn):
             t_re = re.compile(i[0])
             t_re = re.compile(i[0])
             if t_re.search(name):
             if t_re.search(name):
                 return redirect('/file_filter')
                 return redirect('/file_filter')
-            
+
         ip = ip_check()
         ip = ip_check()
 
 
         if flask.request.form.get('f_lice_sel', 'direct_input') == 'direct_input':
         if flask.request.form.get('f_lice_sel', 'direct_input') == 'direct_input':
@@ -63,16 +63,16 @@ def func_upload_2(conn):
                 lice += ' : '  + flask.request.form.get('f_lice', None)
                 lice += ' : '  + flask.request.form.get('f_lice', None)
 
 
             lice += '[[category:' + re.sub('\]', '_', flask.request.form.get('f_lice_sel', None)) + ']]'
             lice += '[[category:' + re.sub('\]', '_', flask.request.form.get('f_lice_sel', None)) + ']]'
-            
+
         if os.path.exists(os.path.join(app_var['path_data_image'], e_data)):
         if os.path.exists(os.path.join(app_var['path_data_image'], e_data)):
             os.remove(os.path.join(app_var['path_data_image'], e_data))
             os.remove(os.path.join(app_var['path_data_image'], e_data))
-            
+
             data.save(os.path.join(app_var['path_data_image'], e_data))
             data.save(os.path.join(app_var['path_data_image'], e_data))
         else:
         else:
             data.save(os.path.join(app_var['path_data_image'], e_data))
             data.save(os.path.join(app_var['path_data_image'], e_data))
 
 
         file_d = '[[file:' + name + ']][br][br]{{{[[file:' + name + ']]}}}[br][br]' + lice
         file_d = '[[file:' + name + ']][br][br]{{{[[file:' + name + ']]}}}[br][br]' + lice
-        
+
         curs.execute(db_change("insert into data (title, data) values (?, ?)"), ['file:' + name, file_d])
         curs.execute(db_change("insert into data (title, data) values (?, ?)"), ['file:' + name, file_d])
         curs.execute(db_change("insert into acl (title, decu, dis, why, view) values (?, 'admin', '', '', '')"), ['file:' + name])
         curs.execute(db_change("insert into acl (title, decu, dis, why, view) values (?, 'admin', '', '', '')"), ['file:' + name])
 
 
@@ -85,16 +85,16 @@ def func_upload_2(conn):
         history_plus(
         history_plus(
             'file:' + name,
             'file:' + name,
             file_d,
             file_d,
-            get_time(), 
-            ip, 
+            get_time(),
+            ip,
             ip,
             ip,
             '0',
             '0',
             'upload'
             'upload'
         )
         )
-        
+
         conn.commit()
         conn.commit()
-        
-        return redirect('/w/file:' + name)      
+
+        return redirect('/w/file:' + name)
     else:
     else:
         license_list = '''
         license_list = '''
             <option value="direct_input">''' + load_lang('direct_input') + '''</option>
             <option value="direct_input">''' + load_lang('direct_input') + '''</option>
@@ -107,7 +107,7 @@ def func_upload_2(conn):
                 <option value="''' + i[0] + '''">''' + i[0] + '''</option>
                 <option value="''' + i[0] + '''">''' + i[0] + '''</option>
             '''
             '''
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('upload'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('upload'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
             data =  '''
                 <a href="/file_filter">(''' + load_lang('file_filter_list') + ''')</a>
                 <a href="/file_filter">(''' + load_lang('file_filter_list') + ''')</a>

+ 25 - 25
route/give_acl.py

@@ -5,17 +5,17 @@ def give_acl_2(conn, name):
 
 
     check_ok = ''
     check_ok = ''
     ip = ip_check()
     ip = ip_check()
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         check_data = 'acl (' + name + ')'
         check_data = 'acl (' + name + ')'
     else:
     else:
         check_data = None
         check_data = None
-    
+
     user_data = re.search('^user:(.+)$', name)
     user_data = re.search('^user:(.+)$', name)
     if user_data:
     if user_data:
         if check_data and ip_or_user(ip) != 0:
         if check_data and ip_or_user(ip) != 0:
             return redirect('/login')
             return redirect('/login')
-        
+
         if user_data.groups()[0] != ip_check():
         if user_data.groups()[0] != ip_check():
             if admin_check(5) != 1:
             if admin_check(5) != 1:
                 if check_data:
                 if check_data:
@@ -38,17 +38,17 @@ def give_acl_2(conn, name):
             curs.execute(db_change("update acl set view = ? where title = ?"), [flask.request.form.get('view', ''), name])
             curs.execute(db_change("update acl set view = ? where title = ?"), [flask.request.form.get('view', ''), name])
         else:
         else:
             curs.execute(db_change("insert into acl (title, decu, dis, why, view) values (?, ?, ?, ?, ?)"), [
             curs.execute(db_change("insert into acl (title, decu, dis, why, view) values (?, ?, ?, ?, ?)"), [
-                name, 
-                flask.request.form.get('decu', ''), 
-                flask.request.form.get('dis', ''), 
-                flask.request.form.get('why', ''), 
+                name,
+                flask.request.form.get('decu', ''),
+                flask.request.form.get('dis', ''),
+                flask.request.form.get('why', ''),
                 flask.request.form.get('view', '')
                 flask.request.form.get('view', '')
             ])
             ])
-        
+
         curs.execute(db_change("select title from acl where title = ? and decu = '' and dis = '' and view = ''"), [name])
         curs.execute(db_change("select title from acl where title = ? and decu = '' and dis = '' and view = ''"), [name])
         if curs.fetchall():
         if curs.fetchall():
             curs.execute(db_change("delete from acl where title = ?"), [name])
             curs.execute(db_change("delete from acl where title = ?"), [name])
-            
+
         all_d = ''
         all_d = ''
         for i in ['decu', 'dis', 'view']:
         for i in ['decu', 'dis', 'view']:
             if flask.request.form.get(i, '') == '':
             if flask.request.form.get(i, '') == '':
@@ -59,20 +59,20 @@ def give_acl_2(conn, name):
                 all_d += flask.request.form.get(i, '')
                 all_d += flask.request.form.get(i, '')
                 if i != 'view':
                 if i != 'view':
                     all_d += ' | '
                     all_d += ' | '
-            
+
         admin_check(5, check_data + ' (' + all_d + ')')
         admin_check(5, check_data + ' (' + all_d + ')')
 
 
         conn.commit()
         conn.commit()
-            
-        return redirect('/acl/' + url_pas(name))            
+
+        return redirect('/acl/' + url_pas(name))
     else:
     else:
         data = '<h2>' + load_lang('document_acl') + '</h2><hr class=\"main_hr\"><select name="decu" ' + check_ok + '>'
         data = '<h2>' + load_lang('document_acl') + '</h2><hr class=\"main_hr\"><select name="decu" ' + check_ok + '>'
-    
+
         if re.search('^user:', name):
         if re.search('^user:', name):
             acl_list = ['', 'user', 'all']
             acl_list = ['', 'user', 'all']
         else:
         else:
             acl_list = ['', 'user', 'admin', 'owner', '50_edit', 'email']
             acl_list = ['', 'user', 'admin', 'owner', '50_edit', 'email']
-        
+
         curs.execute(db_change("select decu from acl where title = ?"), [name])
         curs.execute(db_change("select decu from acl where title = ?"), [name])
         acl_data = curs.fetchall()
         acl_data = curs.fetchall()
         for data_list in acl_list:
         for data_list in acl_list:
@@ -80,14 +80,14 @@ def give_acl_2(conn, name):
                 check = 'selected="selected"'
                 check = 'selected="selected"'
             else:
             else:
                 check = ''
                 check = ''
-            
+
             data += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
             data += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
-            
+
         data += '</select>'
         data += '</select>'
-        
+
         if not re.search('^user:', name):
         if not re.search('^user:', name):
             data += '<hr class=\"main_hr\"><h2>' + load_lang('discussion_acl') + '</h2><hr class=\"main_hr\"><select name="dis" ' + check_ok + '>'
             data += '<hr class=\"main_hr\"><h2>' + load_lang('discussion_acl') + '</h2><hr class=\"main_hr\"><select name="dis" ' + check_ok + '>'
-        
+
             curs.execute(db_change("select dis, why, view from acl where title = ?"), [name])
             curs.execute(db_change("select dis, why, view from acl where title = ?"), [name])
             acl_data = curs.fetchall()
             acl_data = curs.fetchall()
             for data_list in acl_list:
             for data_list in acl_list:
@@ -95,9 +95,9 @@ def give_acl_2(conn, name):
                     check = 'selected="selected"'
                     check = 'selected="selected"'
                 else:
                 else:
                     check = ''
                     check = ''
-                    
+
                 data += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
                 data += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
-                
+
             data += '</select>'
             data += '</select>'
 
 
             data += '<hr class=\"main_hr\"><h2>' + load_lang('view_acl') + '</h2><hr class=\"main_hr\"><select name="view" ' + check_ok + '>'
             data += '<hr class=\"main_hr\"><h2>' + load_lang('view_acl') + '</h2><hr class=\"main_hr\"><select name="view" ' + check_ok + '>'
@@ -106,9 +106,9 @@ def give_acl_2(conn, name):
                     check = 'selected="selected"'
                     check = 'selected="selected"'
                 else:
                 else:
                     check = ''
                     check = ''
-                    
+
                 data += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
                 data += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
-                
+
             data += '''
             data += '''
                 </select>
                 </select>
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
@@ -123,14 +123,14 @@ def give_acl_2(conn, name):
                     <li>owner : ''' + load_lang('owner_acl') + '''</li>
                     <li>owner : ''' + load_lang('owner_acl') + '''</li>
                 </ul>
                 </ul>
             '''
             '''
-                
+
             if check_ok == '':
             if check_ok == '':
                 if acl_data:
                 if acl_data:
                     data += '<hr class=\"main_hr\"><input value="' + html.escape(acl_data[0][1]) + '" placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>'
                     data += '<hr class=\"main_hr\"><input value="' + html.escape(acl_data[0][1]) + '" placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>'
                 else:
                 else:
                     data += '<hr class=\"main_hr\"><input placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>'
                     data += '<hr class=\"main_hr\"><input placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>'
-            
-        return easy_minify(flask.render_template(skin_check(), 
+
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('acl') + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('acl') + ')', 0])],
             data =  '''
             data =  '''
                 <form method="post">
                 <form method="post">

+ 8 - 8
route/give_admin.py

@@ -4,7 +4,7 @@ def give_admin_2(conn, name):
     curs = conn.cursor()
     curs = conn.cursor()
 
 
     owner = admin_check()
     owner = admin_check()
-    
+
     curs.execute(db_change("select acl from user where id = ?"), [name])
     curs.execute(db_change("select acl from user where id = ?"), [name])
     user = curs.fetchall()
     user = curs.fetchall()
     if not user:
     if not user:
@@ -31,16 +31,16 @@ def give_admin_2(conn, name):
             curs.execute(db_change("update user set acl = 'user' where id = ?"), [name])
             curs.execute(db_change("update user set acl = 'user' where id = ?"), [name])
         else:
         else:
             curs.execute(db_change("update user set acl = ? where id = ?"), [flask.request.form.get('select', None), name])
             curs.execute(db_change("update user set acl = ? where id = ?"), [flask.request.form.get('select', None), name])
-        
+
         conn.commit()
         conn.commit()
-        
-        return redirect('/admin/' + url_pas(name))            
+
+        return redirect('/admin/' + url_pas(name))
     else:
     else:
         if admin_check(7) != 1:
         if admin_check(7) != 1:
-            return re_error('/error/3')            
+            return re_error('/error/3')
 
 
         div = '<option value="X">X</option>'
         div = '<option value="X">X</option>'
-        
+
         curs.execute(db_change('select distinct name from alist order by name asc'))
         curs.execute(db_change('select distinct name from alist order by name asc'))
         for data in curs.fetchall():
         for data in curs.fetchall():
             if user[0][0] == data[0]:
             if user[0][0] == data[0]:
@@ -52,8 +52,8 @@ def give_admin_2(conn, name):
                         div += '<option value="' + data[0] + '">' + data[0] + '</option>'
                         div += '<option value="' + data[0] + '">' + data[0] + '</option>'
                 else:
                 else:
                     div += '<option value="' + data[0] + '">' + data[0] + '</option>'
                     div += '<option value="' + data[0] + '">' + data[0] + '</option>'
-        
-        return easy_minify(flask.render_template(skin_check(), 
+
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('authorize') + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('authorize') + ')', 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 9 - 9
route/give_admin_groups.py

@@ -2,19 +2,19 @@ from .tool.func import *
 
 
 def give_admin_groups_2(conn, name):
 def give_admin_groups_2(conn, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         if admin_check(None, 'admin_plus (' + name + ')') != 1:
         if admin_check(None, 'admin_plus (' + name + ')') != 1:
             return re_error('/error/3')
             return re_error('/error/3')
 
 
         curs.execute(db_change("delete from alist where name = ?"), [name])
         curs.execute(db_change("delete from alist where name = ?"), [name])
-        
+
         if flask.request.form.get('ban', 0) != 0:
         if flask.request.form.get('ban', 0) != 0:
             curs.execute(db_change("insert into alist (name, acl) values (?, 'ban')"), [name])
             curs.execute(db_change("insert into alist (name, acl) values (?, 'ban')"), [name])
 
 
         if flask.request.form.get('toron', 0) != 0:
         if flask.request.form.get('toron', 0) != 0:
             curs.execute(db_change("insert into alist (name, acl) values (?, 'toron')"), [name])
             curs.execute(db_change("insert into alist (name, acl) values (?, 'toron')"), [name])
-            
+
         if flask.request.form.get('check', 0) != 0:
         if flask.request.form.get('check', 0) != 0:
             curs.execute(db_change("insert into alist (name, acl) values (?, 'check')"), [name])
             curs.execute(db_change("insert into alist (name, acl) values (?, 'check')"), [name])
 
 
@@ -29,17 +29,17 @@ def give_admin_groups_2(conn, name):
 
 
         if flask.request.form.get('owner', 0) != 0:
         if flask.request.form.get('owner', 0) != 0:
             curs.execute(db_change("insert into alist (name, acl) values (?, 'owner')"), [name])
             curs.execute(db_change("insert into alist (name, acl) values (?, 'owner')"), [name])
-            
+
         conn.commit()
         conn.commit()
-        
+
         return redirect('/admin_plus/' + url_pas(name))
         return redirect('/admin_plus/' + url_pas(name))
-    else:        
+    else:
         data = '<ul>'
         data = '<ul>'
-        
+
         exist_list = ['', '', '', '', '', '', '', '']
         exist_list = ['', '', '', '', '', '', '', '']
 
 
         curs.execute(db_change('select acl from alist where name = ?'), [name])
         curs.execute(db_change('select acl from alist where name = ?'), [name])
-        acl_list = curs.fetchall()    
+        acl_list = curs.fetchall()
         for go in acl_list:
         for go in acl_list:
             if go[0] == 'ban':
             if go[0] == 'ban':
                 exist_list[0] = 'checked="checked"'
                 exist_list[0] = 'checked="checked"'
@@ -68,7 +68,7 @@ def give_admin_groups_2(conn, name):
 
 
         data += '</ul>'
         data += '</ul>'
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2(['(' + load_lang('admin_group') + ')', 0])],
             imp = [name, wiki_set(), custom(), other2(['(' + load_lang('admin_group') + ')', 0])],
             data =  '''
             data =  '''
                 <form method="post">
                 <form method="post">

+ 2 - 2
route/give_history_hidden.py

@@ -11,7 +11,7 @@ def give_history_hidden_2(conn, name):
             curs.execute(db_change("update history set hide = '' where title = ? and id = ?"), [name, num])
             curs.execute(db_change("update history set hide = '' where title = ? and id = ?"), [name, num])
         else:
         else:
             curs.execute(db_change("update history set hide = 'O' where title = ? and id = ?"), [name, num])
             curs.execute(db_change("update history set hide = 'O' where title = ? and id = ?"), [name, num])
-            
+
         conn.commit()
         conn.commit()
-    
+
     return redirect('/history/' + url_pas(name))
     return redirect('/history/' + url_pas(name))

+ 12 - 12
route/give_user_ban.py

@@ -15,7 +15,7 @@ def give_user_ban_2(conn, name):
 
 
     if ban_check(ip = ip_check(), tool = 'login') == 1:
     if ban_check(ip = ip_check(), tool = 'login') == 1:
         return re_error('/ban')
         return re_error('/ban')
-                
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         name = name if name else flask.request.form.get('name', 'test')
         name = name if name else flask.request.form.get('name', 'test')
 
 
@@ -36,15 +36,15 @@ def give_user_ban_2(conn, name):
             type_d = None
             type_d = None
 
 
         ban_insert(
         ban_insert(
-            name, 
-            end, 
-            flask.request.form.get('why', ''), 
-            flask.request.form.get('login', ''), 
+            name,
+            end,
+            flask.request.form.get('why', ''),
+            flask.request.form.get('login', ''),
             ip_check(),
             ip_check(),
             type_d
             type_d
         )
         )
 
 
-        return redirect('/block_log')     
+        return redirect('/block_log')
     else:
     else:
         if admin_check(1) != 1:
         if admin_check(1) != 1:
             return re_error('/error/3')
             return re_error('/error/3')
@@ -60,7 +60,7 @@ def give_user_ban_2(conn, name):
                 data = '<ul><li>' + load_lang('limitless') + '</li>'
                 data = '<ul><li>' + load_lang('limitless') + '</li>'
             else:
             else:
                 data = '<ul><li>' + load_lang('period') + ' : ' + end[0][0] + '</li>'
                 data = '<ul><li>' + load_lang('period') + ' : ' + end[0][0] + '</li>'
-                
+
             curs.execute(db_change("select block from ban where block = ? and login = 'O'"), [name])
             curs.execute(db_change("select block from ban where block = ? and login = 'O'"), [name])
             if curs.fetchall():
             if curs.fetchall():
                 data += '<li>' + load_lang('login_able') + '</li>'
                 data += '<li>' + load_lang('login_able') + '</li>'
@@ -72,14 +72,14 @@ def give_user_ban_2(conn, name):
         else:
         else:
             if name:
             if name:
                 main_name = name
                 main_name = name
-                
+
                 if name and re.search("^([0-9]{1,3}\.[0-9]{1,3})$", name):
                 if name and re.search("^([0-9]{1,3}\.[0-9]{1,3})$", name):
                     b_now = load_lang('band_ban')
                     b_now = load_lang('band_ban')
                 else:
                 else:
                     b_now = load_lang('ban')
                     b_now = load_lang('ban')
 
 
                 now = ' (' + b_now + ')'
                 now = ' (' + b_now + ')'
-                    
+
                 if name and ip_or_user(name) == 1:
                 if name and ip_or_user(name) == 1:
                     plus = '<input type="checkbox" name="login"> ' + load_lang('login_able') + '<hr class=\"main_hr\">'
                     plus = '<input type="checkbox" name="login"> ' + load_lang('login_able') + '<hr class=\"main_hr\">'
                 else:
                 else:
@@ -94,7 +94,7 @@ def give_user_ban_2(conn, name):
                 plus = '<input type="checkbox" name="login"> ' + load_lang('login_able') + '<hr class=\"main_hr\">'
                 plus = '<input type="checkbox" name="login"> ' + load_lang('login_able') + '<hr class=\"main_hr\">'
                 now = 0
                 now = 0
                 b_now = load_lang('ban')
                 b_now = load_lang('ban')
-                
+
             time_data = [
             time_data = [
                 ['86400', load_lang('1_day')],
                 ['86400', load_lang('1_day')],
                 ['432000‬', load_lang('5_day')],
                 ['432000‬', load_lang('5_day')],
@@ -108,7 +108,7 @@ def give_user_ban_2(conn, name):
                 insert_data += '<a href="javascript:insert_v(\'second\', \'' + i[0] + '\')">(' + i[1] + ')</a> '
                 insert_data += '<a href="javascript:insert_v(\'second\', \'' + i[0] + '\')">(' + i[1] + ')</a> '
 
 
             data = name + '''
             data = name + '''
-                <script>function insert_v(name, data) { document.getElementById(name).value = data; }</script>''' + insert_data + '''                
+                <script>function insert_v(name, data) { document.getElementById(name).value = data; }</script>''' + insert_data + '''
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
                 <input placeholder="''' + load_lang('ban_period') + ''' (''' + load_lang('second') + ''')" name="second" id="second" type="text">
                 <input placeholder="''' + load_lang('ban_period') + ''' (''' + load_lang('second') + ''')" name="second" id="second" type="text">
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
@@ -117,7 +117,7 @@ def give_user_ban_2(conn, name):
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
             ''' + plus
             ''' + plus
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [main_name, wiki_set(), custom(), other2([now, 0])],
             imp = [main_name, wiki_set(), custom(), other2([now, 0])],
             data = '''
             data = '''
                 <form method="post">
                 <form method="post">

+ 11 - 11
route/give_user_check.py

@@ -11,13 +11,13 @@ def give_user_check_2(conn, name):
 
 
     if admin_check(4, 'check (' + name + ')') != 1:
     if admin_check(4, 'check (' + name + ')') != 1:
         return re_error('/error/3')
         return re_error('/error/3')
-        
+
     num = int(number_check(flask.request.args.get('num', '1')))
     num = int(number_check(flask.request.args.get('num', '1')))
     if num * 50 > 0:
     if num * 50 > 0:
         sql_num = num * 50 - 50
         sql_num = num * 50 - 50
     else:
     else:
         sql_num = 0
         sql_num = 0
-    
+
     if flask.request.args.get('plus', None):
     if flask.request.args.get('plus', None):
         end_check = 1
         end_check = 1
 
 
@@ -27,18 +27,18 @@ def give_user_check_2(conn, name):
                 ('ip' if ip_or_user(flask.request.args.get('plus', None)) == 1 else 'name') + " = ? " + \
                 ('ip' if ip_or_user(flask.request.args.get('plus', None)) == 1 else 'name') + " = ? " + \
                 "order by today desc limit ?, 50" + \
                 "order by today desc limit ?, 50" + \
             ""), [
             ""), [
-            name, 
-            flask.request.args.get('plus', None), 
+            name,
+            flask.request.args.get('plus', None),
             sql_num
             sql_num
         ])
         ])
     else:
     else:
         end_check = 0
         end_check = 0
-        
+
         curs.execute(db_change("" + \
         curs.execute(db_change("" + \
             "select name, ip, ua, today from ua_d " + \
             "select name, ip, ua, today from ua_d " + \
             "where " + ('ip' if ip_or_user(name) == 1 else 'name') + " = ? order by today desc limit ?, 50" + \
             "where " + ('ip' if ip_or_user(name) == 1 else 'name') + " = ? order by today desc limit ?, 50" + \
         ""), [name, sql_num])
         ""), [name, sql_num])
-    
+
     record = curs.fetchall()
     record = curs.fetchall()
     if record:
     if record:
         if not flask.request.args.get('plus', None):
         if not flask.request.args.get('plus', None):
@@ -55,7 +55,7 @@ def give_user_check_2(conn, name):
                             <td id="main_table_width">''' + load_lang('time') + '''</td>
                             <td id="main_table_width">''' + load_lang('time') + '''</td>
                         </tr>
                         </tr>
                 '''
                 '''
-        
+
         for data in record:
         for data in record:
             if data[2]:
             if data[2]:
                 ua = data[2]
                 ua = data[2]
@@ -72,20 +72,20 @@ def give_user_check_2(conn, name):
                         <td colspan="3">''' + ua + '''</td>
                         <td colspan="3">''' + ua + '''</td>
                     </tr>
                     </tr>
                     '''
                     '''
-        
+
         div +=  '''
         div +=  '''
                     </tbody>
                     </tbody>
                 </table>
                 </table>
                 '''
                 '''
     else:
     else:
         return re_error('/error/2')
         return re_error('/error/2')
-        
+
     if end_check == 1:
     if end_check == 1:
         div += next_fix('/check/' + url_pas(name) + '?plus=' + flask.request.args.get('plus', None) + '&num=', num, record)
         div += next_fix('/check/' + url_pas(name) + '?plus=' + flask.request.args.get('plus', None) + '&num=', num, record)
     else:
     else:
         div += next_fix('/check/' + url_pas(name) + '?num=', num, record)
         div += next_fix('/check/' + url_pas(name) + '?num=', num, record)
-            
-    return easy_minify(flask.render_template(skin_check(),    
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('check'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('check'), wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['manager', load_lang('return')]]
         menu = [['manager', load_lang('return')]]

+ 4 - 4
route/inter_wiki.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def inter_wiki_2(conn, tools):
 def inter_wiki_2(conn, tools):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     div = ''
     div = ''
     admin = admin_check()
     admin = admin_check()
 
 
@@ -54,14 +54,14 @@ def inter_wiki_2(conn, tools):
         title = load_lang('file_filter_list')
         title = load_lang('file_filter_list')
         div = ''
         div = ''
 
 
-        curs.execute(db_change("select html from html_filter where kind = 'file'"))  
+        curs.execute(db_change("select html from html_filter where kind = 'file'"))
     elif tools == 'image_license':
     elif tools == 'image_license':
         del_link = 'del_image_license'
         del_link = 'del_image_license'
         plus_link = 'plus_image_license'
         plus_link = 'plus_image_license'
         title = load_lang('image_license_list')
         title = load_lang('image_license_list')
         div = ''
         div = ''
 
 
-        curs.execute(db_change("select html from html_filter where kind = 'image_license'"))  
+        curs.execute(db_change("select html from html_filter where kind = 'image_license'"))
     else:
     else:
         del_link = 'del_edit_top'
         del_link = 'del_edit_top'
         plus_link = 'plus_edit_top'
         plus_link = 'plus_edit_top'
@@ -99,7 +99,7 @@ def inter_wiki_2(conn, tools):
         if admin == 1:
         if admin == 1:
             div += '<a href="/' + plus_link + '">(' + load_lang('add') + ')</a>'
             div += '<a href="/' + plus_link + '">(' + load_lang('add') + ')</a>'
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [title, wiki_set(), custom(), other2([0, 0])],
         imp = [title, wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['manager/1', load_lang('return')]]
         menu = [['manager/1', load_lang('return')]]

+ 3 - 3
route/inter_wiki_del.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def inter_wiki_del_2(conn, tools, name):
 def inter_wiki_del_2(conn, tools, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     if admin_check(None, tools) == 1:
     if admin_check(None, tools) == 1:
         if tools == 'del_inter_wiki':
         if tools == 'del_inter_wiki':
             curs.execute(db_change("delete from inter where title = ?"), [name])
             curs.execute(db_change("delete from inter where title = ?"), [name])
@@ -15,10 +15,10 @@ def inter_wiki_del_2(conn, tools, name):
         elif tools == 'del_email_filter':
         elif tools == 'del_email_filter':
             curs.execute(db_change("delete from html_filter where html = ? and kind = 'email'"), [name])
             curs.execute(db_change("delete from html_filter where html = ? and kind = 'email'"), [name])
         elif tools == 'del_image_license':
         elif tools == 'del_image_license':
-            curs.execute(db_change("delete from html_filter where html = ? and kind = 'image_license'"), [name])    
+            curs.execute(db_change("delete from html_filter where html = ? and kind = 'image_license'"), [name])
         else:
         else:
             curs.execute(db_change("delete from html_filter where html = ? and kind = 'edit_top'"), [name])
             curs.execute(db_change("delete from html_filter where html = ? and kind = 'edit_top'"), [name])
-        
+
         conn.commit()
         conn.commit()
 
 
         return redirect('/' + re.sub('^del_', '', tools))
         return redirect('/' + re.sub('^del_', '', tools))

+ 23 - 23
route/inter_wiki_plus.py

@@ -2,18 +2,18 @@ from .tool.func import *
 
 
 def inter_wiki_plus_2(conn, tools, name):
 def inter_wiki_plus_2(conn, tools, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         if tools == 'plus_inter_wiki':
         if tools == 'plus_inter_wiki':
             if name:
             if name:
                 curs.execute(db_change("delete from inter where title = ?"), [name])
                 curs.execute(db_change("delete from inter where title = ?"), [name])
-                
+
             curs.execute(db_change('insert into inter (title, link, icon) values (?, ?, ?)'), [
             curs.execute(db_change('insert into inter (title, link, icon) values (?, ?, ?)'), [
-                flask.request.form.get('title', 'test'), 
+                flask.request.form.get('title', 'test'),
                 flask.request.form.get('link', 'test'),
                 flask.request.form.get('link', 'test'),
                 flask.request.form.get('icon', '')
                 flask.request.form.get('icon', '')
             ])
             ])
-            
+
             admin_check(None, 'inter_wiki_plus')
             admin_check(None, 'inter_wiki_plus')
         elif tools == 'plus_edit_filter':
         elif tools == 'plus_edit_filter':
             if admin_check(1, 'edit_filter edit') != 1:
             if admin_check(1, 'edit_filter edit') != 1:
@@ -29,12 +29,12 @@ def inter_wiki_plus_2(conn, tools, name):
 
 
                 curs.execute(db_change("delete from filter where name = ?"), [name])
                 curs.execute(db_change("delete from filter where name = ?"), [name])
                 curs.execute(db_change("insert into filter (name, regex, sub) values (?, ?, ?)"), [
                 curs.execute(db_change("insert into filter (name, regex, sub) values (?, ?, ?)"), [
-                    name, 
-                    flask.request.form.get('content', 'test'), 
+                    name,
+                    flask.request.form.get('content', 'test'),
                     end
                     end
                 ])
                 ])
             except:
             except:
-                return re_error('/error/23')                
+                return re_error('/error/23')
         else:
         else:
             plus_d = ''
             plus_d = ''
 
 
@@ -42,34 +42,34 @@ def inter_wiki_plus_2(conn, tools, name):
                 try:
                 try:
                     re.compile(flask.request.form.get('title', 'test'))
                     re.compile(flask.request.form.get('title', 'test'))
                 except:
                 except:
-                    return re_error('/error/23') 
+                    return re_error('/error/23')
 
 
                 admin_check(None, 'name_filter edit')
                 admin_check(None, 'name_filter edit')
-                
+
                 type_d = 'name'
                 type_d = 'name'
             elif tools == 'plus_file_filter':
             elif tools == 'plus_file_filter':
                 try:
                 try:
                     re.compile(flask.request.form.get('title', 'test'))
                     re.compile(flask.request.form.get('title', 'test'))
                 except:
                 except:
-                    return re_error('/error/23') 
-                
+                    return re_error('/error/23')
+
                 admin_check(None, 'file_filter edit')
                 admin_check(None, 'file_filter edit')
-                
+
                 type_d = 'file'
                 type_d = 'file'
             elif tools == 'plus_email_filter':
             elif tools == 'plus_email_filter':
                 admin_check(None, 'email_filter edit')
                 admin_check(None, 'email_filter edit')
-                
+
                 type_d = 'email'
                 type_d = 'email'
             elif tools == 'plus_image_license':
             elif tools == 'plus_image_license':
                 admin_check(None, 'image_license edit')
                 admin_check(None, 'image_license edit')
-                
+
                 type_d = 'image_license'
                 type_d = 'image_license'
             else:
             else:
                 admin_check(None, 'edit_top edit')
                 admin_check(None, 'edit_top edit')
-                
+
                 type_d = 'edit_top'
                 type_d = 'edit_top'
                 plus_d = flask.request.form.get('markup', 'test')
                 plus_d = flask.request.form.get('markup', 'test')
-            
+
             if name:
             if name:
                 curs.execute(db_change("delete from html_filter where html = ? and kind = ?"), [
                 curs.execute(db_change("delete from html_filter where html = ? and kind = ?"), [
                     name,
                     name,
@@ -77,13 +77,13 @@ def inter_wiki_plus_2(conn, tools, name):
                 ])
                 ])
 
 
             curs.execute(db_change('insert into html_filter (html, kind, plus) values (?, ?, ?)'), [
             curs.execute(db_change('insert into html_filter (html, kind, plus) values (?, ?, ?)'), [
-                flask.request.form.get('title', 'test'), 
-                type_d, 
+                flask.request.form.get('title', 'test'),
+                type_d,
                 plus_d
                 plus_d
             ])
             ])
-        
+
         conn.commit()
         conn.commit()
-    
+
         return redirect('/' + re.sub('^plus_', '', tools))
         return redirect('/' + re.sub('^plus_', '', tools))
     else:
     else:
         if admin_check(1) != 1:
         if admin_check(1) != 1:
@@ -121,7 +121,7 @@ def inter_wiki_plus_2(conn, tools, name):
             exist = curs.fetchall()
             exist = curs.fetchall()
             if exist:
             if exist:
                 textarea = exist[0][0]
                 textarea = exist[0][0]
-                
+
                 if exist[0][1] == 'X':
                 if exist[0][1] == 'X':
                     time_check = 'checked="checked"'
                     time_check = 'checked="checked"'
                     time_data = ''
                     time_data = ''
@@ -147,7 +147,7 @@ def inter_wiki_plus_2(conn, tools, name):
 
 
             title = load_lang('edit_filter_add')
             title = load_lang('edit_filter_add')
             form_data = '''
             form_data = '''
-                <script>function insert_v(name, data) { document.getElementById(name).value = data; }</script>''' + insert_data + '''                
+                <script>function insert_v(name, data) { document.getElementById(name).value = data; }</script>''' + insert_data + '''
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
                 <input placeholder="''' + load_lang('second') + '''" id="second" name="second" type="text" value="''' + html.escape(time_data) + '''">
                 <input placeholder="''' + load_lang('second') + '''" id="second" name="second" type="text" value="''' + html.escape(time_data) + '''">
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
@@ -203,7 +203,7 @@ def inter_wiki_plus_2(conn, tools, name):
                 <input value="''' + value + '''" type="text" name="markup">
                 <input value="''' + value + '''" type="text" name="markup">
             '''
             '''
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [title, wiki_set(), custom(), other2([0, 0])],
             imp = [title, wiki_set(), custom(), other2([0, 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 5 - 5
route/list_acl.py

@@ -2,9 +2,9 @@ from .tool.func import *
 
 
 def list_acl_2(conn):
 def list_acl_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     div = '<ul>'
     div = '<ul>'
-    
+
     curs.execute(db_change("select title, decu, dis, view, why from acl where decu != '' or dis != '' or view != '' order by title desc"))
     curs.execute(db_change("select title, decu, dis, view, why from acl where decu != '' or dis != '' or view != '' order by title desc"))
     list_data = curs.fetchall()
     list_data = curs.fetchall()
     for data in list_data:
     for data in list_data:
@@ -36,10 +36,10 @@ def list_acl_2(conn):
                     time_data + \
                     time_data + \
                 '</li>' + \
                 '</li>' + \
             ''
             ''
-        
+
     div += '</ul>'
     div += '</ul>'
-    
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('acl_document_list'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('acl_document_list'), wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['other', load_lang('return')]]
         menu = [['other', load_lang('return')]]

+ 5 - 5
route/list_admin.py

@@ -4,19 +4,19 @@ def list_admin_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
 
 
     div = '<ul>'
     div = '<ul>'
-    
+
     curs.execute(db_change("select id, acl, date from user where not acl = 'user' order by date desc"))
     curs.execute(db_change("select id, acl, date from user where not acl = 'user' order by date desc"))
     for data in curs.fetchall():
     for data in curs.fetchall():
         name = ip_pas(data[0]) + ' <a href="/admin_plus/' + url_pas(data[1]) + '">(' + data[1] + ')</a>'
         name = ip_pas(data[0]) + ' <a href="/admin_plus/' + url_pas(data[1]) + '">(' + data[1] + ')</a>'
-        
+
         if data[2] != '':
         if data[2] != '':
             name += '(' + data[2] + ')'
             name += '(' + data[2] + ')'
 
 
         div += '<li>' + name + '</li>'
         div += '<li>' + name + '</li>'
-        
+
     div += '</ul>'
     div += '</ul>'
-                
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('admin_list'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('admin_list'), wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['other', load_lang('return')]]
         menu = [['other', load_lang('return')]]

+ 3 - 3
route/list_admin_use.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def list_admin_use_2(conn):
 def list_admin_use_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     num = int(number_check(flask.request.args.get('num', '1')))
     num = int(number_check(flask.request.args.get('num', '1')))
     if num * 50 > 0:
     if num * 50 > 0:
         sql_num = num * 50 - 50
         sql_num = num * 50 - 50
@@ -23,13 +23,13 @@ def list_admin_use_2(conn):
             ])
             ])
 
 
         get_list = curs.fetchall()
         get_list = curs.fetchall()
-        for data in get_list:            
+        for data in get_list:
             list_data += '<li>' + ip_pas(data[0]) + ' / ' + data[1] + ' / ' + data[2] + '</li>'
             list_data += '<li>' + ip_pas(data[0]) + ' / ' + data[1] + ' / ' + data[2] + '</li>'
 
 
         list_data += '</ul>'
         list_data += '</ul>'
         list_data += next_fix('/admin_log?num=', num, get_list)
         list_data += next_fix('/admin_log?num=', num, get_list)
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('authority_use_list'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('authority_use_list'), wiki_set(), custom(), other2([0, 0])],
             data = '''
             data = '''
                 <form method="post">
                 <form method="post">

+ 14 - 14
route/list_block.py

@@ -8,7 +8,7 @@ def list_block_2(conn, name, tool):
         sql_num = num * 50 - 50
         sql_num = num * 50 - 50
     else:
     else:
         sql_num = 0
         sql_num = 0
-    
+
     div = '''
     div = '''
         <table id="main_table_set">
         <table id="main_table_set">
             <tbody>
             <tbody>
@@ -18,19 +18,19 @@ def list_block_2(conn, name, tool):
                     <td id="main_table_width">''' + load_lang('period') + '''</td>
                     <td id="main_table_width">''' + load_lang('period') + '''</td>
                 </tr>
                 </tr>
     '''
     '''
-    
+
     data_list = ''
     data_list = ''
 
 
     curs.execute(db_change("delete from ban where (end < ? and end like '2%')"), [get_time()])
     curs.execute(db_change("delete from ban where (end < ? and end like '2%')"), [get_time()])
     conn.commit()
     conn.commit()
-    
-    if not name:        
+
+    if not name:
         if flask.request.args.get('type', '') == 'ongoing':
         if flask.request.args.get('type', '') == 'ongoing':
             sub = ' (' + load_lang('in_progress') + ')'
             sub = ' (' + load_lang('in_progress') + ')'
             menu = [['block_log', load_lang('normal')]]
             menu = [['block_log', load_lang('normal')]]
 
 
             curs.execute(db_change("select why, block, '', end, '', band from ban where ((end > ? and end like '2%') or end = '') order by end desc limit ?, 50"), [
             curs.execute(db_change("select why, block, '', end, '', band from ban where ((end > ? and end like '2%') or end = '') order by end desc limit ?, 50"), [
-                get_time(), 
+                get_time(),
                 sql_num
                 sql_num
             ])
             ])
         else:
         else:
@@ -41,18 +41,18 @@ def list_block_2(conn, name, tool):
                 <a href="/manager/11">(''' + load_lang('blocked') + ''')</a> <a href="/manager/12">(''' + load_lang('admin') + ''')</a> <a href="?type=ongoing">(''' + load_lang('in_progress') + ''')</a>
                 <a href="/manager/11">(''' + load_lang('blocked') + ''')</a> <a href="/manager/12">(''' + load_lang('admin') + ''')</a> <a href="?type=ongoing">(''' + load_lang('in_progress') + ''')</a>
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
             ''' + div
             ''' + div
-            
+
             curs.execute(db_change("select why, block, blocker, end, today, band from rb order by today desc limit ?, 50"), [sql_num])
             curs.execute(db_change("select why, block, blocker, end, today, band from rb order by today desc limit ?, 50"), [sql_num])
     else:
     else:
         menu = [['block_log', load_lang('normal')]]
         menu = [['block_log', load_lang('normal')]]
-        
+
         if tool == 'block_user':
         if tool == 'block_user':
             sub = ' (' + load_lang('blocked') + ')'
             sub = ' (' + load_lang('blocked') + ')'
-            
+
             curs.execute(db_change("select why, block, blocker, end, today, band from rb where block = ? order by today desc limit ?, 50"), [name, sql_num])
             curs.execute(db_change("select why, block, blocker, end, today, band from rb where block = ? order by today desc limit ?, 50"), [name, sql_num])
         else:
         else:
             sub = ' (' + load_lang('admin') + ')'
             sub = ' (' + load_lang('admin') + ')'
-            
+
             curs.execute(db_change("select why, block, blocker, end, today, band from rb where blocker = ? order by today desc limit ?, 50"), [name, sql_num])
             curs.execute(db_change("select why, block, blocker, end, today, band from rb where blocker = ? order by today desc limit ?, 50"), [name, sql_num])
 
 
     if data_list == '':
     if data_list == '':
@@ -62,7 +62,7 @@ def list_block_2(conn, name, tool):
         why = html.escape(data[0])
         why = html.escape(data[0])
         if why == '':
         if why == '':
             why = '<br>'
             why = '<br>'
-        
+
         if data[5] == 'O':
         if data[5] == 'O':
             ip = data[1] + ' (' + load_lang('range') + ')'
             ip = data[1] + ' (' + load_lang('range') + ')'
         elif data[5] == 'regex':
         elif data[5] == 'regex':
@@ -88,7 +88,7 @@ def list_block_2(conn, name, tool):
             start = ''
             start = ''
         else:
         else:
             start = load_lang('start') + ' : ' + data[4]
             start = load_lang('start') + ' : ' + data[4]
-            
+
         div += '''
         div += '''
             <tr>
             <tr>
                 <td>''' + ip + '''</td>
                 <td>''' + ip + '''</td>
@@ -105,13 +105,13 @@ def list_block_2(conn, name, tool):
         '''
         '''
 
 
     div += '</tbody></table>'
     div += '</tbody></table>'
-    
+
     if not name:
     if not name:
         div += next_fix('/block_log?num=', num, data_list)
         div += next_fix('/block_log?num=', num, data_list)
     else:
     else:
         div += next_fix('/' + url_pas(tool) + '/' + url_pas(name) + '?num=', num, data_list)
         div += next_fix('/' + url_pas(tool) + '/' + url_pas(name) + '?num=', num, data_list)
-                
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('recent_ban'), wiki_set(), custom(), other2([sub, 0])],
         imp = [load_lang('recent_ban'), wiki_set(), custom(), other2([sub, 0])],
         data = div,
         data = div,
         menu = menu
         menu = menu

+ 3 - 3
route/list_give.py

@@ -7,15 +7,15 @@ def list_give_2(conn):
     back = ''
     back = ''
 
 
     curs.execute(db_change("select distinct name from alist order by name asc"))
     curs.execute(db_change("select distinct name from alist order by name asc"))
-    for data in curs.fetchall():                      
+    for data in curs.fetchall():
         if back != data[0]:
         if back != data[0]:
             back = data[0]
             back = data[0]
 
 
         list_data += '<li><a href="/admin_plus/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
         list_data += '<li><a href="/admin_plus/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
-    
+
     list_data += '</ul><hr class=\"main_hr\"><a href="/manager/8">(' + load_lang('add') + ')</a>'
     list_data += '</ul><hr class=\"main_hr\"><a href="/manager/8">(' + load_lang('add') + ')</a>'
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('admin_group_list'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('admin_group_list'), wiki_set(), custom(), other2([0, 0])],
         data = list_data,
         data = list_data,
         menu = [['manager', load_lang('return')]]
         menu = [['manager', load_lang('return')]]

+ 3 - 3
route/list_not_close_topic.py

@@ -4,16 +4,16 @@ def list_not_close_topic_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
 
 
     div = '<ul>'
     div = '<ul>'
-    
+
     curs.execute(db_change('select title, sub, date from rd where stop != "O" order by date desc'))
     curs.execute(db_change('select title, sub, date from rd where stop != "O" order by date desc'))
     n_list = curs.fetchall()
     n_list = curs.fetchall()
     for data in n_list:
     for data in n_list:
         curs.execute(db_change("select code from topic where id = '1' and title = ? and sub = ?"), [data[0], data[1]])
         curs.execute(db_change("select code from topic where id = '1' and title = ? and sub = ?"), [data[0], data[1]])
         div += '<li><a href="/thread/' + url_pas(curs.fetchall()[0][0]) + '">' + html.escape(data[0]) + '</a> (' + data[1] + ') | ' + data[2] + '</li>'
         div += '<li><a href="/thread/' + url_pas(curs.fetchall()[0][0]) + '">' + html.escape(data[0]) + '</a> (' + data[1] + ') | ' + data[2] + '</li>'
-            
+
     div += '</ul>'
     div += '</ul>'
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('open_discussion_list'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('open_discussion_list'), wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['manager', load_lang('return')]]
         menu = [['manager', load_lang('return')]]

+ 3 - 3
route/list_old_page.py

@@ -10,7 +10,7 @@ def list_old_page_2(conn):
         sql_num = 0
         sql_num = 0
 
 
     div = '<ul>'
     div = '<ul>'
-    
+
     curs.execute(db_change('' + \
     curs.execute(db_change('' + \
         'select title, date from history h ' + \
         'select title, date from history h ' + \
         "where title not like 'user:%' and title not like 'category:%' and title not like 'file:%' and " + \
         "where title not like 'user:%' and title not like 'category:%' and title not like 'file:%' and " + \
@@ -23,10 +23,10 @@ def list_old_page_2(conn):
     n_list = curs.fetchall()
     n_list = curs.fetchall()
     for data in n_list:
     for data in n_list:
         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> (' + re.sub(' .*$', '', data[1]) + ')</li>'
         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> (' + re.sub(' .*$', '', data[1]) + ')</li>'
-    
+
     div += '</ul>' + next_fix('/old_page?num=', num, n_list)
     div += '</ul>' + next_fix('/old_page?num=', num, n_list)
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('old_page'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('old_page'), wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['other', load_lang('return')]]
         menu = [['other', load_lang('return')]]

+ 6 - 6
route/list_please.py

@@ -8,17 +8,17 @@ def list_please_2(conn):
         sql_num = num * 50 - 50
         sql_num = num * 50 - 50
     else:
     else:
         sql_num = 0
         sql_num = 0
-        
+
     div = '<ul>'
     div = '<ul>'
-    
+
     curs.execute(db_change("select distinct title from back where type = 'no' order by title asc limit ?, 50"), [sql_num])
     curs.execute(db_change("select distinct title from back where type = 'no' order by title asc limit ?, 50"), [sql_num])
     data_list = curs.fetchall()
     data_list = curs.fetchall()
     for data in data_list:
     for data in data_list:
-        div += '<li><a id="not_thing" href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'   
-        
+        div += '<li><a id="not_thing" href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
+
     div += '</ul>' + next_fix('/please?num=', num, data_list)
     div += '</ul>' + next_fix('/please?num=', num, data_list)
-    
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('need_document'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('need_document'), wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['other', load_lang('return')]]
         menu = [['other', load_lang('return')]]

+ 5 - 5
route/list_title_index.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def list_title_index_2(conn):
 def list_title_index_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     page = int(number_check(flask.request.args.get('page', '1')))
     page = int(number_check(flask.request.args.get('page', '1')))
     num = int(number_check(flask.request.args.get('num', '100')))
     num = int(number_check(flask.request.args.get('num', '100')))
     if page * num > 0:
     if page * num > 0:
@@ -23,7 +23,7 @@ def list_title_index_2(conn):
         data += '<hr class=\"main_hr\"><ul>'
         data += '<hr class=\"main_hr\"><ul>'
 
 
     for list_data in title_list:
     for list_data in title_list:
-        data += '<li>' + str(all_list) + '. <a href="/w/' + url_pas(list_data[0]) + '">' + list_data[0] + '</a></li>'        
+        data += '<li>' + str(all_list) + '. <a href="/w/' + url_pas(list_data[0]) + '">' + list_data[0] + '</a></li>'
         all_list += 1
         all_list += 1
 
 
     if page == 1:
     if page == 1:
@@ -48,7 +48,7 @@ def list_title_index_2(conn):
                     count_end += [0]
                     count_end += [0]
 
 
             count_end += [count_end[0] - count_end[1]  - count_end[2]  - count_end[3]]
             count_end += [count_end[0] - count_end[1]  - count_end[2]  - count_end[3]]
-        
+
             data += '''
             data += '''
                 </ul>
                 </ul>
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">
@@ -72,8 +72,8 @@ def list_title_index_2(conn):
 
 
     data += '</ul>' + next_fix('/title_index?num=' + str(num) + '&page=', page, title_list, num)
     data += '</ul>' + next_fix('/title_index?num=' + str(num) + '&page=', page, title_list, num)
     sub = ' (' + str(num) + ')'
     sub = ' (' + str(num) + ')'
-    
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('all_document_list'), wiki_set(), custom(), other2([sub, 0])],
         imp = [load_lang('all_document_list'), wiki_set(), custom(), other2([sub, 0])],
         data = data,
         data = data,
         menu = [['other', load_lang('return')]]
         menu = [['other', load_lang('return')]]

+ 5 - 5
route/list_user.py

@@ -8,11 +8,11 @@ def list_user_2(conn):
         sql_num = num * 50 - 50
         sql_num = num * 50 - 50
     else:
     else:
         sql_num = 0
         sql_num = 0
-        
+
     list_data = '<ul>'
     list_data = '<ul>'
 
 
     admin_one = admin_check(1)
     admin_one = admin_check(1)
-    
+
     curs.execute(db_change("select id, date from user order by date desc limit ?, 50"), [sql_num])
     curs.execute(db_change("select id, date from user order by date desc limit ?, 50"), [sql_num])
     user_list = curs.fetchall()
     user_list = curs.fetchall()
     for data in user_list:
     for data in user_list:
@@ -24,9 +24,9 @@ def list_user_2(conn):
                 ban_button = ' <a href="/ban/' + url_pas(data[0]) + '">(' + load_lang('ban') + ')</a>'
                 ban_button = ' <a href="/ban/' + url_pas(data[0]) + '">(' + load_lang('ban') + ')</a>'
         else:
         else:
             ban_button = ''
             ban_button = ''
-            
+
         list_data += '<li>' + ip_pas(data[0]) + ban_button
         list_data += '<li>' + ip_pas(data[0]) + ban_button
-        
+
         if data[1] != '':
         if data[1] != '':
             list_data += ' (' + data[1] + ')'
             list_data += ' (' + data[1] + ')'
 
 
@@ -39,7 +39,7 @@ def list_user_2(conn):
 
 
     list_data += next_fix('/user_log?num=', num, user_list)
     list_data += next_fix('/user_log?num=', num, user_list)
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('member_list'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('member_list'), wiki_set(), custom(), other2([0, 0])],
         data = list_data,
         data = list_data,
         menu = [['other', load_lang('return')]]
         menu = [['other', load_lang('return')]]

+ 9 - 9
route/list_user_topic.py

@@ -8,7 +8,7 @@ def list_user_topic_2(conn, name):
         sql_num = num * 50 - 50
         sql_num = num * 50 - 50
     else:
     else:
         sql_num = 0
         sql_num = 0
-    
+
     one_admin = admin_check(1)
     one_admin = admin_check(1)
 
 
     div =   '''
     div =   '''
@@ -20,13 +20,13 @@ def list_user_topic_2(conn, name):
                         <td id="main_table_width">''' + load_lang('time') + '''</td>
                         <td id="main_table_width">''' + load_lang('time') + '''</td>
                     </tr>
                     </tr>
             '''
             '''
-    
+
     curs.execute(db_change("select title, id, sub, ip, date from topic where ip = ? order by date desc limit ?, 50"), [name, sql_num])
     curs.execute(db_change("select title, id, sub, ip, date from topic where ip = ? order by date desc limit ?, 50"), [name, sql_num])
     data_list = curs.fetchall()
     data_list = curs.fetchall()
     for data in data_list:
     for data in data_list:
         title = html.escape(data[0])
         title = html.escape(data[0])
         sub = html.escape(data[2])
         sub = html.escape(data[2])
-        
+
         if one_admin == 1:
         if one_admin == 1:
             curs.execute(db_change("select * from ban where block = ?"), [data[3]])
             curs.execute(db_change("select * from ban where block = ?"), [data[3]])
             if curs.fetchall():
             if curs.fetchall():
@@ -35,21 +35,21 @@ def list_user_topic_2(conn, name):
                 ban = ' <a href="/ban/' + url_pas(data[3]) + '">(' + load_lang('ban') + ')</a>'
                 ban = ' <a href="/ban/' + url_pas(data[3]) + '">(' + load_lang('ban') + ')</a>'
         else:
         else:
             ban = ''
             ban = ''
-            
+
         curs.execute(db_change("select code from topic where id = '1' and title = ? and sub = ?"), [title, sub])
         curs.execute(db_change("select code from topic where id = '1' and title = ? and sub = ?"), [title, sub])
         div += '<tr><td><a href="/thread/' + url_pas(curs.fetchall()[0][0]) + '#' + data[1] + '">' + title + '#' + data[1] + '</a> (' + sub + ')</td>'
         div += '<tr><td><a href="/thread/' + url_pas(curs.fetchall()[0][0]) + '#' + data[1] + '">' + title + '#' + data[1] + '</a> (' + sub + ')</td>'
         div += '<td>' + ip_pas(data[3]) + ban + '</td><td>' + data[4] + '</td></tr>'
         div += '<td>' + ip_pas(data[3]) + ban + '</td><td>' + data[4] + '</td></tr>'
 
 
     div += '</tbody></table>'
     div += '</tbody></table>'
-    div += next_fix('/topic_record/' + url_pas(name) + '?num=', num, data_list)      
-    
+    div += next_fix('/topic_record/' + url_pas(name) + '?num=', num, data_list)
+
     curs.execute(db_change("select end from ban where block = ?"), [name])
     curs.execute(db_change("select end from ban where block = ?"), [name])
     if curs.fetchall():
     if curs.fetchall():
         sub = ' (' + load_lang('blocked') + ')'
         sub = ' (' + load_lang('blocked') + ')'
     else:
     else:
-        sub = 0 
-    
-    return easy_minify(flask.render_template(skin_check(), 
+        sub = 0
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('discussion_record'), wiki_set(), custom(), other2([sub, 0])],
         imp = [load_lang('discussion_record'), wiki_set(), custom(), other2([sub, 0])],
         data = div,
         data = div,
         menu = [['other', load_lang('other')], ['user', load_lang('user')], ['count/' + url_pas(name), load_lang('count')], ['record/' + url_pas(name), load_lang('record')]]
         menu = [['other', load_lang('other')], ['user', load_lang('user')], ['count/' + url_pas(name), load_lang('count')], ['record/' + url_pas(name), load_lang('record')]]

+ 14 - 14
route/login.py

@@ -6,16 +6,16 @@ def login_2(conn):
     ip = ip_check()
     ip = ip_check()
     if ip_or_user(ip) == 0:
     if ip_or_user(ip) == 0:
         return redirect('/user')
         return redirect('/user')
-    
+
     if ban_check(tool = 'login') == 1:
     if ban_check(tool = 'login') == 1:
         return re_error('/ban')
         return re_error('/ban')
-        
-    if flask.request.method == 'POST':        
+
+    if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')
             return re_error('/error/13')
         else:
         else:
             captcha_post('', 0)
             captcha_post('', 0)
-            
+
         agent = flask.request.headers.get('User-Agent')
         agent = flask.request.headers.get('User-Agent')
 
 
         curs.execute(db_change("select pw, encode from user where id = ?"), [flask.request.form.get('id', None)])
         curs.execute(db_change("select pw, encode from user where id = ?"), [flask.request.form.get('id', None)])
@@ -24,7 +24,7 @@ def login_2(conn):
             return re_error('/error/2')
             return re_error('/error/2')
 
 
         pw_check_d = pw_check(
         pw_check_d = pw_check(
-            flask.request.form.get('pw', ''), 
+            flask.request.form.get('pw', ''),
             user[0][0],
             user[0][0],
             user[0][1],
             user[0][1],
             flask.request.form.get('id', None)
             flask.request.form.get('id', None)
@@ -34,7 +34,7 @@ def login_2(conn):
 
 
         flask.session['state'] = 1
         flask.session['state'] = 1
         flask.session['id'] = flask.request.form.get('id', None)
         flask.session['id'] = flask.request.form.get('id', None)
-        
+
         curs.execute(db_change("select css from custom where user = ?"), [flask.request.form.get('id', None)])
         curs.execute(db_change("select css from custom where user = ?"), [flask.request.form.get('id', None)])
         css_data = curs.fetchall()
         css_data = curs.fetchall()
         if css_data:
         if css_data:
@@ -45,8 +45,8 @@ def login_2(conn):
         curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [flask.request.form.get('id', None), ip_check(1), agent, get_time()])
         curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [flask.request.form.get('id', None), ip_check(1), agent, get_time()])
 
 
         conn.commit()
         conn.commit()
-        
-        return redirect('/user')  
+
+        return redirect('/user')
     else:
     else:
         oauth_check = 0
         oauth_check = 0
         oauth_content = '<hr class=\"main_hr\"><div class="oauth-wrapper"><ul class="oauth-list">'
         oauth_content = '<hr class=\"main_hr\"><div class="oauth-wrapper"><ul class="oauth-list">'
@@ -64,22 +64,22 @@ def login_2(conn):
                         </a>
                         </a>
                     </li>
                     </li>
                 '''.format(
                 '''.format(
-                    oauth_supported[i], 
-                    oauth_supported[i], 
-                    oauth_supported[i], 
+                    oauth_supported[i],
+                    oauth_supported[i],
+                    oauth_supported[i],
                     load_lang('oauth_signin_' + oauth_supported[i])
                     load_lang('oauth_signin_' + oauth_supported[i])
                 )
                 )
 
 
                 oauth_check = 1
                 oauth_check = 1
-        
+
         oauth_content += '</ul></div>'
         oauth_content += '</ul></div>'
 
 
         if oauth_check == 0:
         if oauth_check == 0:
             oauth_content = ''
             oauth_content = ''
 
 
         http_warring = '<hr class=\"main_hr\"><span>' + load_lang('http_warring') + '</span>'
         http_warring = '<hr class=\"main_hr\"><span>' + load_lang('http_warring') + '</span>'
-        
-        return easy_minify(flask.render_template(skin_check(),    
+
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('login'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('login'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 22 - 22
route/login_check_key.py

@@ -24,7 +24,7 @@ def login_check_key_2(conn, tool):
                 else:
                 else:
                     b_text = ''
                     b_text = ''
 
 
-                return easy_minify(flask.render_template(skin_check(),    
+                return easy_minify(flask.render_template(skin_check(),
                     imp = [load_lang('reset_user_ok'), wiki_set(), custom(), other2([0, 0])],
                     imp = [load_lang('reset_user_ok'), wiki_set(), custom(), other2([0, 0])],
                     data = b_text + load_lang('id') + ' : ' + d_id + '<br>' + load_lang('password') + ' : ' + pw,
                     data = b_text + load_lang('id') + ' : ' + d_id + '<br>' + load_lang('password') + ' : ' + pw,
                     menu = [['user', load_lang('return')]]
                     menu = [['user', load_lang('return')]]
@@ -33,56 +33,56 @@ def login_check_key_2(conn, tool):
                 return redirect('/pass_find')
                 return redirect('/pass_find')
         else:
         else:
             ip = ip_check()
             ip = ip_check()
-            
+
             if 'c_id' in flask.session and flask.session['c_key'] == flask.request.form.get('key', None):
             if 'c_id' in flask.session and flask.session['c_key'] == flask.request.form.get('key', None):
                 curs.execute(db_change('select data from other where name = "encode"'))
                 curs.execute(db_change('select data from other where name = "encode"'))
                 db_data = curs.fetchall()
                 db_data = curs.fetchall()
-                
+
                 if tool == 'check_key':
                 if tool == 'check_key':
                     curs.execute(db_change("select id from user limit 1"))
                     curs.execute(db_change("select id from user limit 1"))
                     if not curs.fetchall():
                     if not curs.fetchall():
                         curs.execute(db_change("insert into user (id, pw, acl, date, encode) values (?, ?, 'owner', ?, ?)"), [
                         curs.execute(db_change("insert into user (id, pw, acl, date, encode) values (?, ?, 'owner', ?, ?)"), [
-                            flask.session['c_id'], 
-                            flask.session['c_pw'], 
-                            get_time(), 
+                            flask.session['c_id'],
+                            flask.session['c_pw'],
+                            get_time(),
                             db_data[0][0]
                             db_data[0][0]
                         ])
                         ])
-    
+
                         first = 1
                         first = 1
                     else:
                     else:
                         curs.execute(db_change("insert into user (id, pw, acl, date, encode) values (?, ?, 'user', ?, ?)"), [
                         curs.execute(db_change("insert into user (id, pw, acl, date, encode) values (?, ?, 'user', ?, ?)"), [
-                            flask.session['c_id'], 
-                            flask.session['c_pw'], 
-                            get_time(), 
+                            flask.session['c_id'],
+                            flask.session['c_pw'],
+                            get_time(),
                             db_data[0][0]
                             db_data[0][0]
                         ])
                         ])
-    
+
                         first = 0
                         first = 0
-    
+
                     agent = flask.request.headers.get('User-Agent')
                     agent = flask.request.headers.get('User-Agent')
-    
+
                     curs.execute(db_change("insert into user_set (name, id, data) values ('email', ?, ?)"), [
                     curs.execute(db_change("insert into user_set (name, id, data) values ('email', ?, ?)"), [
-                        flask.session['c_id'], 
+                        flask.session['c_id'],
                         flask.session['c_email']
                         flask.session['c_email']
                     ])
                     ])
                     curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [
                     curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [
-                        flask.session['c_id'], 
-                        ip, 
-                        agent, 
+                        flask.session['c_id'],
+                        ip,
+                        agent,
                         get_time()
                         get_time()
                     ])
                     ])
-    
+
                     flask.session['state'] = 1
                     flask.session['state'] = 1
                     flask.session['id'] = flask.session['c_id']
                     flask.session['id'] = flask.session['c_id']
                     flask.session['head'] = ''
                     flask.session['head'] = ''
-                            
+
                     conn.commit()
                     conn.commit()
                 else:
                 else:
                     curs.execute(db_change('delete from user_set where name = "email" and id = ?'), [ip])
                     curs.execute(db_change('delete from user_set where name = "email" and id = ?'), [ip])
                     curs.execute(db_change('insert into user_set (name, id, data) values ("email", ?, ?)'), [ip, flask.session['c_email']])
                     curs.execute(db_change('insert into user_set (name, id, data) values ("email", ?, ?)'), [ip, flask.session['c_email']])
-                    
+
                     first = 0
                     first = 0
-                          
+
                 flask.session.pop('c_id', None)
                 flask.session.pop('c_id', None)
                 flask.session.pop('c_pw', None)
                 flask.session.pop('c_pw', None)
                 flask.session.pop('c_key', None)
                 flask.session.pop('c_key', None)
@@ -107,7 +107,7 @@ def login_check_key_2(conn, tool):
         else:
         else:
             b_text = ''
             b_text = ''
 
 
-        return easy_minify(flask.render_template(skin_check(),    
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('check_key'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('check_key'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
             data =  '''
                 <form method="post">
                 <form method="post">

+ 7 - 7
route/login_need_email.py

@@ -28,7 +28,7 @@ def login_need_email_2(conn, tool):
                     i_text = 'Key : ' + flask.session['c_key']
                     i_text = 'Key : ' + flask.session['c_key']
 
 
                 send_email(flask.request.form.get('email', ''), t_text, i_text)
                 send_email(flask.request.form.get('email', ''), t_text, i_text)
-                
+
                 return redirect('/check_pass_key')
                 return redirect('/check_pass_key')
             else:
             else:
                 return re_error('/error/12')
                 return re_error('/error/12')
@@ -37,7 +37,7 @@ def login_need_email_2(conn, tool):
                 flask.session['c_key'] = ''.join(random.choice("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") for i in range(16))
                 flask.session['c_key'] = ''.join(random.choice("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") for i in range(16))
                 flask.session['c_id'] = ip_check()
                 flask.session['c_id'] = ip_check()
                 flask.session['c_pw'] = ''
                 flask.session['c_pw'] = ''
-            
+
             if 'c_id' in flask.session:
             if 'c_id' in flask.session:
                 main_email = ['naver.com', 'gmail.com', 'daum.net', 'kakao.com']
                 main_email = ['naver.com', 'gmail.com', 'daum.net', 'kakao.com']
                 data = re.search('@([^@]+)$', flask.request.form.get('email', ''))
                 data = re.search('@([^@]+)$', flask.request.form.get('email', ''))
@@ -51,7 +51,7 @@ def login_need_email_2(conn, tool):
                             flask.session.pop('c_id', None)
                             flask.session.pop('c_id', None)
                             flask.session.pop('c_pw', None)
                             flask.session.pop('c_pw', None)
                             flask.session.pop('c_key', None)
                             flask.session.pop('c_key', None)
-                            
+
                             # user 대신 오류 화면 보여주게 수정 필요
                             # user 대신 오류 화면 보여주게 수정 필요
                             return redirect('/user')
                             return redirect('/user')
                         else:
                         else:
@@ -71,14 +71,14 @@ def login_need_email_2(conn, tool):
 
 
                             send_email(flask.request.form.get('email', ''), t_text, i_text)
                             send_email(flask.request.form.get('email', ''), t_text, i_text)
                             flask.session['c_email'] = flask.request.form.get('email', '')
                             flask.session['c_email'] = flask.request.form.get('email', '')
-                  
+
                             if tool == 'email_change':
                             if tool == 'email_change':
                                 return redirect('/email_replace')
                                 return redirect('/email_replace')
                             else:
                             else:
                                 return redirect('/check_key')
                                 return redirect('/check_key')
                     else:
                     else:
                         return redirect('/email_filter')
                         return redirect('/email_filter')
-            
+
             return redirect('/user')
             return redirect('/user')
     else:
     else:
         if tool == 'pass_find':
         if tool == 'pass_find':
@@ -89,7 +89,7 @@ def login_need_email_2(conn, tool):
             else:
             else:
                 b_text = ''
                 b_text = ''
 
 
-            return easy_minify(flask.render_template(skin_check(),    
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('password_search'), wiki_set(), custom(), other2([0, 0])],
                 imp = [load_lang('password_search'), wiki_set(), custom(), other2([0, 0])],
                 data =  b_text + '''
                 data =  b_text + '''
                         <form method="post">
                         <form method="post">
@@ -110,7 +110,7 @@ def login_need_email_2(conn, tool):
             else:
             else:
                 b_text = ''
                 b_text = ''
 
 
-            return easy_minify(flask.render_template(skin_check(),    
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('email'), wiki_set(), custom(), other2([0, 0])],
                 imp = [load_lang('email'), wiki_set(), custom(), other2([0, 0])],
                 data =  '''
                 data =  '''
                         <a href="/email_filter">(''' + load_lang('email_filter_list') + ''')</a>
                         <a href="/email_filter">(''' + load_lang('email_filter_list') + ''')</a>

+ 30 - 30
route/login_oauth.py

@@ -32,15 +32,15 @@ def login_oauth_2(conn, platform, func):
 
 
     if func == 'init':
     if func == 'init':
         if oauth_data['client_id'] == '' or oauth_data['client_secret'] == '':
         if oauth_data['client_id'] == '' or oauth_data['client_secret'] == '':
-            return easy_minify(flask.render_template(skin_check(), 
-                imp = [load_lang('error'), wiki_set(), custom(), other2([0, 0])], 
-                data = load_lang('oauth_disabled'), 
+            return easy_minify(flask.render_template(skin_check(),
+                imp = [load_lang('error'), wiki_set(), custom(), other2([0, 0])],
+                data = load_lang('oauth_disabled'),
                 menu = [['user', load_lang('return')]]
                 menu = [['user', load_lang('return')]]
             ))
             ))
         elif publish_url == 'https://':
         elif publish_url == 'https://':
-            return easy_minify(flask.render_template(skin_check(), 
-                imp = [load_lang('error'), wiki_set(), custom(), other2([0, 0])], 
-                data = load_lang('oauth_setting_not_found'), 
+            return easy_minify(flask.render_template(skin_check(),
+                imp = [load_lang('error'), wiki_set(), custom(), other2([0, 0])],
+                data = load_lang('oauth_setting_not_found'),
                 menu = [['user', load_lang('return')]]
                 menu = [['user', load_lang('return')]]
             ))
             ))
 
 
@@ -58,24 +58,24 @@ def login_oauth_2(conn, platform, func):
 
 
         if platform == 'discord':
         if platform == 'discord':
             return redirect(api_url['redirect'] + '?client_id={}&redirect_uri={}&response_type=code&scope=identify'.format(
             return redirect(api_url['redirect'] + '?client_id={}&redirect_uri={}&response_type=code&scope=identify'.format(
-                data['client_id'], 
+                data['client_id'],
                 data['redirect_uri']
                 data['redirect_uri']
             ))
             ))
         elif platform == 'naver':
         elif platform == 'naver':
             return redirect(api_url['redirect'] + '?response_type=code&client_id={}&redirect_uri={}&state={}'.format(
             return redirect(api_url['redirect'] + '?response_type=code&client_id={}&redirect_uri={}&state={}'.format(
-                data['client_id'], 
-                data['redirect_uri'], 
+                data['client_id'],
+                data['redirect_uri'],
                 data['state']
                 data['state']
             ))
             ))
         elif platform == 'facebook':
         elif platform == 'facebook':
             return redirect(api_url['redirect'] + '?client_id={}&redirect_uri={}&state={}'.format(
             return redirect(api_url['redirect'] + '?client_id={}&redirect_uri={}&state={}'.format(
-                data['client_id'], 
-                data['redirect_uri'], 
+                data['client_id'],
+                data['redirect_uri'],
                 data['state']
                 data['state']
             ))
             ))
         elif platform == 'kakao':
         elif platform == 'kakao':
             return redirect(api_url['redirect'] + '?client_id={}&redirect_uri={}&response_type=code'.format(
             return redirect(api_url['redirect'] + '?client_id={}&redirect_uri={}&response_type=code'.format(
-                data['client_id'], 
+                data['client_id'],
                 data['redirect_uri']
                 data['redirect_uri']
             ))
             ))
 
 
@@ -122,15 +122,15 @@ def login_oauth_2(conn, platform, func):
             profile_result =  urllib.request.urlopen(profile_exchange).read().decode('utf-8')
             profile_result =  urllib.request.urlopen(profile_exchange).read().decode('utf-8')
             profile_result_json = json.loads(profile_result)
             profile_result_json = json.loads(profile_result)
             stand_json = {
             stand_json = {
-                'id'        : profile_result_json['id'], 
+                'id'        : profile_result_json['id'],
                 'name'      : profile_result_json['username'] + '#' + profile_result_json['discriminator'],
                 'name'      : profile_result_json['username'] + '#' + profile_result_json['discriminator'],
                 'picture'   : profile_result_json['avatar']
                 'picture'   : profile_result_json['avatar']
             }
             }
         elif platform == 'naver':
         elif platform == 'naver':
             token_access = api_url['token'] + '?grant_type=authorization_code&client_id={}&client_secret={}&code={}&state={}'.format(
             token_access = api_url['token'] + '?grant_type=authorization_code&client_id={}&client_secret={}&code={}&state={}'.format(
-                data['client_id'], 
-                data['client_secret'], 
-                code, 
+                data['client_id'],
+                data['client_secret'],
+                code,
                 state
                 state
             )
             )
             token_result = urllib.request.urlopen(token_access).read().decode('utf-8')
             token_result = urllib.request.urlopen(token_access).read().decode('utf-8')
@@ -151,9 +151,9 @@ def login_oauth_2(conn, platform, func):
             }
             }
         elif platform == 'facebook':
         elif platform == 'facebook':
             token_access = api_url['token'] + '?client_id={}&redirect_uri={}&client_secret={}&code={}'.format(
             token_access = api_url['token'] + '?client_id={}&redirect_uri={}&client_secret={}&code={}'.format(
-                data['client_id'], 
-                data['redirect_uri'], 
-                data['client_secret'], 
+                data['client_id'],
+                data['redirect_uri'],
+                data['client_secret'],
                 code
                 code
             )
             )
             token_result = urllib.request.urlopen(token_access).read().decode('utf-8')
             token_result = urllib.request.urlopen(token_access).read().decode('utf-8')
@@ -164,8 +164,8 @@ def login_oauth_2(conn, platform, func):
             profile_result_json = json.loads(profile_result)
             profile_result_json = json.loads(profile_result)
 
 
             stand_json = {
             stand_json = {
-                'id': profile_result_json['id'], 
-                'name': profile_result_json['name'], 
+                'id': profile_result_json['id'],
+                'name': profile_result_json['name'],
                 'picture': profile_result_json['picture']['data']['url']
                 'picture': profile_result_json['picture']['data']['url']
             }
             }
         elif platform == 'kakao':
         elif platform == 'kakao':
@@ -199,26 +199,26 @@ def login_oauth_2(conn, platform, func):
             profile_result =  urllib.request.urlopen(profile_exchange).read().decode('utf-8')
             profile_result =  urllib.request.urlopen(profile_exchange).read().decode('utf-8')
             profile_result_json = json.loads(profile_result)
             profile_result_json = json.loads(profile_result)
             stand_json = {
             stand_json = {
-                'id'        : profile_result_json['id'], 
+                'id'        : profile_result_json['id'],
                 'name'      : profile_result_json['properties']['nickname'],
                 'name'      : profile_result_json['properties']['nickname'],
                 'picture'   : profile_result_json['properties']['profile_image']
                 'picture'   : profile_result_json['properties']['profile_image']
             }
             }
-        
+
         if flask.session['referrer'][0:6] == 'change':
         if flask.session['referrer'][0:6] == 'change':
             curs.execute(db_change('select * from oauth_conn where wiki_id = ? and provider = ?'), [flask.session['id'], platform])
             curs.execute(db_change('select * from oauth_conn where wiki_id = ? and provider = ?'), [flask.session['id'], platform])
             oauth_result = curs.fetchall()
             oauth_result = curs.fetchall()
             if len(oauth_result) == 0:
             if len(oauth_result) == 0:
                 curs.execute(db_change('insert into oauth_conn (provider, wiki_id, sns_id, name, picture) values(?, ?, ?, ?, ?)'), [
                 curs.execute(db_change('insert into oauth_conn (provider, wiki_id, sns_id, name, picture) values(?, ?, ?, ?, ?)'), [
-                    platform, 
-                    flask.session['id'], 
-                    stand_json['id'], 
-                    stand_json['name'], 
+                    platform,
+                    flask.session['id'],
+                    stand_json['id'],
+                    stand_json['name'],
                     stand_json['picture']
                     stand_json['picture']
                 ])
                 ])
             else:
             else:
                 curs.execute(db_change('update oauth_conn set name = ? picture = ? where wiki_id = ?'), [
                 curs.execute(db_change('update oauth_conn set name = ? picture = ? where wiki_id = ?'), [
-                    stand_json['name'], 
-                    stand_json['picture'], 
+                    stand_json['name'],
+                    stand_json['picture'],
                     flask.session['id']
                     flask.session['id']
                 ])
                 ])
 
 
@@ -231,5 +231,5 @@ def login_oauth_2(conn, platform, func):
             else:
             else:
                 flask.session['state'] = 1
                 flask.session['state'] = 1
                 flask.session['id'] = curs_result[0][2]
                 flask.session['id'] = curs_result[0][2]
-        
+
         return redirect(flask.session['refer'])
         return redirect(flask.session['refer'])

+ 5 - 5
route/login_pw_change.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def login_pw_change_2(conn):
 def login_pw_change_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     if ban_check() == 1:
     if ban_check() == 1:
         return re_error('/ban')
         return re_error('/ban')
 
 
@@ -19,9 +19,9 @@ def login_pw_change_2(conn):
             user = curs.fetchall()
             user = curs.fetchall()
             if not user:
             if not user:
                 return re_error('/error/2')
                 return re_error('/error/2')
-               
+
             pw_check_d = pw_check(
             pw_check_d = pw_check(
-                flask.request.form.get('pw4', ''), 
+                flask.request.form.get('pw4', ''),
                 user[0][0],
                 user[0][0],
                 user[0][1],
                 user[0][1],
                 ip
                 ip
@@ -30,12 +30,12 @@ def login_pw_change_2(conn):
                 return re_error('/error/10')
                 return re_error('/error/10')
 
 
             hashed = pw_encode(flask.request.form.get('pw2', None))
             hashed = pw_encode(flask.request.form.get('pw2', None))
-                
+
             curs.execute(db_change("update user set pw = ? where id = ?"), [hashed, ip])
             curs.execute(db_change("update user set pw = ? where id = ?"), [hashed, ip])
 
 
             return redirect('/user')
             return redirect('/user')
     else:
     else:
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('password_change'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('password_change'), wiki_set(), custom(), other2([0, 0])],
             data = '''
             data = '''
                 <form method="post">
                 <form method="post">

+ 11 - 11
route/login_register.py

@@ -15,8 +15,8 @@ def login_register_2(conn):
         set_d = curs.fetchall()
         set_d = curs.fetchall()
         if set_d and set_d[0][0] == 'on':
         if set_d and set_d[0][0] == 'on':
             return re_error('/ban')
             return re_error('/ban')
-    
-    if flask.request.method == 'POST': 
+
+    if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')
             return re_error('/error/13')
         else:
         else:
@@ -30,7 +30,7 @@ def login_register_2(conn):
 
 
         if re.search('(?:[^A-Za-zㄱ-힣0-9 ])', flask.request.form.get('id', None)):
         if re.search('(?:[^A-Za-zㄱ-힣0-9 ])', flask.request.form.get('id', None)):
             return re_error('/error/8')
             return re_error('/error/8')
-            
+
         curs.execute(db_change('select html from html_filter where kind = "name"'))
         curs.execute(db_change('select html from html_filter where kind = "name"'))
         set_d = curs.fetchall()
         set_d = curs.fetchall()
         for i in set_d:
         for i in set_d:
@@ -46,7 +46,7 @@ def login_register_2(conn):
             return re_error('/error/6')
             return re_error('/error/6')
 
 
         hashed = pw_encode(flask.request.form.get('pw', None))
         hashed = pw_encode(flask.request.form.get('pw', None))
-        
+
         curs.execute(db_change('select data from other where name = "email_have"'))
         curs.execute(db_change('select data from other where name = "email_have"'))
         sql_data = curs.fetchall()
         sql_data = curs.fetchall()
         if sql_data and sql_data[0][0] != '':
         if sql_data and sql_data[0][0] != '':
@@ -72,29 +72,29 @@ def login_register_2(conn):
             ip = ip_check()
             ip = ip_check()
             agent = flask.request.headers.get('User-Agent')
             agent = flask.request.headers.get('User-Agent')
 
 
-            curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [flask.request.form.get('id', None), ip, agent, get_time()])  
+            curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [flask.request.form.get('id', None), ip, agent, get_time()])
 
 
             flask.session['state'] = 1
             flask.session['state'] = 1
             flask.session['id'] = flask.request.form.get('id', None)
             flask.session['id'] = flask.request.form.get('id', None)
             flask.session['head'] = ''
             flask.session['head'] = ''
-                  
+
             conn.commit()
             conn.commit()
-            
+
             if first == 0:
             if first == 0:
                 return redirect('/change')
                 return redirect('/change')
             else:
             else:
                 return redirect('/setting')
                 return redirect('/setting')
-    else:        
+    else:
         contract = ''
         contract = ''
-        
+
         curs.execute(db_change('select data from other where name = "contract"'))
         curs.execute(db_change('select data from other where name = "contract"'))
         data = curs.fetchall()
         data = curs.fetchall()
         if data and data[0][0] != '':
         if data and data[0][0] != '':
             contract = data[0][0] + '<hr class=\"main_hr\">'
             contract = data[0][0] + '<hr class=\"main_hr\">'
-        
+
         http_warring = '<hr class=\"main_hr\"><span>' + load_lang('http_warring') + '</span>'
         http_warring = '<hr class=\"main_hr\"><span>' + load_lang('http_warring') + '</span>'
 
 
-        return easy_minify(flask.render_template(skin_check(),    
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('register'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('register'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 1 - 1
route/main_file.py

@@ -5,7 +5,7 @@ def main_file_2(conn, data):
     curs = conn.cursor()
     curs = conn.cursor()
 
 
     if data == 'easter_egg.html':
     if data == 'easter_egg.html':
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = ['easter_egg.html', wiki_set(), custom(), other2([0, 0])],
             imp = ['easter_egg.html', wiki_set(), custom(), other2([0, 0])],
             data = open('./views/main_css/file/easter_egg.html', 'r').read(),
             data = open('./views/main_css/file/easter_egg.html', 'r').read(),
             menu = 0
             menu = 0

+ 1 - 1
route/main_image_view.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def main_image_view_2(conn, name, app_var):
 def main_image_view_2(conn, name, app_var):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     if os.path.exists(os.path.join(app_var['path_data_image'], name)):
     if os.path.exists(os.path.join(app_var['path_data_image'], name)):
         return flask.send_from_directory('./' + app_var['path_data_image'], name)
         return flask.send_from_directory('./' + app_var['path_data_image'], name)
     else:
     else:

+ 16 - 16
route/main_manager.py

@@ -2,26 +2,26 @@ from .tool.func import *
 
 
 def main_manager_2(conn, num, r_ver):
 def main_manager_2(conn, num, r_ver):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     title_list = {
     title_list = {
-        0 : [load_lang('document_name'), 'acl'], 
-        1 : [0, 'check'], 
+        0 : [load_lang('document_name'), 'acl'],
+        1 : [0, 'check'],
         2 : [load_lang('file_name'), 'plus_file_filter'],
         2 : [load_lang('file_name'), 'plus_file_filter'],
-        3 : [0, 'admin'], 
-        4 : [0, 'record'], 
-        5 : [0, 'topic_record'], 
-        6 : [load_lang('name'), 'admin_plus'], 
-        7 : [load_lang('name'), 'plus_edit_filter'], 
-        8 : [load_lang('document_name'), 'search'], 
-        9 : [0, 'block_user'], 
-        10 : [0, 'block_admin'], 
-        11 : [load_lang('document_name'), 'watch_list'], 
-        12 : [load_lang('compare_target'), 'check'], 
+        3 : [0, 'admin'],
+        4 : [0, 'record'],
+        5 : [0, 'topic_record'],
+        6 : [load_lang('name'), 'admin_plus'],
+        7 : [load_lang('name'), 'plus_edit_filter'],
+        8 : [load_lang('document_name'), 'search'],
+        9 : [0, 'block_user'],
+        10 : [0, 'block_admin'],
+        11 : [load_lang('document_name'), 'watch_list'],
+        12 : [load_lang('compare_target'), 'check'],
         13 : [load_lang('document_name'), 'edit']
         13 : [load_lang('document_name'), 'edit']
     }
     }
-    
+
     if num == 1:
     if num == 1:
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('admin_tool'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('admin_tool'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
             data =  '''
                     <h2>''' + load_lang('admin') + '''</h2>
                     <h2>''' + load_lang('admin') + '''</h2>
@@ -79,7 +79,7 @@ def main_manager_2(conn, num, r_ver):
             else:
             else:
                 placeholder = title_list[(num - 2)][0]
                 placeholder = title_list[(num - 2)][0]
 
 
-            return easy_minify(flask.render_template(skin_check(), 
+            return easy_minify(flask.render_template(skin_check(),
                 imp = ['Redirect', wiki_set(), custom(), other2([0, 0])],
                 imp = ['Redirect', wiki_set(), custom(), other2([0, 0])],
                 data =  '''
                 data =  '''
                         <form method="post">
                         <form method="post">

+ 2 - 2
route/main_other.py

@@ -2,8 +2,8 @@ from .tool.func import *
 
 
 def main_other_2(conn):
 def main_other_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
-    
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('other_tool'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('other_tool'), wiki_set(), custom(), other2([0, 0])],
         data = '''
         data = '''
             <h2>''' + load_lang('record') + '''</h2>
             <h2>''' + load_lang('record') + '''</h2>

+ 1 - 1
route/main_skin_set.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def main_skin_set_2(conn):
 def main_skin_set_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     data = flask.make_response(re_error('/error/5'))
     data = flask.make_response(re_error('/error/5'))
 
 
     curs.execute(db_change("select data from other where name = 'language'"))
     curs.execute(db_change("select data from other where name = 'language'"))

+ 1 - 1
route/main_views.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def main_views_2(conn, name):
 def main_views_2(conn, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     if re.search('\/', name):
     if re.search('\/', name):
         m = re.search('^(.*)\/(.*)$', name)
         m = re.search('^(.*)\/(.*)$', name)
         if m:
         if m:

+ 30 - 29
route/recent_changes.py

@@ -9,7 +9,7 @@ def recent_changes_2(conn, name, tool):
             '?first=' + flask.request.form.get('b', '1') +
             '?first=' + flask.request.form.get('b', '1') +
             '&second=' + flask.request.form.get('a', '1')
             '&second=' + flask.request.form.get('a', '1')
         )
         )
-    else:        
+    else:
         ban = ''
         ban = ''
         select = ''
         select = ''
         sub = ''
         sub = ''
@@ -19,12 +19,12 @@ def recent_changes_2(conn, name, tool):
                 <tbody>
                 <tbody>
                     <tr>
                     <tr>
         '''
         '''
-        
+
         num = int(number_check(flask.request.args.get('num', '1')))
         num = int(number_check(flask.request.args.get('num', '1')))
         if num * 50 > 0:
         if num * 50 > 0:
             sql_num = num * 50 - 50
             sql_num = num * 50 - 50
         else:
         else:
-            sql_num = 0   
+            sql_num = 0
 
 
         if name:
         if name:
             if tool == 'history':
             if tool == 'history':
@@ -35,19 +35,19 @@ def recent_changes_2(conn, name, tool):
                     <td id="main_table_width">''' + load_lang('editor') + '''</td>
                     <td id="main_table_width">''' + load_lang('editor') + '''</td>
                     <td id="main_table_width">''' + load_lang('time') + '''</td>
                     <td id="main_table_width">''' + load_lang('time') + '''</td>
                 '''
                 '''
-                
+
                 tool_select = flask.request.args.get('tool', 'normal')
                 tool_select = flask.request.args.get('tool', 'normal')
                 if tool_select == 'move':
                 if tool_select == 'move':
                     plus_sql = 'where (send like ? or send like ?) and type = "" '
                     plus_sql = 'where (send like ? or send like ?) and type = "" '
-                    plus_list = ['%(<a>' + name +'</a>%', '%<a>' + name + '</a> move)', sql_num]    
+                    plus_list = ['%(<a>' + name +'</a>%', '%<a>' + name + '</a> move)', sql_num]
                     sub += ' (' + load_lang('move') + ')'
                     sub += ' (' + load_lang('move') + ')'
                 elif tool_select == 'delete':
                 elif tool_select == 'delete':
                     plus_sql = 'where (send like "%(delete)") and title = ? and type = "" '
                     plus_sql = 'where (send like "%(delete)") and title = ? and type = "" '
-                    plus_list = [name, sql_num]    
-                    sub += ' (' + load_lang('revert') + ')'
+                    plus_list = [name, sql_num]
+                    sub += ' (' + load_lang('delete') + ')'
                 elif tool_select == 'revert':
                 elif tool_select == 'revert':
                     plus_sql = 'where (send like ?) and title = ? and type = "" '
                     plus_sql = 'where (send like ?) and title = ? and type = "" '
-                    plus_list = ['%(r%)', name, sql_num]    
+                    plus_list = ['%(r%)', name, sql_num]
                     sub += ' (' + load_lang('revert') + ')'
                     sub += ' (' + load_lang('revert') + ')'
                 else:
                 else:
                     plus_sql = 'where title = ? and type = "" '
                     plus_sql = 'where title = ? and type = "" '
@@ -67,7 +67,7 @@ def recent_changes_2(conn, name, tool):
                 '''
                 '''
 
 
                 div = '<a href="/topic_record/' + url_pas(name) + '">(' + load_lang('discussion') + ')</a><hr class=\"main_hr\">' + div
                 div = '<a href="/topic_record/' + url_pas(name) + '">(' + load_lang('discussion') + ')</a><hr class=\"main_hr\">' + div
-                
+
                 curs.execute(db_change('' + \
                 curs.execute(db_change('' + \
                     'select id, title, date, ip, send, leng from history ' + \
                     'select id, title, date, ip, send, leng from history ' + \
                     "where ip = ? and type = '' order by date desc limit ?, 50" + \
                     "where ip = ? and type = '' order by date desc limit ?, 50" + \
@@ -104,27 +104,27 @@ def recent_changes_2(conn, name, tool):
         div += '</tr>'
         div += '</tr>'
 
 
         data_list = curs.fetchall()
         data_list = curs.fetchall()
-        for data in data_list:    
-            select += '<option value="' + data[0] + '">' + data[0] + '</option>'     
+        for data in data_list:
+            select += '<option value="' + data[0] + '">' + data[0] + '</option>'
             send = '<br>'
             send = '<br>'
-            
+
             if data[4]:
             if data[4]:
                 if not re.search("^(?: *)$", data[4]):
                 if not re.search("^(?: *)$", data[4]):
                     send = data[4]
                     send = data[4]
-            
+
             if re.search("\+", data[5]):
             if re.search("\+", data[5]):
                 leng = '<span style="color:green;">(' + data[5] + ')</span>'
                 leng = '<span style="color:green;">(' + data[5] + ')</span>'
             elif re.search("\-", data[5]):
             elif re.search("\-", data[5]):
                 leng = '<span style="color:red;">(' + data[5] + ')</span>'
                 leng = '<span style="color:red;">(' + data[5] + ')</span>'
             else:
             else:
                 leng = '<span style="color:gray;">(' + data[5] + ')</span>'
                 leng = '<span style="color:gray;">(' + data[5] + ')</span>'
-                
+
             ip = ip_pas(data[3])
             ip = ip_pas(data[3])
             if tool == 'history':
             if tool == 'history':
                 m_tool = '<a href="/history_tool/' + url_pas(data[1]) + '?num=' + data[0] + '&type=history">(' + load_lang('tool') + ')</a>'
                 m_tool = '<a href="/history_tool/' + url_pas(data[1]) + '?num=' + data[0] + '&type=history">(' + load_lang('tool') + ')</a>'
             else:
             else:
                 m_tool = '<a href="/history_tool/' + url_pas(data[1]) + '?num=' + data[0] + '">(' + load_lang('tool') + ')</a>'
                 m_tool = '<a href="/history_tool/' + url_pas(data[1]) + '?num=' + data[0] + '">(' + load_lang('tool') + ')</a>'
-            
+
             style = ['', '']
             style = ['', '']
             date = data[2]
             date = data[2]
 
 
@@ -133,12 +133,12 @@ def recent_changes_2(conn, name, tool):
                 where title = ? and id = ? and hide = 'O'
                 where title = ? and id = ? and hide = 'O'
             '''), [data[1], data[0]])
             '''), [data[1], data[0]])
             hide = curs.fetchall()
             hide = curs.fetchall()
-            
+
             if admin_check(6) == 1:
             if admin_check(6) == 1:
-                if hide:                    
+                if hide:
                     style[0] = 'id="toron_color_grey"'
                     style[0] = 'id="toron_color_grey"'
                     style[1] = 'id="toron_color_grey"'
                     style[1] = 'id="toron_color_grey"'
-                    
+
                     send += ' (' + load_lang('hide') + ')'
                     send += ' (' + load_lang('hide') + ')'
             elif not hide:
             elif not hide:
                 pass
                 pass
@@ -179,7 +179,7 @@ def recent_changes_2(conn, name, tool):
 
 
         if name:
         if name:
             if tool == 'history':
             if tool == 'history':
-                if not tool_select:
+                if tool_select == 'normal':
                     div = '' + \
                     div = '' + \
                         '<a href="?tool=move">(' + load_lang('move') + ')</a> ' + \
                         '<a href="?tool=move">(' + load_lang('move') + ')</a> ' + \
                         '<a href="?tool=delete">(' + load_lang('delete') + ')</a> ' + \
                         '<a href="?tool=delete">(' + load_lang('delete') + ')</a> ' + \
@@ -187,17 +187,18 @@ def recent_changes_2(conn, name, tool):
                         '<hr class="main_hr">' + div + \
                         '<hr class="main_hr">' + div + \
                     ''
                     ''
 
 
+                    div = '''
+                        <form method="post">
+                            <select name="a">''' + select + '''</select> <select name="b">''' + select + '''</select>
+                            <button type="submit">''' + load_lang('compare') + '''</button>
+                        </form>
+                        <hr class=\"main_hr\">
+                    ''' + div
+
                     menu = [['w/' + url_pas(name), load_lang('document')], ['raw/' + url_pas(name), load_lang('raw')]]
                     menu = [['w/' + url_pas(name), load_lang('document')], ['raw/' + url_pas(name), load_lang('raw')]]
                 else:
                 else:
                     menu = [['history/' + url_pas(name), load_lang('return')]]
                     menu = [['history/' + url_pas(name), load_lang('return')]]
 
 
-                div = '''
-                    <form method="post">
-                        <select name="a">''' + select + '''</select> <select name="b">''' + select + '''</select>
-                        <button type="submit">''' + load_lang('compare') + '''</button>
-                    </form>
-                    <hr class=\"main_hr\">
-                ''' + div
                 title = name
                 title = name
                 div += next_fix('/history/' + url_pas(name) + '?tool=' + tool_select + '&num=', num, data_list)
                 div += next_fix('/history/' + url_pas(name) + '?tool=' + tool_select + '&num=', num, data_list)
             else:
             else:
@@ -215,11 +216,11 @@ def recent_changes_2(conn, name, tool):
             elif set_type == 'req':
             elif set_type == 'req':
                 sub = ' (' + load_lang('edit_req') + ')'
                 sub = ' (' + load_lang('edit_req') + ')'
                 menu = [['recent_changes', load_lang('return')]]
                 menu = [['recent_changes', load_lang('return')]]
-        
+
         if sub == '':
         if sub == '':
             sub = 0
             sub = 0
-                
-        return easy_minify(flask.render_template(skin_check(), 
+
+        return easy_minify(flask.render_template(skin_check(),
             imp = [title, wiki_set(), custom(), other2([sub, 0])],
             imp = [title, wiki_set(), custom(), other2([sub, 0])],
             data = div,
             data = div,
             menu = menu
             menu = menu

+ 8 - 8
route/recent_discuss.py

@@ -4,14 +4,14 @@ def recent_discuss_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
 
 
     div = ''
     div = ''
-    
+
     if flask.request.args.get('what', 'normal') == 'normal':
     if flask.request.args.get('what', 'normal') == 'normal':
         div += '<a href="/recent_discuss?what=close">(' + load_lang('close_discussion') + ')</a>'
         div += '<a href="/recent_discuss?what=close">(' + load_lang('close_discussion') + ')</a>'
-       
+
         m_sub = 0
         m_sub = 0
     else:
     else:
         div += '<a href="/recent_discuss">(' + load_lang('open_discussion') + ')</a>'
         div += '<a href="/recent_discuss">(' + load_lang('open_discussion') + ')</a>'
-        
+
         m_sub = ' (' + load_lang('closed') + ')'
         m_sub = ' (' + load_lang('closed') + ')'
 
 
     div +=  '''
     div +=  '''
@@ -23,12 +23,12 @@ def recent_discuss_2(conn):
                         <td id="main_table_width_half">''' + load_lang('time') + '''</td>
                         <td id="main_table_width_half">''' + load_lang('time') + '''</td>
                     </tr>
                     </tr>
             '''
             '''
-    
+
     if m_sub == 0:
     if m_sub == 0:
         curs.execute(db_change("select title, sub, date from rd where not stop = 'O' order by date desc limit 50"))
         curs.execute(db_change("select title, sub, date from rd where not stop = 'O' order by date desc limit 50"))
     else:
     else:
         curs.execute(db_change("select title, sub, date from rd where stop = 'O' order by date desc limit 50"))
         curs.execute(db_change("select title, sub, date from rd where stop = 'O' order by date desc limit 50"))
-        
+
     for data in curs.fetchall():
     for data in curs.fetchall():
         curs.execute(db_change("select code from topic where id = '1' and title = ? and sub = ?"), [data[0], data[1]])
         curs.execute(db_change("select code from topic where id = '1' and title = ? and sub = ?"), [data[0], data[1]])
         get_code = curs.fetchall()
         get_code = curs.fetchall()
@@ -41,10 +41,10 @@ def recent_discuss_2(conn):
         sub = html.escape(data[1])
         sub = html.escape(data[1])
 
 
         div += '<tr><td><a href="/thread/' + get_code + '">' + title + '</a> (' + sub + ')</td><td>' + data[2] + '</td></tr>'
         div += '<tr><td><a href="/thread/' + get_code + '">' + title + '</a> (' + sub + ')</td><td>' + data[2] + '</td></tr>'
-    
+
     div += '</tbody></table>'
     div += '</tbody></table>'
-            
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('recent_discussion'), wiki_set(), custom(), other2([m_sub, 0])],
         imp = [load_lang('recent_discussion'), wiki_set(), custom(), other2([m_sub, 0])],
         data = div,
         data = div,
         menu = 0
         menu = 0

+ 1 - 1
route/recent_history_delete.py

@@ -16,7 +16,7 @@ def recent_history_delete_2(conn, name):
 
 
         return redirect('/history/' + url_pas(name))
         return redirect('/history/' + url_pas(name))
     else:
     else:
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2(['(r' + num + ')', 0])],
             imp = [name, wiki_set(), custom(), other2(['(r' + num + ')', 0])],
             data = '''
             data = '''
                 <form method="post">
                 <form method="post">

+ 3 - 3
route/recent_history_tool.py

@@ -9,7 +9,7 @@ def recent_history_tool_2(conn, name):
         <h2>''' + load_lang('tool') + '''</h2>
         <h2>''' + load_lang('tool') + '''</h2>
         <ul>
         <ul>
             <li>
             <li>
-                <a href="/raw/''' + url_pas(name) + '?num=' + num + '">' + load_lang('raw') + '''</a> 
+                <a href="/raw/''' + url_pas(name) + '?num=' + num + '">' + load_lang('raw') + '''</a>
             </li>
             </li>
     '''
     '''
 
 
@@ -55,8 +55,8 @@ def recent_history_tool_2(conn, name):
     data += '''
     data += '''
         </ul>
         </ul>
     '''
     '''
-                
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), custom(), other2(['(r' + num + ')', 0])],
         imp = [name, wiki_set(), custom(), other2(['(r' + num + ')', 0])],
         data = data,
         data = data,
         menu = [['history/' + url_pas(name), load_lang('return')]]
         menu = [['history/' + url_pas(name), load_lang('return')]]

+ 8 - 8
route/search_deep.py

@@ -13,16 +13,16 @@ def search_deep_2(conn, name):
         sql_num = 0
         sql_num = 0
 
 
     div = '<ul>'
     div = '<ul>'
-    
+
     div_plus = ''
     div_plus = ''
     test = ''
     test = ''
-    
+
     curs.execute(db_change("select title from data where title = ?"), [name])
     curs.execute(db_change("select title from data where title = ?"), [name])
     if curs.fetchall():
     if curs.fetchall():
         link_id = ''
         link_id = ''
     else:
     else:
         link_id = 'id="not_thing"'
         link_id = 'id="not_thing"'
-    
+
     div =   '''
     div =   '''
             <ul>
             <ul>
                 <li>
                 <li>
@@ -44,26 +44,26 @@ def search_deep_2(conn, name):
         all_list = curs.fetchall()
         all_list = curs.fetchall()
         if all_list:
         if all_list:
             test = all_list[0][1]
             test = all_list[0][1]
-            
+
             for data in all_list:
             for data in all_list:
                 if data[1] != test:
                 if data[1] != test:
                     div_plus += '</ul><hr class=\"main_hr\"><ul>'
                     div_plus += '</ul><hr class=\"main_hr\"><ul>'
-                    
+
                     test = data[1]
                     test = data[1]
 
 
                 div_plus += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a> (' + data[1] + ')</li>'
                 div_plus += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a> (' + data[1] + ')</li>'
     else:
     else:
-        curs.execute(db_change("select title from data where title like ? order by title limit ?, 50"), 
+        curs.execute(db_change("select title from data where title like ? order by title limit ?, 50"),
             ['%' + name + '%', sql_num]
             ['%' + name + '%', sql_num]
         )
         )
-        all_list = curs.fetchall()    
+        all_list = curs.fetchall()
         for data in all_list:
         for data in all_list:
             div_plus += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a> (title)</li>'
             div_plus += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a> (title)</li>'
 
 
     div += div_plus + '</ul>'
     div += div_plus + '</ul>'
     div += next_fix('/search/' + url_pas(name) + '?num=', num, all_list)
     div += next_fix('/search/' + url_pas(name) + '?num=', num, all_list)
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('search') + ')', 0])],
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('search') + ')', 0])],
         data = div,
         data = div,
         menu = 0
         menu = 0

+ 2 - 2
route/server_now_update.py

@@ -43,13 +43,13 @@ def server_now_update_2(conn, r_ver):
             else:
             else:
                 print('Update error')
                 print('Update error')
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('update'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('update'), wiki_set(), custom(), other2([0, 0])],
             data = load_lang("update_error") + ' <a href="https://github.com/2DU/opennamu">(Github)</a>',
             data = load_lang("update_error") + ' <a href="https://github.com/2DU/opennamu">(Github)</a>',
             menu = [['manager/1', load_lang('return')]]
             menu = [['manager/1', load_lang('return')]]
         ))
         ))
     else:
     else:
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('update'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('update'), wiki_set(), custom(), other2([0, 0])],
             data = load_lang('update_warring') + '''
             data = load_lang('update_warring') + '''
                 <hr class=\"main_hr\">
                 <hr class=\"main_hr\">

+ 1 - 1
route/server_restart.py

@@ -14,7 +14,7 @@ def server_restart_2(conn):
 
 
         os.execl(sys.executable, sys.executable, *sys.argv)
         os.execl(sys.executable, sys.executable, *sys.argv)
     else:
     else:
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('wiki_restart'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('wiki_restart'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
             data =  '''
                     <form method="post">
                     <form method="post">

+ 70 - 70
route/setting.py

@@ -17,61 +17,61 @@ def setting_2(conn, num):
             load_lang('main_bottom_body'),
             load_lang('main_bottom_body'),
             load_lang('main_acl_setting')
             load_lang('main_acl_setting')
         ]
         ]
-        
+
         x = 0
         x = 0
         li_data = ''
         li_data = ''
-        
+
         for li in li_list:
         for li in li_list:
             x += 1
             x += 1
             li_data += '<li><a href="/setting/' + str(x) + '">' + li + '</a></li>'
             li_data += '<li><a href="/setting/' + str(x) + '">' + li + '</a></li>'
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('setting'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('setting'), wiki_set(), custom(), other2([0, 0])],
             data = '<h2>' + load_lang('list') + '</h2><ul>' + li_data + '</ul>',
             data = '<h2>' + load_lang('list') + '</h2><ul>' + li_data + '</ul>',
             menu = [['manager', load_lang('return')]]
             menu = [['manager', load_lang('return')]]
         ))
         ))
     elif num == 1:
     elif num == 1:
         i_list = {
         i_list = {
-            0 : 'name', 
-            1 : 'logo', 
-            2 : 'frontpage', 
-            3 : 'license', 
-            4 : 'upload', 
-            5 : 'skin', 
-            7 : 'reg', 
-            8 : 'ip_view', 
-            9 : 'back_up', 
-            10 : 'port', 
-            11 : 'key', 
-            12 : 'update', 
-            13 : 'email_have', 
-            15 : 'encode', 
+            0 : 'name',
+            1 : 'logo',
+            2 : 'frontpage',
+            3 : 'license',
+            4 : 'upload',
+            5 : 'skin',
+            7 : 'reg',
+            8 : 'ip_view',
+            9 : 'back_up',
+            10 : 'port',
+            11 : 'key',
+            12 : 'update',
+            13 : 'email_have',
+            15 : 'encode',
             16 : 'host',
             16 : 'host',
             19 : 'slow_edit'
             19 : 'slow_edit'
         }
         }
         n_list = {
         n_list = {
-            0 : 'Wiki', 
-            1 : '', 
-            2 : 'FrontPage', 
-            3 : 'CC 0', 
-            4 : '2', 
-            5 : '',  
-            7 : '', 
-            8 : '', 
-            9 : '0', 
-            10 : '3000', 
-            11 : 'test', 
-            12 : 'stable', 
-            13 : '',  
-            15 : 'sha3', 
+            0 : 'Wiki',
+            1 : '',
+            2 : 'FrontPage',
+            3 : 'CC 0',
+            4 : '2',
+            5 : '',
+            7 : '',
+            8 : '',
+            9 : '0',
+            10 : '3000',
+            11 : 'test',
+            12 : 'stable',
+            13 : '',
+            15 : 'sha3',
             16 : '0.0.0.0',
             16 : '0.0.0.0',
             19 : '0'
             19 : '0'
         }
         }
-        
+
         if flask.request.method == 'POST':
         if flask.request.method == 'POST':
             for i in i_list:
             for i in i_list:
                 curs.execute(db_change("update other set data = ? where name = ?"), [
                 curs.execute(db_change("update other set data = ? where name = ?"), [
-                    flask.request.form.get(i_list[i], n_list[i]), 
+                    flask.request.form.get(i_list[i], n_list[i]),
                     i_list[i]
                     i_list[i]
                 ])
                 ])
 
 
@@ -82,7 +82,7 @@ def setting_2(conn, num):
             return redirect('/setting/1')
             return redirect('/setting/1')
         else:
         else:
             d_list = {}
             d_list = {}
-            
+
             for i in i_list:
             for i in i_list:
                 curs.execute(db_change('select data from other where name = ?'), [i_list[i]])
                 curs.execute(db_change('select data from other where name = ?'), [i_list[i]])
                 sql_d = curs.fetchall()
                 sql_d = curs.fetchall()
@@ -90,11 +90,11 @@ def setting_2(conn, num):
                     d_list[i] = sql_d[0][0]
                     d_list[i] = sql_d[0][0]
                 else:
                 else:
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i_list[i], n_list[i]])
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i_list[i], n_list[i]])
-                    
+
                     d_list[i] = n_list[i]
                     d_list[i] = n_list[i]
 
 
             conn.commit()
             conn.commit()
-            
+
             acl_div = ['']
             acl_div = ['']
             encode_data = ['sha256', 'sha3']
             encode_data = ['sha256', 'sha3']
             for acl_data in encode_data:
             for acl_data in encode_data:
@@ -123,7 +123,7 @@ def setting_2(conn, num):
                 branch_div += '<option value="master">master</option>'
                 branch_div += '<option value="master">master</option>'
                 branch_div += '<option value="stable">stable</option>'
                 branch_div += '<option value="stable">stable</option>'
 
 
-            return easy_minify(flask.render_template(skin_check(), 
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('main_setting'), wiki_set(), custom(), other2([0, 0])],
                 imp = [load_lang('main_setting'), wiki_set(), custom(), other2([0, 0])],
                 data = '''
                 data = '''
                     <form method="post">
                     <form method="post">
@@ -192,8 +192,8 @@ def setting_2(conn, num):
             ))
             ))
     elif num == 2:
     elif num == 2:
         i_list = [
         i_list = [
-            'contract', 
-            'no_login_warring', 
+            'contract',
+            'no_login_warring',
             'edit_bottom_text',
             'edit_bottom_text',
             'check_key_text',
             'check_key_text',
             'email_title',
             'email_title',
@@ -208,18 +208,18 @@ def setting_2(conn, num):
         if flask.request.method == 'POST':
         if flask.request.method == 'POST':
             for i in i_list:
             for i in i_list:
                 curs.execute(db_change("update other set data = ? where name = ?"), [
                 curs.execute(db_change("update other set data = ? where name = ?"), [
-                    flask.request.form.get(i, ''), 
+                    flask.request.form.get(i, ''),
                     i
                     i
                 ])
                 ])
 
 
             conn.commit()
             conn.commit()
-            
+
             admin_check(None, 'edit_set')
             admin_check(None, 'edit_set')
 
 
             return redirect('/setting/2')
             return redirect('/setting/2')
         else:
         else:
             d_list = []
             d_list = []
-            
+
             for i in i_list:
             for i in i_list:
                 curs.execute(db_change('select data from other where name = ?'), [i])
                 curs.execute(db_change('select data from other where name = ?'), [i])
                 sql_d = curs.fetchall()
                 sql_d = curs.fetchall()
@@ -227,12 +227,12 @@ def setting_2(conn, num):
                     d_list += [sql_d[0][0]]
                     d_list += [sql_d[0][0]]
                 else:
                 else:
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i, ''])
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i, ''])
-                    
+
                     d_list += ['']
                     d_list += ['']
 
 
             conn.commit()
             conn.commit()
 
 
-            return easy_minify(flask.render_template(skin_check(), 
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('text_setting'), wiki_set(), custom(), other2([0, 0])],
                 imp = [load_lang('text_setting'), wiki_set(), custom(), other2([0, 0])],
                 data = '''
                 data = '''
                     <form method="post">
                     <form method="post">
@@ -306,7 +306,7 @@ def setting_2(conn, num):
                     coverage = ''
                     coverage = ''
                 else:
                 else:
                     coverage = flask.request.args.get('skin', '')
                     coverage = flask.request.args.get('skin', '')
-                
+
             curs.execute(db_change("select name from other where name = ? and coverage = ?"), [info_d, coverage])
             curs.execute(db_change("select name from other where name = ? and coverage = ?"), [info_d, coverage])
             if curs.fetchall():
             if curs.fetchall():
                 curs.execute(db_change("update other set data = ? where name = ? and coverage = ?"), [
                 curs.execute(db_change("update other set data = ? where name = ? and coverage = ?"), [
@@ -316,7 +316,7 @@ def setting_2(conn, num):
                 ])
                 ])
             else:
             else:
                 curs.execute(db_change("insert into other (name, data, coverage) values (?, ?, ?)"), [info_d, flask.request.form.get('content', ''), coverage])
                 curs.execute(db_change("insert into other (name, data, coverage) values (?, ?, ?)"), [info_d, flask.request.form.get('content', ''), coverage])
-            
+
             conn.commit()
             conn.commit()
 
 
             admin_check(None, 'edit_set')
             admin_check(None, 'edit_set')
@@ -352,7 +352,7 @@ def setting_2(conn, num):
                     <hr class=\"main_hr\">
                     <hr class=\"main_hr\">
                 '''
                 '''
                 plus = ''
                 plus = ''
-                
+
             head = curs.fetchall()
             head = curs.fetchall()
             if head:
             if head:
                 data = head[0][0]
                 data = head[0][0]
@@ -364,7 +364,7 @@ def setting_2(conn, num):
             else:
             else:
                 sub_plus = ''
                 sub_plus = ''
 
 
-            return easy_minify(flask.render_template(skin_check(), 
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang(data = 'main' + title, safe = 1), wiki_set(), custom(), other2([' (HTML)' + sub_plus, 0])],
                 imp = [load_lang(data = 'main' + title, safe = 1), wiki_set(), custom(), other2([' (HTML)' + sub_plus, 0])],
                 data = '''
                 data = '''
                     <form method="post">
                     <form method="post">
@@ -384,13 +384,13 @@ def setting_2(conn, num):
                 curs.execute(db_change("update other set data = ? where name = 'robot'"), [flask.request.form.get('content', '')])
                 curs.execute(db_change("update other set data = ? where name = 'robot'"), [flask.request.form.get('content', '')])
             else:
             else:
                 curs.execute(db_change("insert into other (name, data) values ('robot', ?)"), [flask.request.form.get('content', '')])
                 curs.execute(db_change("insert into other (name, data) values ('robot', ?)"), [flask.request.form.get('content', '')])
-            
+
             conn.commit()
             conn.commit()
-            
+
             fw = open('./robots.txt', 'w')
             fw = open('./robots.txt', 'w')
             fw.write(re.sub('\r\n', '\n', flask.request.form.get('content', '')))
             fw.write(re.sub('\r\n', '\n', flask.request.form.get('content', '')))
             fw.close()
             fw.close()
-            
+
             admin_check(None, 'edit_set')
             admin_check(None, 'edit_set')
 
 
             return redirect('/setting/5')
             return redirect('/setting/5')
@@ -423,7 +423,7 @@ def setting_2(conn, num):
             if not data or data == '':
             if not data or data == '':
                 data = ''.join(lines)
                 data = ''.join(lines)
 
 
-            return easy_minify(flask.render_template(skin_check(), 
+            return easy_minify(flask.render_template(skin_check(),
                 imp = ['robots.txt', wiki_set(), custom(), other2([0, 0])],
                 imp = ['robots.txt', wiki_set(), custom(), other2([0, 0])],
                 data = '''
                 data = '''
                     <a href="/robots.txt">(''' + load_lang('view') + ''')</a>
                     <a href="/robots.txt">(''' + load_lang('view') + ''')</a>
@@ -438,9 +438,9 @@ def setting_2(conn, num):
             ))
             ))
     elif num == 6:
     elif num == 6:
         i_list = [
         i_list = [
-            'recaptcha', 
-            'sec_re', 
-            'g_email', 
+            'recaptcha',
+            'sec_re',
+            'g_email',
             'g_pass'
             'g_pass'
         ]
         ]
 
 
@@ -454,15 +454,15 @@ def setting_2(conn, num):
                 curs.execute(db_change("update other set data = ? where name = ?"), [into_data, data])
                 curs.execute(db_change("update other set data = ? where name = ?"), [into_data, data])
 
 
             conn.commit()
             conn.commit()
-            
+
             admin_check(None, 'edit_set')
             admin_check(None, 'edit_set')
 
 
             return redirect('/setting/6')
             return redirect('/setting/6')
         else:
         else:
             d_list = []
             d_list = []
-            
+
             x = 0
             x = 0
-            
+
             for i in i_list:
             for i in i_list:
                 curs.execute(db_change('select data from other where name = ?'), [i])
                 curs.execute(db_change('select data from other where name = ?'), [i])
                 sql_d = curs.fetchall()
                 sql_d = curs.fetchall()
@@ -470,14 +470,14 @@ def setting_2(conn, num):
                     d_list += [sql_d[0][0]]
                     d_list += [sql_d[0][0]]
                 else:
                 else:
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i, ''])
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i, ''])
-                    
+
                     d_list += ['']
                     d_list += ['']
 
 
                 x += 1
                 x += 1
 
 
             conn.commit()
             conn.commit()
 
 
-            return easy_minify(flask.render_template(skin_check(), 
+            return easy_minify(flask.render_template(skin_check(),
                 imp = ['Google', wiki_set(), custom(), other2([0, 0])],
                 imp = ['Google', wiki_set(), custom(), other2([0, 0])],
                 data = '''
                 data = '''
                     <form method="post">
                     <form method="post">
@@ -506,24 +506,24 @@ def setting_2(conn, num):
             ))
             ))
     elif num == 8:
     elif num == 8:
         i_list = {
         i_list = {
-            1 : 'edit', 
-            2 : 'discussion', 
+            1 : 'edit',
+            2 : 'discussion',
             3 : 'upload_acl',
             3 : 'upload_acl',
             4 : 'all_view_acl',
             4 : 'all_view_acl',
             5 : 'edit_req_acl'
             5 : 'edit_req_acl'
         }
         }
         n_list = {
         n_list = {
-            1 : 'normal', 
-            2 : 'normal', 
+            1 : 'normal',
+            2 : 'normal',
             3 : 'normal',
             3 : 'normal',
             4 : 'normal',
             4 : 'normal',
             5 : 'normal'
             5 : 'normal'
         }
         }
-        
+
         if flask.request.method == 'POST':
         if flask.request.method == 'POST':
             for i in i_list:
             for i in i_list:
                 curs.execute(db_change("update other set data = ? where name = ?"), [
                 curs.execute(db_change("update other set data = ? where name = ?"), [
-                    flask.request.form.get(i_list[i], n_list[i]), 
+                    flask.request.form.get(i_list[i], n_list[i]),
                     i_list[i]
                     i_list[i]
                 ])
                 ])
 
 
@@ -534,7 +534,7 @@ def setting_2(conn, num):
             return redirect('/setting/8')
             return redirect('/setting/8')
         else:
         else:
             d_list = {}
             d_list = {}
-            
+
             for i in i_list:
             for i in i_list:
                 curs.execute(db_change('select data from other where name = ?'), [i_list[i]])
                 curs.execute(db_change('select data from other where name = ?'), [i_list[i]])
                 sql_d = curs.fetchall()
                 sql_d = curs.fetchall()
@@ -542,11 +542,11 @@ def setting_2(conn, num):
                     d_list[i] = sql_d[0][0]
                     d_list[i] = sql_d[0][0]
                 else:
                 else:
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i_list[i], n_list[i]])
                     curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i_list[i], n_list[i]])
-                    
+
                     d_list[i] = n_list[i]
                     d_list[i] = n_list[i]
 
 
             conn.commit()
             conn.commit()
-            
+
             acl_div = ['', '', '', '', '']
             acl_div = ['', '', '', '', '']
             acl_list = ['normal', 'user', 'admin', 'owner', '50_edit', 'email']
             acl_list = ['normal', 'user', 'admin', 'owner', '50_edit', 'email']
             for i in range(0, 5):
             for i in range(0, 5):
@@ -556,7 +556,7 @@ def setting_2(conn, num):
                     else:
                     else:
                         acl_div[i] += '<option value="' + acl_data + '">' + acl_data + '</option>'
                         acl_div[i] += '<option value="' + acl_data + '">' + acl_data + '</option>'
 
 
-            return easy_minify(flask.render_template(skin_check(), 
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('main_acl_setting'), wiki_set(), custom(), other2([0, 0])],
                 imp = [load_lang('main_acl_setting'), wiki_set(), custom(), other2([0, 0])],
                 data = '''
                 data = '''
                     <form method="post">
                     <form method="post">

+ 5 - 5
route/setting_adsense.py

@@ -5,7 +5,7 @@ def setting_adsense_2(conn):
 
 
     if admin_check(None, 'adsense setting') != 1:
     if admin_check(None, 'adsense setting') != 1:
         return re_error('/error/3')
         return re_error('/error/3')
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         try:
         try:
             adsense_enabled = flask.request.form.get('adsense_enabled')
             adsense_enabled = flask.request.form.get('adsense_enabled')
@@ -16,15 +16,15 @@ def setting_adsense_2(conn):
                 data = '<h2>ie_no_data_required</h2>' + load_lang('ie_no_data_required'),
                 data = '<h2>ie_no_data_required</h2>' + load_lang('ie_no_data_required'),
                 menu = [['other', load_lang('return')]]
                 menu = [['other', load_lang('return')]]
             ))
             ))
-        
+
         if adsense_enabled == 'on':
         if adsense_enabled == 'on':
             curs.execute(db_change('update other set data = "True" where name = "adsense"'))
             curs.execute(db_change('update other set data = "True" where name = "adsense"'))
         else:
         else:
             curs.execute(db_change('update other set data = "False" where name = "adsense"'))
             curs.execute(db_change('update other set data = "False" where name = "adsense"'))
-        
+
         curs.execute(db_change('update other set data = ? where name = "adsense_code"'), [adsense_code])
         curs.execute(db_change('update other set data = ? where name = "adsense_code"'), [adsense_code])
         conn.commit()
         conn.commit()
-        
+
         return redirect('/adsense_setting')
         return redirect('/adsense_setting')
 
 
     body_content = ''
     body_content = ''
@@ -51,7 +51,7 @@ def setting_adsense_2(conn):
             <button type="submit" value="publish">{}</button>
             <button type="submit" value="publish">{}</button>
         </form>
         </form>
     '''
     '''
-    
+
     body_content += template.format(
     body_content += template.format(
         'checked' if adsense_enabled == 'True' else '',
         'checked' if adsense_enabled == 'True' else '',
         load_lang('adsense_enable'),
         load_lang('adsense_enable'),

+ 11 - 11
route/setting_oauth.py

@@ -10,7 +10,7 @@ def setting_oauth_2(conn):
         try:
         try:
             facebook_client_id = flask.request.form['facebook_client_id']
             facebook_client_id = flask.request.form['facebook_client_id']
             facebook_client_secret = flask.request.form['facebook_client_secret']
             facebook_client_secret = flask.request.form['facebook_client_secret']
-            
+
             naver_client_id = flask.request.form['naver_client_id']
             naver_client_id = flask.request.form['naver_client_id']
             naver_client_secret = flask.request.form['naver_client_secret']
             naver_client_secret = flask.request.form['naver_client_secret']
         except:
         except:
@@ -42,7 +42,7 @@ def setting_oauth_2(conn):
                     }
                     }
                 }
                 }
             ''')
             ''')
-        
+
         return flask.redirect('/oauth_setting')
         return flask.redirect('/oauth_setting')
 
 
     oauth_supported = load_oauth('_README')['support']
     oauth_supported = load_oauth('_README')['support']
@@ -56,7 +56,7 @@ def setting_oauth_2(conn):
                     target_box.checked = true;
                     target_box.checked = true;
                 } else {
                 } else {
                     target_box.checked = false;
                     target_box.checked = false;
-                } 
+                }
             }
             }
         </script>
         </script>
     '''
     '''
@@ -81,18 +81,18 @@ def setting_oauth_2(conn):
             '''.format(
             '''.format(
                 oauth_supported[i],
                 oauth_supported[i],
                 load_target,
                 load_target,
-                oauth_supported[i], 
-                load_target, 
-                oauth_supported[i], 
-                load_target, 
-                oauth_supported[i], 
-                load_target, 
+                oauth_supported[i],
+                load_target,
+                oauth_supported[i],
+                load_target,
+                oauth_supported[i],
+                load_target,
                 oauth_data['client_{}'.format(load_target)]
                 oauth_data['client_{}'.format(load_target)]
             )
             )
-    
+
     body_content += '<button id="save" type="submit">' + load_lang('save') + '</button></form>'
     body_content += '<button id="save" type="submit">' + load_lang('save') + '</button></form>'
     body_content += '<script>' + init_js + '</script>'
     body_content += '<script>' + init_js + '</script>'
-    
+
     return easy_minify(flask.render_template(skin_check(),
     return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('oauth_setting'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('oauth_setting'), wiki_set(), custom(), other2([0, 0])],
         data = body_content,
         data = body_content,

+ 50 - 50
route/tool/func.py

@@ -124,14 +124,14 @@ def last_change(data):
 
 
                         if e_data == 0:
                         if e_data == 0:
                             re_data_3 = re.compile("<" + i_data[0] + ">")
                             re_data_3 = re.compile("<" + i_data[0] + ">")
-                            data = re_data_3.sub("<" + i_data[0] + " class=\"" + json_data[j_data]["class"] + "\">", data)        
+                            data = re_data_3.sub("<" + i_data[0] + " class=\"" + json_data[j_data]["class"] + "\">", data)
                 else:
                 else:
                     re_data = re.compile("<(?P<in>" + j_data + "(?: (?:(?!>).)*)?)>")
                     re_data = re.compile("<(?P<in>" + j_data + "(?: (?:(?!>).)*)?)>")
                     data = re_data.sub("<\g<in> class=\"" + json_data[j_data]["class"] + "\">", data)
                     data = re_data.sub("<\g<in> class=\"" + json_data[j_data]["class"] + "\">", data)
 
 
     return data
     return data
 
 
-def easy_minify(data, tool = None):    
+def easy_minify(data, tool = None):
     return last_change(data)
     return last_change(data)
 
 
 def render_set(title = '', data = '', num = 0, s_data = 0, include = None):
 def render_set(title = '', data = '', num = 0, s_data = 0, include = None):
@@ -204,7 +204,7 @@ def pw_encode(data, data2 = '', type_d = ''):
             salt_data = bytes(data2, 'utf-8')
             salt_data = bytes(data2, 'utf-8')
         else:
         else:
             salt_data = bcrypt.gensalt(11)
             salt_data = bcrypt.gensalt(11)
-            
+
         return bcrypt.hashpw(bytes(data, 'utf-8'), salt_data).decode()
         return bcrypt.hashpw(bytes(data, 'utf-8'), salt_data).decode()
 
 
 def pw_check(data, data2, type_d = 'no', id_d = ''):
 def pw_check(data, data2, type_d = 'no', id_d = ''):
@@ -218,7 +218,7 @@ def pw_check(data, data2, type_d = 'no', id_d = ''):
             set_data = type_d
             set_data = type_d
     else:
     else:
         set_data = db_data[0][0]
         set_data = db_data[0][0]
-    
+
     while 1:
     while 1:
         if set_data in ['sha256', 'sha3']:
         if set_data in ['sha256', 'sha3']:
             data3 = pw_encode(data = data, type_d = set_data)
             data3 = pw_encode(data = data, type_d = set_data)
@@ -254,7 +254,7 @@ def captcha_post(re_data, num = 1):
                     data = urllib.request.urlopen('https://www.google.com/recaptcha/api/siteverify?secret=' + sec_re[0][0] + '&response=' + re_data)
                     data = urllib.request.urlopen('https://www.google.com/recaptcha/api/siteverify?secret=' + sec_re[0][0] + '&response=' + re_data)
                 except:
                 except:
                     pass
                     pass
-                    
+
                 if data and data.getcode() == 200:
                 if data and data.getcode() == 200:
                     json_data = json.loads(data.read().decode(data.headers.get_content_charset()))
                     json_data = json.loads(data.read().decode(data.headers.get_content_charset()))
                     if json_data['success'] == True:
                     if json_data['success'] == True:
@@ -330,7 +330,7 @@ def ip_or_user(data = ''):
 
 
 def edit_button():
 def edit_button():
     insert_list = []
     insert_list = []
-    
+
     curs.execute(db_change("select html, plus from html_filter where kind = 'edit_top'"))
     curs.execute(db_change("select html, plus from html_filter where kind = 'edit_top'"))
     db_data = curs.fetchall()
     db_data = curs.fetchall()
     for get_data in db_data:
     for get_data in db_data:
@@ -366,7 +366,7 @@ def skin_check(set_n = 0):
     if skin_exist and skin_exist[0][0] != '':
     if skin_exist and skin_exist[0][0] != '':
         if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
         if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
             skin = skin_exist[0][0]
             skin = skin_exist[0][0]
-    
+
     curs.execute(db_change('select data from user_set where name = "skin" and id = ?'), [ip_check()])
     curs.execute(db_change('select data from user_set where name = "skin" and id = ?'), [ip_check()])
     skin_exist = curs.fetchall()
     skin_exist = curs.fetchall()
     if skin_exist and skin_exist[0][0] != '':
     if skin_exist and skin_exist[0][0] != '':
@@ -397,12 +397,12 @@ def other2(data):
 
 
     req_list = ''
     req_list = ''
     main_css_ver = 1
     main_css_ver = 1
-    
+
     if not 'main_css_load' in flask.session or not 'main_css_ver' in flask.session or flask.session['main_css_ver'] != main_css_ver:
     if not 'main_css_load' in flask.session or not 'main_css_ver' in flask.session or flask.session['main_css_ver'] != main_css_ver:
         for i_data in os.listdir(os.path.join("views", "main_css", "css")):
         for i_data in os.listdir(os.path.join("views", "main_css", "css")):
             file_date = str(int(os.path.getmtime(os.path.join("views", "main_css", "css", i_data))))
             file_date = str(int(os.path.getmtime(os.path.join("views", "main_css", "css", i_data))))
             req_list += '<link rel="stylesheet" href="/views/main_css/css/' + i_data + '?ver=' + file_date + '">'
             req_list += '<link rel="stylesheet" href="/views/main_css/css/' + i_data + '?ver=' + file_date + '">'
-        
+
         for i_data in os.listdir(os.path.join("views", "main_css", "js")):
         for i_data in os.listdir(os.path.join("views", "main_css", "js")):
             file_date = str(int(os.path.getmtime(os.path.join("views", "main_css", "js", i_data))))
             file_date = str(int(os.path.getmtime(os.path.join("views", "main_css", "js", i_data))))
             req_list += '<script src="/views/main_css/js/' + i_data + '?ver=' + file_date + '"></script>'
             req_list += '<script src="/views/main_css/js/' + i_data + '?ver=' + file_date + '"></script>'
@@ -461,7 +461,7 @@ def wiki_set(num = 1):
             data_list += [db_data[0][0]]
             data_list += [db_data[0][0]]
         else:
         else:
             data_list += [data_list[0]]
             data_list += [data_list[0]]
-            
+
         curs.execute(db_change("select data from other where name = 'head' and coverage = ?"), [skin_check(1)])
         curs.execute(db_change("select data from other where name = 'head' and coverage = ?"), [skin_check(1)])
         db_data = curs.fetchall()
         db_data = curs.fetchall()
         if db_data and db_data[0][0] != '':
         if db_data and db_data[0][0] != '':
@@ -490,7 +490,7 @@ def wiki_set(num = 1):
         var_data = '2'
         var_data = '2'
 
 
         curs.execute(db_change('select data from other where name = "upload"'))
         curs.execute(db_change('select data from other where name = "upload"'))
-    
+
     db_data = curs.fetchall()
     db_data = curs.fetchall()
     if db_data and db_data[0][0] != '':
     if db_data and db_data[0][0] != '':
         return db_data[0][0]
         return db_data[0][0]
@@ -524,7 +524,7 @@ def diff(seqm):
         data = re.search('((?:(?!\n).)*)\n', end)
         data = re.search('((?:(?!\n).)*)\n', end)
         if data:
         if data:
             data = data.groups()[0]
             data = data.groups()[0]
-            
+
             left += 1
             left += 1
             if re.search('<span style=\'(?:(?:(?!\').)+)\'>', data):
             if re.search('<span style=\'(?:(?:(?!\').)+)\'>', data):
                 num += 1
                 num += 1
@@ -543,9 +543,9 @@ def diff(seqm):
             end = re.sub('((?:(?!\n).)*)\n', '', end, 1)
             end = re.sub('((?:(?!\n).)*)\n', '', end, 1)
         else:
         else:
             break
             break
-            
+
     return sub
     return sub
-           
+
 def admin_check(num = None, what = None, name = ''):
 def admin_check(num = None, what = None, name = ''):
     if name == '':
     if name == '':
         ip = ip_check()
         ip = ip_check()
@@ -595,13 +595,13 @@ def admin_check(num = None, what = None, name = ''):
                     num = None
                     num = None
                 else:
                 else:
                     break
                     break
-                    
+
     return 0
     return 0
 
 
 def ip_pas(raw_ip):
 def ip_pas(raw_ip):
     hide = 0
     hide = 0
 
 
-    if ip_or_user(raw_ip) != 0:    
+    if ip_or_user(raw_ip) != 0:
         curs.execute(db_change("select data from other where name = 'ip_view'"))
         curs.execute(db_change("select data from other where name = 'ip_view'"))
         data = curs.fetchall()
         data = curs.fetchall()
         if data and data[0][0] != '':
         if data and data[0][0] != '':
@@ -623,7 +623,7 @@ def ip_pas(raw_ip):
 
 
     if ban_check(raw_ip) == 1:
     if ban_check(raw_ip) == 1:
         ip = '<s>' + ip + '</s>'
         ip = '<s>' + ip + '</s>'
-         
+
     if hide == 0:
     if hide == 0:
         ip += ' <a href="/tool/' + url_pas(raw_ip) + '">(' + load_lang('tool') + ')</a>'
         ip += ' <a href="/tool/' + url_pas(raw_ip) + '">(' + load_lang('tool') + ')</a>'
 
 
@@ -642,7 +642,7 @@ def custom():
     if ip_or_user(ip) == 0:
     if ip_or_user(ip) == 0:
         user_icon = 1
         user_icon = 1
         user_name = ip
         user_name = ip
-        
+
         curs.execute(db_change('select data from user_set where name = "email" and id = ?'), [ip])
         curs.execute(db_change('select data from user_set where name = "email" and id = ?'), [ip])
         data = curs.fetchall()
         data = curs.fetchall()
         if data:
         if data:
@@ -689,15 +689,15 @@ def custom():
         user_topic = '0'
         user_topic = '0'
 
 
     return [
     return [
-        '', 
-        '', 
-        user_icon, 
-        user_head, 
-        email, 
-        user_name, 
-        user_admin, 
-        str(ban_check()), 
-        user_notice, 
+        '',
+        '',
+        user_icon,
+        user_head,
+        email,
+        user_name,
+        user_admin,
+        str(ban_check()),
+        user_notice,
         user_acl_list,
         user_acl_list,
         ip,
         ip,
         user_topic
         user_topic
@@ -772,7 +772,7 @@ def slow_edit_check():
 
 
 def acl_check(name = 'test', tool = '', sub = 'test'):
 def acl_check(name = 'test', tool = '', sub = 'test'):
     ip = ip_check()
     ip = ip_check()
-    
+
     if ban_check() == 1:
     if ban_check() == 1:
         return 1
         return 1
 
 
@@ -795,7 +795,7 @@ def acl_check(name = 'test', tool = '', sub = 'test'):
 
 
                 if ip != acl_n[0] or re.search("(\.|:)", ip):
                 if ip != acl_n[0] or re.search("(\.|:)", ip):
                     return 1
                     return 1
-            
+
             if ip == acl_n[0] and not re.search("(\.|:)", ip) and not re.search("(\.|:)", acl_n[0]):
             if ip == acl_n[0] and not re.search("(\.|:)", ip) and not re.search("(\.|:)", acl_n[0]):
                 return 0
                 return 0
             else:
             else:
@@ -830,11 +830,11 @@ def acl_check(name = 'test', tool = '', sub = 'test'):
             num = 3
             num = 3
         elif tool == 'upload':
         elif tool == 'upload':
             curs.execute(db_change("select data from other where name = 'upload_acl'"))
             curs.execute(db_change("select data from other where name = 'upload_acl'"))
-            
+
             num = 5
             num = 5
         elif tool == 'edit_req':
         elif tool == 'edit_req':
             curs.execute(db_change("select data from other where name = 'edit_req_acl'"))
             curs.execute(db_change("select data from other where name = 'edit_req_acl'"))
-            
+
             num = 5
             num = 5
         else:
         else:
             if i == 0:
             if i == 0:
@@ -860,7 +860,7 @@ def acl_check(name = 'test', tool = '', sub = 'test'):
             if acl_data[0][0] == '50_edit':
             if acl_data[0][0] == '50_edit':
                 if ip_or_user(ip) == 1:
                 if ip_or_user(ip) == 1:
                     return 1
                     return 1
-                
+
                 if admin_check(num) != 1:
                 if admin_check(num) != 1:
                     curs.execute(db_change("select count(title) from history where ip = ?"), [ip])
                     curs.execute(db_change("select count(title) from history where ip = ?"), [ip])
                     count = curs.fetchall()
                     count = curs.fetchall()
@@ -875,7 +875,7 @@ def acl_check(name = 'test', tool = '', sub = 'test'):
             if acl_data[0][0] == 'email':
             if acl_data[0][0] == 'email':
                 if ip_or_user(ip) == 1:
                 if ip_or_user(ip) == 1:
                     return 1
                     return 1
-                
+
                 if admin_check(num) != 1:
                 if admin_check(num) != 1:
                     curs.execute(db_change("select data from user_set where id = ? and name = 'email'"), [ip])
                     curs.execute(db_change("select data from user_set where id = ? and name = 'email'"), [ip])
                     email = curs.fetchall()
                     email = curs.fetchall()
@@ -920,7 +920,7 @@ def ban_check(ip = None, tool = None):
                     return 1
                     return 1
             else:
             else:
                 return 1
                 return 1
-    
+
     curs.execute(db_change("select login from ban where ((end > ? and end like '2%') or end = '') and block = ? and band = 'O'"), [get_time(), band_it])
     curs.execute(db_change("select login from ban where ((end > ? and end like '2%') or end = '') and block = ? and band = 'O'"), [get_time(), band_it])
     band_d = curs.fetchall()
     band_d = curs.fetchall()
     if band_d:
     if band_d:
@@ -957,11 +957,11 @@ def ban_insert(name, end, why, login, blocker, type_d = None):
     curs.execute(db_change("select block from ban where ((end > ? and end like '2%') or end = '') and block = ? and band = ?"), [get_time(), name, band])
     curs.execute(db_change("select block from ban where ((end > ? and end like '2%') or end = '') and block = ? and band = ?"), [get_time(), name, band])
     if curs.fetchall():
     if curs.fetchall():
         curs.execute(db_change("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)"), [
         curs.execute(db_change("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)"), [
-            name, 
+            name,
             'release',
             'release',
-            now_time, 
-            blocker, 
-            '', 
+            now_time,
+            blocker,
+            '',
             band
             band
         ])
         ])
         curs.execute(db_change("delete from ban where block = ? and band = ?"), [name, band])
         curs.execute(db_change("delete from ban where block = ? and band = ?"), [name, band])
@@ -982,7 +982,7 @@ def ban_insert(name, end, why, login, blocker, type_d = None):
 
 
         curs.execute(db_change("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)"), [name, r_time, now_time, blocker, why, band])
         curs.execute(db_change("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)"), [name, r_time, now_time, blocker, why, band])
         curs.execute(db_change("insert into ban (block, end, why, band, login) values (?, ?, ?, ?, ?)"), [name, r_time, why, band, login])
         curs.execute(db_change("insert into ban (block, end, why, band, login) values (?, ?, ?, ?, ?)"), [name, r_time, why, band, login])
-    
+
     conn.commit()
     conn.commit()
 
 
 def rd_plus(title, sub, date):
 def rd_plus(title, sub, date):
@@ -1033,7 +1033,7 @@ def leng_check(first, second):
         all_plus = '-' + str(first - second)
         all_plus = '-' + str(first - second)
     else:
     else:
         all_plus = '0'
         all_plus = '0'
-        
+
     return all_plus
     return all_plus
 
 
 def number_check(data):
 def number_check(data):
@@ -1050,15 +1050,15 @@ def edit_filter_do(data):
             match = re.compile(data_list[0], re.I)
             match = re.compile(data_list[0], re.I)
             if match.search(data):
             if match.search(data):
                 ban_insert(
                 ban_insert(
-                    ip_check(), 
-                    '0' if data_list[1] == 'X' else data_list[1], 
-                    'edit filter', 
-                    None, 
+                    ip_check(),
+                    '0' if data_list[1] == 'X' else data_list[1],
+                    'edit filter',
+                    None,
                     'tool:edit filter'
                     'tool:edit filter'
                 )
                 )
-                
+
                 return 1
                 return 1
-    
+
     return 0
     return 0
 
 
 def redirect(data = '/'):
 def redirect(data = '/'):
@@ -1066,14 +1066,14 @@ def redirect(data = '/'):
 
 
 def re_error(data):
 def re_error(data):
     conn.commit()
     conn.commit()
-    
+
     if data == '/ban':
     if data == '/ban':
         if ban_check() == 1:
         if ban_check() == 1:
             end = '<div id="get_user_info"></div><script>load_user_info("' + ip_check() + '");</script>'
             end = '<div id="get_user_info"></div><script>load_user_info("' + ip_check() + '");</script>'
         else:
         else:
             end = load_lang('authority_error')
             end = load_lang('authority_error')
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('error'), wiki_set(1), custom(), other2([0, 0])],
             imp = [load_lang('error'), wiki_set(1), custom(), other2([0, 0])],
             data = '<h2>' + load_lang('error') + '</h2>' + end,
             data = '<h2>' + load_lang('error') + '</h2>' + end,
             menu = 0
             menu = 0
@@ -1134,13 +1134,13 @@ def re_error(data):
                 data = '???'
                 data = '???'
 
 
             if num == 5:
             if num == 5:
-                return easy_minify(flask.render_template(skin_check(), 
+                return easy_minify(flask.render_template(skin_check(),
                     imp = [load_lang('skin_set'), wiki_set(1), custom(), other2([0, 0])],
                     imp = [load_lang('skin_set'), wiki_set(1), custom(), other2([0, 0])],
                     data = '<div id="main_skin_set"><h2>' + load_lang('error') + '</h2><ul><li>' + data + '</li></ul></div>',
                     data = '<div id="main_skin_set"><h2>' + load_lang('error') + '</h2><ul><li>' + data + '</li></ul></div>',
                     menu = 0
                     menu = 0
                 ))
                 ))
             else:
             else:
-                return easy_minify(flask.render_template(skin_check(), 
+                return easy_minify(flask.render_template(skin_check(),
                     imp = [load_lang('error'), wiki_set(1), custom(), other2([0, 0])],
                     imp = [load_lang('error'), wiki_set(1), custom(), other2([0, 0])],
                     data = '<h2>' + load_lang('error') + '</h2><ul><li>' + data + '</li></ul>',
                     data = '<h2>' + load_lang('error') + '</h2><ul><li>' + data + '</li></ul>',
                     menu = 0
                     menu = 0

+ 7 - 7
route/tool/mark.py

@@ -20,9 +20,9 @@ def load_conn2(data):
 def send_parser(data):
 def send_parser(data):
     if not re.search('^<br>$', data):
     if not re.search('^<br>$', data):
         data = html.escape(data)
         data = html.escape(data)
-        
+
         javascript = re.compile('javascript:', re.I)
         javascript = re.compile('javascript:', re.I)
-        
+
         data = javascript.sub('', data)
         data = javascript.sub('', data)
 
 
         while 1:
         while 1:
@@ -33,9 +33,9 @@ def send_parser(data):
                 data = re.sub('&lt;a(?: (?:(?:(?!&gt;).)*))?&gt;(?P<in>(?:(?!&lt;).)*)&lt;\/a&gt;', '<a href="/w/' + urllib.parse.quote(re_data).replace('/','%2F') + '">' + re_data + '</a>', data, 1)
                 data = re.sub('&lt;a(?: (?:(?:(?!&gt;).)*))?&gt;(?P<in>(?:(?!&lt;).)*)&lt;\/a&gt;', '<a href="/w/' + urllib.parse.quote(re_data).replace('/','%2F') + '">' + re_data + '</a>', data, 1)
             else:
             else:
                 break
                 break
-        
+
     return data
     return data
-    
+
 def plusing(data):
 def plusing(data):
     for data_in in data:
     for data_in in data:
         curs.execute(db_change("select title from back where title = ? and link = ? and type = ?"), [data_in[1], data_in[0], data_in[2]])
         curs.execute(db_change("select title from back where title = ? and link = ? and type = ?"), [data_in[1], data_in[0], data_in[2]])
@@ -55,7 +55,7 @@ def render_do(title, data, num, include):
         data = ['', '', []]
         data = ['', '', []]
 
 
     if num == 1:
     if num == 1:
-        data_num = len(data[2]) 
+        data_num = len(data[2])
         data_in_num = int(data_num / multiprocessing.cpu_count())
         data_in_num = int(data_num / multiprocessing.cpu_count())
         data_in = []
         data_in = []
 
 
@@ -69,9 +69,9 @@ def render_do(title, data, num, include):
             thread_start = threading.Thread(target = plusing, args = [data_in_for])
             thread_start = threading.Thread(target = plusing, args = [data_in_for])
             thread_start.start()
             thread_start.start()
             thread_start.join()
             thread_start.join()
-        
+
         conn.commit()
         conn.commit()
-        
+
     if num == 2:
     if num == 2:
         return [data[0], data[1]]
         return [data[0], data[1]]
     else:
     else:

+ 2 - 2
route/tool/set_mark/markdown.py

@@ -6,9 +6,9 @@ import re
 
 
 def markdown(conn, data, title, main_num):
 def markdown(conn, data, title, main_num):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     data = '<div id="render_contect">' + re.sub('\r\n', '<br>', html.escape(data)) + '</div>'
     data = '<div id="render_contect">' + re.sub('\r\n', '<br>', html.escape(data)) + '</div>'
     plus_data = '<script>render_markdown();</script>'
     plus_data = '<script>render_markdown();</script>'
     backlink = []
     backlink = []
-    
+
     return [data, plus_data, backlink]
     return [data, plus_data, backlink]

+ 147 - 147
route/tool/set_mark/namumark.py

@@ -21,7 +21,7 @@ def table_parser(data, cel_data, start_data, num = 0):
             div_style += 'width: ' + table_width.groups()[0] + ';'
             div_style += 'width: ' + table_width.groups()[0] + ';'
 
 
         all_table += 'width: 100%;'
         all_table += 'width: 100%;'
-    
+
     table_height = re.search("&lt;table ?height=((?:(?!&gt;).)*)&gt;", data)
     table_height = re.search("&lt;table ?height=((?:(?!&gt;).)*)&gt;", data)
     if table_height:
     if table_height:
         if re.search('^[0-9]+$', table_height.groups()[0]):
         if re.search('^[0-9]+$', table_height.groups()[0]):
@@ -30,14 +30,14 @@ def table_parser(data, cel_data, start_data, num = 0):
             all_table += 'height: ' + table_height.groups()[0] + ';'
             all_table += 'height: ' + table_height.groups()[0] + ';'
 
 
     # width, height
     # width, height
-    
+
     table_align = re.search("&lt;table ?align=((?:(?!&gt;).)*)&gt;", data)
     table_align = re.search("&lt;table ?align=((?:(?!&gt;).)*)&gt;", data)
     if table_align:
     if table_align:
         if table_align.groups()[0] == 'right':
         if table_align.groups()[0] == 'right':
             all_table += 'float: right;'
             all_table += 'float: right;'
         elif table_align.groups()[0] == 'center':
         elif table_align.groups()[0] == 'center':
             all_table += 'margin: auto;'
             all_table += 'margin: auto;'
-            
+
     table_text_align = re.search("&lt;table ?textalign=((?:(?!&gt;).)*)&gt;", data)
     table_text_align = re.search("&lt;table ?textalign=((?:(?!&gt;).)*)&gt;", data)
     if table_text_align:
     if table_text_align:
         num = 1
         num = 1
@@ -55,14 +55,14 @@ def table_parser(data, cel_data, start_data, num = 0):
             row_style += 'text-align: center;'
             row_style += 'text-align: center;'
         else:
         else:
             row_style += 'text-align: left;'
             row_style += 'text-align: left;'
-        
+
     # align
     # align
-    
+
     table_cel = re.search("&lt;-((?:(?!&gt;).)*)&gt;", data)
     table_cel = re.search("&lt;-((?:(?!&gt;).)*)&gt;", data)
     if table_cel:
     if table_cel:
         cel = 'colspan="' + table_cel.groups()[0] + '"'
         cel = 'colspan="' + table_cel.groups()[0] + '"'
     else:
     else:
-        cel = 'colspan="' + str(round(len(start_data) / 2)) + '"'   
+        cel = 'colspan="' + str(round(len(start_data) / 2)) + '"'
 
 
     table_row = re.search("&lt;\|((?:(?!&gt;).)*)&gt;", data)
     table_row = re.search("&lt;\|((?:(?!&gt;).)*)&gt;", data)
     if table_row:
     if table_row:
@@ -79,11 +79,11 @@ def table_parser(data, cel_data, start_data, num = 0):
         row_style += 'color: ' + row_bgcolor.groups()[0] + ';'
         row_style += 'color: ' + row_bgcolor.groups()[0] + ';'
 
 
     # row
     # row
-        
+
     table_border = re.search("&lt;table ?bordercolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     table_border = re.search("&lt;table ?bordercolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     if table_border:
     if table_border:
         all_table += 'border: ' + table_border.groups()[0] + ' 2px solid;'
         all_table += 'border: ' + table_border.groups()[0] + ' 2px solid;'
-        
+
     table_bgcolor = re.search("&lt;table ?bgcolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     table_bgcolor = re.search("&lt;table ?bgcolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     if table_bgcolor:
     if table_bgcolor:
         all_table += 'background: ' + table_bgcolor.groups()[0] + ';'
         all_table += 'background: ' + table_bgcolor.groups()[0] + ';'
@@ -93,7 +93,7 @@ def table_parser(data, cel_data, start_data, num = 0):
         all_table += 'color: ' + table_bgcolor.groups()[0] + ';'
         all_table += 'color: ' + table_bgcolor.groups()[0] + ';'
 
 
     # all
     # all
-        
+
     bgcolor = re.search("&lt;(?:bgcolor=)?(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     bgcolor = re.search("&lt;(?:bgcolor=)?(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     if bgcolor:
     if bgcolor:
         cel_style += 'background: ' + bgcolor.groups()[0] + ';'
         cel_style += 'background: ' + bgcolor.groups()[0] + ';'
@@ -101,7 +101,7 @@ def table_parser(data, cel_data, start_data, num = 0):
     bgcolor = re.search("&lt;color=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     bgcolor = re.search("&lt;color=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)&gt;", data)
     if bgcolor:
     if bgcolor:
         cel_style += 'color: ' + bgcolor.groups()[0] + ';'
         cel_style += 'color: ' + bgcolor.groups()[0] + ';'
-        
+
     cel_width = re.search("&lt;width=((?:(?!&gt;).)*)&gt;", data)
     cel_width = re.search("&lt;width=((?:(?!&gt;).)*)&gt;", data)
     if cel_width:
     if cel_width:
         if re.search('^[0-9]+$', cel_width.groups()[0]):
         if re.search('^[0-9]+$', cel_width.groups()[0]):
@@ -117,7 +117,7 @@ def table_parser(data, cel_data, start_data, num = 0):
             cel_style += 'height: ' + cel_height.groups()[0] + ';'
             cel_style += 'height: ' + cel_height.groups()[0] + ';'
 
 
     # cel
     # cel
-        
+
     text_right = re.search("&lt;\)&gt;", data)
     text_right = re.search("&lt;\)&gt;", data)
     text_center = re.search("&lt;:&gt;", data)
     text_center = re.search("&lt;:&gt;", data)
     text_left = re.search("&lt;\(&gt;",  data)
     text_left = re.search("&lt;\(&gt;",  data)
@@ -138,7 +138,7 @@ def table_parser(data, cel_data, start_data, num = 0):
     text_class = re.search("&lt;table ?class=((?:(?!&gt;).)+)&gt;", data)
     text_class = re.search("&lt;table ?class=((?:(?!&gt;).)+)&gt;", data)
     if text_class:
     if text_class:
         table_class += text_class.groups()[0]
         table_class += text_class.groups()[0]
-        
+
     div_style += '"'
     div_style += '"'
     all_table += '"'
     all_table += '"'
     cel_style += '"'
     cel_style += '"'
@@ -146,7 +146,7 @@ def table_parser(data, cel_data, start_data, num = 0):
     table_class += '"'
     table_class += '"'
 
 
     return [all_table, row_style, cel_style, row, cel, table_class, num, div_style]
     return [all_table, row_style, cel_style, row, cel, table_class, num, div_style]
-    
+
 def table_start(data):
 def table_start(data):
     while 1:
     while 1:
         table = re.search('\n((?:(?:(?:(?:\|\|)+(?:(?:(?!\|\|).(?:\n)*)*))+)\|\|(?:\n)?)+)', data)
         table = re.search('\n((?:(?:(?:(?:\|\|)+(?:(?:(?!\|\|).(?:\n)*)*))+)\|\|(?:\n)?)+)', data)
@@ -159,34 +159,34 @@ def table_start(data):
 
 
                     return_table = table_parser(all_table[1], all_table[2], all_table[0])
                     return_table = table_parser(all_table[1], all_table[2], all_table[0])
                     number = return_table[6]
                     number = return_table[6]
-                    
+
                     table = re.sub(
                     table = re.sub(
-                        '^((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*', 
+                        '^((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*',
                         '\n' + \
                         '\n' + \
                             '<div class="table_safe" ' + return_table[7] + '>' + \
                             '<div class="table_safe" ' + return_table[7] + '>' + \
                                 '<table ' + return_table[5] + ' ' + return_table[0] + '>' + \
                                 '<table ' + return_table[5] + ' ' + return_table[0] + '>' + \
                                     '<tbody>' + \
                                     '<tbody>' + \
                                         '<tr ' + return_table[1] + '>' + \
                                         '<tr ' + return_table[1] + '>' + \
-                                            '<td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>', 
-                        table, 
+                                            '<td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>',
+                        table,
                         1
                         1
                     )
                     )
                 else:
                 else:
                     break
                     break
-                    
+
             table = re.sub('\|\|\n?$', '</td></tr></tbody></table></div>', table)
             table = re.sub('\|\|\n?$', '</td></tr></tbody></table></div>', table)
 
 
             while 1:
             while 1:
                 row_table = re.search('\|\|\n((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*((?:(?!\|\||<\/td>).\n*)*)', table)
                 row_table = re.search('\|\|\n((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*((?:(?!\|\||<\/td>).\n*)*)', table)
                 if row_table:
                 if row_table:
                     row_table = row_table.groups()
                     row_table = row_table.groups()
-                    
+
                     return_table = table_parser(row_table[1], row_table[2], row_table[0], number)
                     return_table = table_parser(row_table[1], row_table[2], row_table[0], number)
-                    
+
                     table = re.sub(
                     table = re.sub(
-                        '\|\|\n((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*', 
-                        '</td></tr><tr ' + return_table[1] + '><td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>', 
-                        table, 
+                        '\|\|\n((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*',
+                        '</td></tr><tr ' + return_table[1] + '><td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>',
+                        table,
                         1
                         1
                     )
                     )
                 else:
                 else:
@@ -196,13 +196,13 @@ def table_start(data):
                 cel_table = re.search('((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*((?:(?:(?!\|\||<\/td>).)|\n)*\n*)', table)
                 cel_table = re.search('((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*((?:(?:(?!\|\||<\/td>).)|\n)*\n*)', table)
                 if cel_table:
                 if cel_table:
                     cel_table = cel_table.groups()
                     cel_table = cel_table.groups()
-                    
+
                     return_table = table_parser(cel_table[1], re.sub('\n', ' ', cel_table[2]), cel_table[0], number)
                     return_table = table_parser(cel_table[1], re.sub('\n', ' ', cel_table[2]), cel_table[0], number)
-                    
+
                     table = re.sub(
                     table = re.sub(
-                        '((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*', 
-                        '</td><td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>', 
-                        table, 
+                        '((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*',
+                        '</td><td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>',
+                        table,
                         1
                         1
                     )
                     )
                 else:
                 else:
@@ -211,7 +211,7 @@ def table_start(data):
             data = re.sub('\n((?:(?:(?:(?:\|\|)+(?:(?:(?!\|\|).(?:\n)*)*))+)\|\|(?:\n)?)+)', table, data, 1)
             data = re.sub('\n((?:(?:(?:(?:\|\|)+(?:(?:(?!\|\|).(?:\n)*)*))+)\|\|(?:\n)?)+)', table, data, 1)
         else:
         else:
             break
             break
-            
+
     return data
     return data
 
 
 def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
 def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
@@ -229,29 +229,29 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
         if not middle_data[1]:
         if not middle_data[1]:
             if middle_stack > 0:
             if middle_stack > 0:
                 middle_stack += 1
                 middle_stack += 1
-                
+
                 data = re.sub('(?:{{{((?:(?! |{{{|}}}|&lt;).)*)(?P<in> ?)|(}}}))', '&#123;&#123;&#123;' + middle_data[0] + '\g<in>', data, 1)
                 data = re.sub('(?:{{{((?:(?! |{{{|}}}|&lt;).)*)(?P<in> ?)|(}}}))', '&#123;&#123;&#123;' + middle_data[0] + '\g<in>', data, 1)
             else:
             else:
                 if re.search('^(#|@|\+|\-)', middle_data[0]) and not re.search('^(#|@|\+|\-){2}|(#|@|\+|\-)\\\\', middle_data[0]):
                 if re.search('^(#|@|\+|\-)', middle_data[0]) and not re.search('^(#|@|\+|\-){2}|(#|@|\+|\-)\\\\', middle_data[0]):
-                    if re.search('^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0]):                            
+                    if re.search('^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0]):
                         middle_search = re.search('^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0])
                         middle_search = re.search('^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0])
                         middle_list += ['span']
                         middle_list += ['span']
-                        
+
                         data = middle_re.sub('<span style="color: ' + middle_search.groups()[0] + ';">', data, 1)
                         data = middle_re.sub('<span style="color: ' + middle_search.groups()[0] + ';">', data, 1)
                     elif re.search('^(?:#(\w+))', middle_data[0]):
                     elif re.search('^(?:#(\w+))', middle_data[0]):
                         middle_search = re.search('^(?:#(\w+))', middle_data[0])
                         middle_search = re.search('^(?:#(\w+))', middle_data[0])
                         middle_list += ['span']
                         middle_list += ['span']
-                        
+
                         data = middle_re.sub('<span style="color: ' + middle_search.groups()[0] + ';">', data, 1)
                         data = middle_re.sub('<span style="color: ' + middle_search.groups()[0] + ';">', data, 1)
                     elif re.search('^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0]):
                     elif re.search('^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0]):
                         middle_search = re.search('^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0])
                         middle_search = re.search('^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0])
                         middle_list += ['span']
                         middle_list += ['span']
-                            
+
                         data = middle_re.sub('<span style="background: #' + middle_search.groups()[0] + ';">', data, 1)
                         data = middle_re.sub('<span style="background: #' + middle_search.groups()[0] + ';">', data, 1)
                     elif re.search('^(?:@(\w+))', middle_data[0]):
                     elif re.search('^(?:@(\w+))', middle_data[0]):
                         middle_search = re.search('^(?:@(\w+))', middle_data[0])
                         middle_search = re.search('^(?:@(\w+))', middle_data[0])
                         middle_list += ['span']
                         middle_list += ['span']
-                        
+
                         data = middle_re.sub('<span style="background: ' + middle_search.groups()[0] + ';">', data, 1)
                         data = middle_re.sub('<span style="background: ' + middle_search.groups()[0] + ';">', data, 1)
                     elif re.search('^(\+|-)([1-5])', middle_data[0]):
                     elif re.search('^(\+|-)([1-5])', middle_data[0]):
                         middle_search = re.search('^(\+|-)([1-5])', middle_data[0])
                         middle_search = re.search('^(\+|-)([1-5])', middle_data[0])
@@ -262,7 +262,7 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
                             font_size = str(100 - int(middle_search[1]) * 10)
                             font_size = str(100 - int(middle_search[1]) * 10)
 
 
                         middle_list += ['span']
                         middle_list += ['span']
-                        
+
                         data = middle_re.sub('<span style="font-size: ' + font_size + '%;">', data, 1)
                         data = middle_re.sub('<span style="font-size: ' + font_size + '%;">', data, 1)
                     elif re.search('^#!wiki', middle_data[0]):
                     elif re.search('^#!wiki', middle_data[0]):
                         middle_data_2 = re.search('{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?: *)\n?', data)
                         middle_data_2 = re.search('{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?: *)\n?', data)
@@ -272,14 +272,14 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
                             middle_data_2 = ['']
                             middle_data_2 = ['']
 
 
                         middle_list += ['div_1']
                         middle_list += ['div_1']
-                        
+
                         data = re.sub(
                         data = re.sub(
                             '{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?: *)\n?',
                             '{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?: *)\n?',
-                            '<div id="wiki_div" style="' + str(middle_data_2[0] if middle_data_2[0] else '') + '">', 
-                            data, 
+                            '<div id="wiki_div" style="' + str(middle_data_2[0] if middle_data_2[0] else '') + '">',
+                            data,
                             1
                             1
                         )
                         )
-                    elif re.search('^#!syntax', middle_data[0]):                                         
+                    elif re.search('^#!syntax', middle_data[0]):
                         middle_data_2 = re.search('{{{#!syntax ((?:(?!\n).)+)\n?', data)
                         middle_data_2 = re.search('{{{#!syntax ((?:(?!\n).)+)\n?', data)
                         if middle_data_2:
                         if middle_data_2:
                             middle_data_2 = middle_data_2.groups()
                             middle_data_2 = middle_data_2.groups()
@@ -292,16 +292,16 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
                             syntax_num = 1
                             syntax_num = 1
 
 
                         middle_list += ['pre']
                         middle_list += ['pre']
-                        
+
                         data = re.sub(
                         data = re.sub(
-                            '{{{#!syntax ?((?:(?!\n).)*)\n?', 
-                            '<pre id="syntax"><code class="' + middle_data_2[0] + '">', 
+                            '{{{#!syntax ?((?:(?!\n).)*)\n?',
+                            '<pre id="syntax"><code class="' + middle_data_2[0] + '">',
                             data,
                             data,
                             1
                             1
                         )
                         )
                     elif re.search('^#!folding', middle_data[0]):
                     elif re.search('^#!folding', middle_data[0]):
                         middle_list += ['2div']
                         middle_list += ['2div']
-                        
+
                         folding_data = re.search('{{{#!folding ?((?:(?!\n).)*)\n?', data)
                         folding_data = re.search('{{{#!folding ?((?:(?!\n).)*)\n?', data)
                         if folding_data:
                         if folding_data:
                             folding_data = folding_data.groups()
                             folding_data = folding_data.groups()
@@ -310,7 +310,7 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
 
 
                         if folding_num == 0:
                         if folding_num == 0:
                             folding_num = 1
                             folding_num = 1
-                        
+
                         data = re.sub(
                         data = re.sub(
                             '{{{#!folding ?((?:(?!\n).)*)\n?', '' + \
                             '{{{#!folding ?((?:(?!\n).)*)\n?', '' + \
                             '<div>' + \
                             '<div>' + \
@@ -321,17 +321,17 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
                                     '</a>' + \
                                     '</a>' + \
                                 '</div_2>' + \
                                 '</div_2>' + \
                                 '<div id="' + include_num + 'folding_' + str(fol_num) + '" style="display: none;">' + \
                                 '<div id="' + include_num + 'folding_' + str(fol_num) + '" style="display: none;">' + \
-                                    '<div id="wiki_div" style="">', 
-                            data, 
+                                    '<div id="wiki_div" style="">',
+                            data,
                             1
                             1
                         )
                         )
-                            
+
                         fol_num += 1
                         fol_num += 1
                     elif re.search('^#!html', middle_data[0]):
                     elif re.search('^#!html', middle_data[0]):
                         middle_list += ['span']
                         middle_list += ['span']
-                        
+
                         html_number += 1
                         html_number += 1
-                    
+
                         data = middle_re.sub('<span id="' + include_num + 'render_contect_' + str(html_number) + '">', data, 1)
                         data = middle_re.sub('<span id="' + include_num + 'render_contect_' + str(html_number) + '">', data, 1)
                     else:
                     else:
                         middle_list += ['span']
                         middle_list += ['span']
@@ -339,11 +339,11 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
                         data = middle_re.sub('<span>', data, 1)
                         data = middle_re.sub('<span>', data, 1)
                 else:
                 else:
                     middle_list += ['code']
                     middle_list += ['code']
-                    
+
                     middle_stack += 1
                     middle_stack += 1
-                    
+
                     data = middle_re.sub('<code>' + middle_data[0].replace('\\', '\\\\'), data, 1)
                     data = middle_re.sub('<code>' + middle_data[0].replace('\\', '\\\\'), data, 1)
-            
+
                 middle_number += 1
                 middle_number += 1
         else:
         else:
             if middle_list == []:
             if middle_list == []:
@@ -354,19 +354,19 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
 
 
                 if middle_stack > 0:
                 if middle_stack > 0:
                     data = middle_re.sub('&#125;&#125;&#125;', data, 1)
                     data = middle_re.sub('&#125;&#125;&#125;', data, 1)
-                else:                    
+                else:
                     if middle_number > 0:
                     if middle_number > 0:
                         middle_number -= 1
                         middle_number -= 1
-                        
+
                     if middle_list[middle_number] == '2div':
                     if middle_list[middle_number] == '2div':
                         data = middle_re.sub('</div_1></div_2></div_2>', data, 1)
                         data = middle_re.sub('</div_1></div_2></div_2>', data, 1)
                     elif middle_list[middle_number] == 'pre':
                     elif middle_list[middle_number] == 'pre':
                         data = middle_re.sub('</code></pre>', data, 1)
                         data = middle_re.sub('</code></pre>', data, 1)
                     else:
                     else:
                         data = middle_re.sub('</' + middle_list[middle_number] + '>', data, 1)
                         data = middle_re.sub('</' + middle_list[middle_number] + '>', data, 1)
-                    
+
                     del(middle_list[middle_number])
                     del(middle_list[middle_number])
-        
+
     while 1:
     while 1:
         if middle_stack == 0:
         if middle_stack == 0:
             break
             break
@@ -379,17 +379,17 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
 
 
                 if middle_stack > 0:
                 if middle_stack > 0:
                     data += '&#125;&#125;&#125;'
                     data += '&#125;&#125;&#125;'
-                else:                    
+                else:
                     if middle_number > 0:
                     if middle_number > 0:
                         middle_number -= 1
                         middle_number -= 1
-                        
+
                     if middle_list[middle_number] == '2div':
                     if middle_list[middle_number] == '2div':
                         data += '</div_1></div_2></div_2>'
                         data += '</div_1></div_2></div_2>'
                     elif middle_list[middle_number] == 'pre':
                     elif middle_list[middle_number] == 'pre':
                         data += '</code></pre>'
                         data += '</code></pre>'
                     else:
                     else:
                         data += '</' + middle_list[middle_number] + '>'
                         data += '</' + middle_list[middle_number] + '>'
-                    
+
                     del(middle_list[middle_number])
                     del(middle_list[middle_number])
 
 
     num = 0
     num = 0
@@ -397,15 +397,15 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
         nowiki_data = re.search('<code>((?:(?:(?!<\/code>).)*\n*)*)<\/code>', data)
         nowiki_data = re.search('<code>((?:(?:(?!<\/code>).)*\n*)*)<\/code>', data)
         if nowiki_data:
         if nowiki_data:
             nowiki_data = nowiki_data.groups()
             nowiki_data = nowiki_data.groups()
-            
+
             num += 1
             num += 1
 
 
             end_data += [['nowiki_' + str(num), nowiki_data[0], 'code']]
             end_data += [['nowiki_' + str(num), nowiki_data[0], 'code']]
 
 
             data = re.sub(
             data = re.sub(
-                '<code>((?:(?:(?!<\/code>).)*\n*)*)<\/code>', 
-                '<span id="nowiki_' + str(num) + '"></span>', 
-                data, 
+                '<code>((?:(?:(?!<\/code>).)*\n*)*)<\/code>',
+                '<span id="nowiki_' + str(num) + '"></span>',
+                data,
                 1
                 1
             )
             )
         else:
         else:
@@ -422,9 +422,9 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
             end_data += [['syntax_' + str(num), syntax_data[1], 'normal']]
             end_data += [['syntax_' + str(num), syntax_data[1], 'normal']]
 
 
             data = re.sub(
             data = re.sub(
-                '<code class="((?:(?!").)+)">((?:(?:(?:(?!<\/code>|<span id="syntax_)).)+\n*)+)<\/code>', 
-                '<code class="' + syntax_data[0] + '"><span id="syntax_' + str(num) + '"></span></code>', 
-                data, 
+                '<code class="((?:(?!").)+)">((?:(?:(?:(?!<\/code>|<span id="syntax_)).)+\n*)+)<\/code>',
+                '<code class="' + syntax_data[0] + '"><span id="syntax_' + str(num) + '"></span></code>',
+                data,
                 1
                 1
             )
             )
         else:
         else:
@@ -443,9 +443,9 @@ def namumark(conn, data, title, main_num, include_num):
 
 
     backlink = []
     backlink = []
     end_data = []
     end_data = []
-    
+
     include_num = include_num + '_' if include_num else ''
     include_num = include_num + '_' if include_num else ''
-    
+
     data = re.sub('<math>(?P<in>(?:(?!<\/math>).)+)<\/math>', '[math(\g<in>)]', data)
     data = re.sub('<math>(?P<in>(?:(?!<\/math>).)+)<\/math>', '[math(\g<in>)]', data)
 
 
     data = html.escape(data)
     data = html.escape(data)
@@ -457,9 +457,9 @@ def namumark(conn, data, title, main_num, include_num):
         math = math_re.search(data)
         math = math_re.search(data)
         if math:
         if math:
             math = math.groups()[0]
             math = math.groups()[0]
-            
+
             first += 1
             first += 1
-            
+
             data = math_re.sub('<span id="math_' + str(first) + '"></span>', data, 1)
             data = math_re.sub('<span id="math_' + str(first) + '"></span>', data, 1)
 
 
             plus_data += '''
             plus_data += '''
@@ -503,7 +503,7 @@ def namumark(conn, data, title, main_num, include_num):
         include = include_re.search(data)
         include = include_re.search(data)
         if include:
         if include:
             include = include.groups()[0]
             include = include.groups()[0]
-    
+
             include_data = re.search('^((?:(?!,).)+)', include)
             include_data = re.search('^((?:(?!,).)+)', include)
             if include_data:
             if include_data:
                 include_data = include_data.groups()[0]
                 include_data = include_data.groups()[0]
@@ -545,7 +545,7 @@ def namumark(conn, data, title, main_num, include_num):
 
 
     data = re.sub('\n##(((?!\n).)+)', '', data)
     data = re.sub('\n##(((?!\n).)+)', '', data)
     data = re.sub('<div id="wiki_div" style="">\n', '<div id="wiki_div" style="">', data)
     data = re.sub('<div id="wiki_div" style="">\n', '<div id="wiki_div" style="">', data)
-           
+
     while 1:
     while 1:
         wiki_table_data = re.search('<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div_1>).\n*)+)<\/div_1>', data)
         wiki_table_data = re.search('<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div_1>).\n*)+)<\/div_1>', data)
         if wiki_table_data:
         if wiki_table_data:
@@ -577,13 +577,13 @@ def namumark(conn, data, title, main_num, include_num):
     redirect = redirect_re.search(data)
     redirect = redirect_re.search(data)
     if redirect:
     if redirect:
         redirect = redirect.groups()[0]
         redirect = redirect.groups()[0]
-        
+
         return_link = tool.link_fix(redirect)
         return_link = tool.link_fix(redirect)
         main_link = return_link[0]
         main_link = return_link[0]
         other_link = return_link[1]
         other_link = return_link[1]
-        
+
         backlink += [[title, main_link + other_link, 'redirect']]
         backlink += [[title, main_link + other_link, 'redirect']]
-        
+
         data = redirect_re.sub(
         data = redirect_re.sub(
             '\n' + \
             '\n' + \
                 '<ul>' + \
                 '<ul>' + \
@@ -591,8 +591,8 @@ def namumark(conn, data, title, main_num, include_num):
                         '<a href="' + tool.url_pas(main_link) + other_link + '">' + main_link + other_link + '</a>' + \
                         '<a href="' + tool.url_pas(main_link) + other_link + '">' + main_link + other_link + '</a>' + \
                     '</li>' + \
                     '</li>' + \
                 '</ul>' + \
                 '</ul>' + \
-            '\n', 
-            data, 
+            '\n',
+            data,
             1
             1
         )
         )
 
 
@@ -605,7 +605,7 @@ def namumark(conn, data, title, main_num, include_num):
         data = no_toc_re.sub('', data)
         data = no_toc_re.sub('', data)
 
 
     data = '<div class="all_in_data" id="in_data_0">' + data
     data = '<div class="all_in_data" id="in_data_0">' + data
-        
+
     toc_full = 0
     toc_full = 0
     toc_top_stack = 6
     toc_top_stack = 6
     toc_stack = [0, 0, 0, 0, 0, 0]
     toc_stack = [0, 0, 0, 0, 0, 0]
@@ -615,7 +615,7 @@ def namumark(conn, data, title, main_num, include_num):
         toc = re.search('\n(={1,6}) ?((?:(?!\n).)+) ?(?:={1,6})\n', data)
         toc = re.search('\n(={1,6}) ?((?:(?!\n).)+) ?(?:={1,6})\n', data)
         if toc:
         if toc:
             toc = toc.groups()
             toc = toc.groups()
-            
+
             toc_number = len(toc[0])
             toc_number = len(toc[0])
             edit_number += 1
             edit_number += 1
 
 
@@ -625,8 +625,8 @@ def namumark(conn, data, title, main_num, include_num):
 
 
             if toc_top_stack > toc_number:
             if toc_top_stack > toc_number:
                 toc_top_stack = toc_number
                 toc_top_stack = toc_number
-                    
-            toc_full = toc_number        
+
+            toc_full = toc_number
             toc_stack[toc_number - 1] += 1
             toc_stack[toc_number - 1] += 1
             toc_number = str(toc_number)
             toc_number = str(toc_number)
             all_stack = ''
             all_stack = ''
@@ -647,13 +647,13 @@ def namumark(conn, data, title, main_num, include_num):
             new_toc_data = re.sub(' +$', '', new_toc_data)
             new_toc_data = re.sub(' +$', '', new_toc_data)
             if re.search('^# ?(?P<in>[^#]+) ?#$', new_toc_data):
             if re.search('^# ?(?P<in>[^#]+) ?#$', new_toc_data):
                 fol_head = '+'
                 fol_head = '+'
-                
+
                 new_toc_data = re.sub('^# ?(?P<in>[^#]+) ?#$', '\g<in>', new_toc_data)
                 new_toc_data = re.sub('^# ?(?P<in>[^#]+) ?#$', '\g<in>', new_toc_data)
             else:
             else:
                 fol_head = '-'
                 fol_head = '-'
-            
+
             data = re.sub(
             data = re.sub(
-                '\n(={1,6}) ?((?:(?!\n).)+) ?\n', 
+                '\n(={1,6}) ?((?:(?!\n).)+) ?\n',
                 '\n' + \
                 '\n' + \
                 '</div>'
                 '</div>'
                 '<h' + toc_number + ' id="s-' + all_stack + '">' + \
                 '<h' + toc_number + ' id="s-' + all_stack + '">' + \
@@ -668,14 +668,14 @@ def namumark(conn, data, title, main_num, include_num):
                 '</h' + toc_number + '>' + \
                 '</h' + toc_number + '>' + \
                 '<div class="all_in_data"' + (' style="display: none;"' if fol_head == '+' else '') + ' id="in_data_' + all_stack + '">' + \
                 '<div class="all_in_data"' + (' style="display: none;"' if fol_head == '+' else '') + ' id="in_data_' + all_stack + '">' + \
                     '\n',
                     '\n',
-                data, 
+                data,
                 1
                 1
             )
             )
 
 
             toc_main_data = new_toc_data
             toc_main_data = new_toc_data
             toc_main_data = re.sub('\[\*((?:(?! |\]).)*)(?: ((?:(?!(\[\*(?:(?:(?!\]).)+)\]|\])).)+))?\]', '', toc_main_data)
             toc_main_data = re.sub('\[\*((?:(?! |\]).)*)(?: ((?:(?!(\[\*(?:(?:(?!\]).)+)\]|\])).)+))?\]', '', toc_main_data)
             toc_main_data = re.sub('<span id="math_[0-9]"><\/span>', '(Math)', toc_main_data)
             toc_main_data = re.sub('<span id="math_[0-9]"><\/span>', '(Math)', toc_main_data)
-            
+
             toc_data += '' + \
             toc_data += '' + \
                 '<span style="margin-left: ' + str((toc_full - toc_top_stack) * 10) + 'px;">' + \
                 '<span style="margin-left: ' + str((toc_full - toc_top_stack) * 10) + 'px;">' + \
                     '<a href="#s-' + all_stack + '">' + all_stack + '.</a> ' + toc_main_data + \
                     '<a href="#s-' + all_stack + '">' + all_stack + '.</a> ' + toc_main_data + \
@@ -689,7 +689,7 @@ def namumark(conn, data, title, main_num, include_num):
     data = toc_re.sub(toc_data, data)
     data = toc_re.sub(toc_data, data)
 
 
     data = tool.savemark(data)
     data = tool.savemark(data)
-    
+
     data = re.sub("\[anchor\((?P<in>(?:(?!\)\]).)+)\)\]", '<span id="\g<in>"></span>', data, flags = re.I)
     data = re.sub("\[anchor\((?P<in>(?:(?!\)\]).)+)\)\]", '<span id="\g<in>"></span>', data, flags = re.I)
 
 
     ruby_all = re.findall("\[ruby\(((?:(?:(?!\)\]).)+))\)\]", data, flags = re.I)
     ruby_all = re.findall("\[ruby\(((?:(?:(?!\)\]).)+))\)\]", data, flags = re.I)
@@ -730,10 +730,10 @@ def namumark(conn, data, title, main_num, include_num):
 
 
     now_time = tool.get_time()
     now_time = tool.get_time()
     data = re.sub('\[date\]', now_time, data, flags = re.I)
     data = re.sub('\[date\]', now_time, data, flags = re.I)
-    
+
     time_data = re.search('^([0-9]{4}-[0-9]{2}-[0-9]{2})', now_time)
     time_data = re.search('^([0-9]{4}-[0-9]{2}-[0-9]{2})', now_time)
     time = time_data.groups()
     time = time_data.groups()
-    
+
     age_re = re.compile('\[age\(([0-9]{4}-[0-9]{2}-[0-9]{2})\)\]', re.I)
     age_re = re.compile('\[age\(([0-9]{4}-[0-9]{2}-[0-9]{2})\)\]', re.I)
     while 1:
     while 1:
         age_data = age_re.search(data)
         age_data = age_re.search(data)
@@ -742,9 +742,9 @@ def namumark(conn, data, title, main_num, include_num):
 
 
             old = datetime.datetime.strptime(time[0], '%Y-%m-%d')
             old = datetime.datetime.strptime(time[0], '%Y-%m-%d')
             will = datetime.datetime.strptime(age, '%Y-%m-%d')
             will = datetime.datetime.strptime(age, '%Y-%m-%d')
-            
+
             e_data = old - will
             e_data = old - will
-            
+
             data = age_re.sub(str(int(e_data.days / 365)), data, 1)
             data = age_re.sub(str(int(e_data.days / 365)), data, 1)
         else:
         else:
             break
             break
@@ -757,9 +757,9 @@ def namumark(conn, data, title, main_num, include_num):
 
 
             old = datetime.datetime.strptime(time[0], '%Y-%m-%d')
             old = datetime.datetime.strptime(time[0], '%Y-%m-%d')
             will = datetime.datetime.strptime(dday, '%Y-%m-%d')
             will = datetime.datetime.strptime(dday, '%Y-%m-%d')
-            
+
             e_data = old - will
             e_data = old - will
-            
+
             if re.search('^-', str(e_data.days)):
             if re.search('^-', str(e_data.days)):
                 e_day = str(e_data.days)
                 e_day = str(e_data.days)
             else:
             else:
@@ -776,7 +776,7 @@ def namumark(conn, data, title, main_num, include_num):
         video = video_re.search(data)
         video = video_re.search(data)
         if video:
         if video:
             video = video.groups()
             video = video.groups()
-            
+
             width = re.search(', ?width=((?:(?!,).)+)', video[1])
             width = re.search(', ?width=((?:(?!,).)+)', video[1])
             if width:
             if width:
                 video_width = width.groups()[0]
                 video_width = width.groups()[0]
@@ -784,12 +784,12 @@ def namumark(conn, data, title, main_num, include_num):
                     video_width += 'px'
                     video_width += 'px'
             else:
             else:
                 video_width = '560px'
                 video_width = '560px'
-            
+
             height = re.search(', ?height=((?:(?!,).)+)', video[1])
             height = re.search(', ?height=((?:(?!,).)+)', video[1])
             if height:
             if height:
                 video_height = height.groups()[0]
                 video_height = height.groups()[0]
                 if re.search('^[0-9]+$', video_height):
                 if re.search('^[0-9]+$', video_height):
-                    video_height += 'px'                
+                    video_height += 'px'
             else:
             else:
                 video_height = '315px'
                 video_height = '315px'
 
 
@@ -808,16 +808,16 @@ def namumark(conn, data, title, main_num, include_num):
 
 
                 video_code = re.sub('^https:\/\/www\.youtube\.com\/watch\?v=', '', video_code)
                 video_code = re.sub('^https:\/\/www\.youtube\.com\/watch\?v=', '', video_code)
                 video_code = re.sub('^https:\/\/youtu\.be\/', '', video_code)
                 video_code = re.sub('^https:\/\/youtu\.be\/', '', video_code)
-                
+
                 video_src = 'https://www.youtube.com/embed/' + video_code
                 video_src = 'https://www.youtube.com/embed/' + video_code
             elif kakaotv_re.search(video[0]):
             elif kakaotv_re.search(video[0]):
                 video_code = re.sub('^https:\/\/tv\.kakao\.com\/channel\/9262\/cliplink\/', '', video_code)
                 video_code = re.sub('^https:\/\/tv\.kakao\.com\/channel\/9262\/cliplink\/', '', video_code)
                 video_code = re.sub('^http:\/\/tv\.kakao\.com\/v\/', '', video_code)
                 video_code = re.sub('^http:\/\/tv\.kakao\.com\/v\/', '', video_code)
-                
+
                 video_src = 'https://tv.kakao.com/embed/player/cliplink/' + video_code +'?service=kakao_tv'
                 video_src = 'https://tv.kakao.com/embed/player/cliplink/' + video_code +'?service=kakao_tv'
             else:
             else:
                 video_src = 'https://embed.nicovideo.jp/watch/' + video_code
                 video_src = 'https://embed.nicovideo.jp/watch/' + video_code
-                
+
             data = video_re.sub('<iframe style="width: ' + video_width + '; height: ' + video_height + ';" src="' + video_src + video_start + '" allowfullscreen></iframe>', data, 1)
             data = video_re.sub('<iframe style="width: ' + video_width + '; height: ' + video_height + ';" src="' + video_src + video_start + '" allowfullscreen></iframe>', data, 1)
         else:
         else:
             break
             break
@@ -826,11 +826,11 @@ def namumark(conn, data, title, main_num, include_num):
         block = re.search('(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', data)
         block = re.search('(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', data)
         if block:
         if block:
             block = block.groups()[0]
             block = block.groups()[0]
-            
+
             block = re.sub('^\n&gt; ?', '', block)
             block = re.sub('^\n&gt; ?', '', block)
             block = re.sub('\n&gt; ?', '\n', block)
             block = re.sub('\n&gt; ?', '\n', block)
             block = re.sub('\n$', '', block)
             block = re.sub('\n$', '', block)
-            
+
             data = re.sub('(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', '\n<blockquote>' + block + '</blockquote>\n', data, 1)
             data = re.sub('(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', '\n<blockquote>' + block + '</blockquote>\n', data, 1)
         else:
         else:
             break
             break
@@ -873,9 +873,9 @@ def namumark(conn, data, title, main_num, include_num):
         indent = re.search('\n( +)', data)
         indent = re.search('\n( +)', data)
         if indent:
         if indent:
             indent = len(indent.groups()[0])
             indent = len(indent.groups()[0])
-            
+
             margin = '<span style="margin-left: 20px;"></span>' * indent
             margin = '<span style="margin-left: 20px;"></span>' * indent
-            
+
             data = re.sub('\n( +)', '\n' + margin, data, 1)
             data = re.sub('\n( +)', '\n' + margin, data, 1)
         else:
         else:
             break
             break
@@ -888,11 +888,11 @@ def namumark(conn, data, title, main_num, include_num):
         link = re.search('\[\[((?:(?!\[\[|\]\]).)+)\]\]', data)
         link = re.search('\[\[((?:(?!\[\[|\]\]).)+)\]\]', data)
         if link:
         if link:
             link = link.groups()[0]
             link = link.groups()[0]
-            
+
             link_split = re.search('((?:(?!\|).)+)(?:\|((?:(?!\|).)+))', link)
             link_split = re.search('((?:(?!\|).)+)(?:\|((?:(?!\|).)+))', link)
             if link_split:
             if link_split:
                 link_split = link_split.groups()
                 link_split = link_split.groups()
-                
+
                 main_link = link_split[0]
                 main_link = link_split[0]
                 see_link = link_split[1]
                 see_link = link_split[1]
             else:
             else:
@@ -909,7 +909,7 @@ def namumark(conn, data, title, main_num, include_num):
                         file_style += 'width: ' + file_width + ';'
                         file_style += 'width: ' + file_width + ';'
                     else:
                     else:
                         file_style += 'width: ' + file_width + 'px;'
                         file_style += 'width: ' + file_width + 'px;'
-                
+
                 file_height = re.search('height=((?:(?!&).)+)', see_link)
                 file_height = re.search('height=((?:(?!&).)+)', see_link)
                 if file_height:
                 if file_height:
                     file_height = file_height.groups()[0]
                     file_height = file_height.groups()[0]
@@ -936,7 +936,7 @@ def namumark(conn, data, title, main_num, include_num):
 
 
                 if re.search('^(?:out|외부):', main_link):
                 if re.search('^(?:out|외부):', main_link):
                     file_src = re.sub('^(?:out|외부):', '', main_link)
                     file_src = re.sub('^(?:out|외부):', '', main_link)
-            
+
                     file_alt = main_link
                     file_alt = main_link
                     exist = 'Yes'
                     exist = 'Yes'
                 else:
                 else:
@@ -957,45 +957,45 @@ def namumark(conn, data, title, main_num, include_num):
 
 
                     curs.execute(tool.db_change("select title from data where title = ?"), [file_alt])
                     curs.execute(tool.db_change("select title from data where title = ?"), [file_alt])
                     exist = curs.fetchall()
                     exist = curs.fetchall()
-                
+
                 if exist:
                 if exist:
                     data = re.sub(
                     data = re.sub(
-                        '\[\[((?:(?!\[\[|\]\]).)+)\]\]', 
+                        '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
                         '<span style="' + file_align + '">' + \
                         '<span style="' + file_align + '">' + \
                             '<span style="' + file_color + '">' + \
                             '<span style="' + file_color + '">' + \
                                 '<img style="' + file_style + '" alt="' + file_alt + '" src="' + file_src + '">' + \
                                 '<img style="' + file_style + '" alt="' + file_alt + '" src="' + file_src + '">' + \
                             '</span>' + \
                             '</span>' + \
-                        '</span>', 
-                        data, 
+                        '</span>',
+                        data,
                         1
                         1
                     )
                     )
                 else:
                 else:
                     data = re.sub(
                     data = re.sub(
-                        '\[\[((?:(?!\[\[|\]\]).)+)\]\]', 
-                        '<a id="not_thing" href="/upload?name=' + tool.url_pas(file_name) + '">' + file_alt + '</a>', 
-                        data, 
+                        '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
+                        '<a id="not_thing" href="/upload?name=' + tool.url_pas(file_name) + '">' + file_alt + '</a>',
+                        data,
                         1
                         1
                     )
                     )
             elif category_re.search(main_link):
             elif category_re.search(main_link):
                 main_link = category_re.sub('category:', main_link)
                 main_link = category_re.sub('category:', main_link)
-                
+
                 if re.search('#blur', main_link):
                 if re.search('#blur', main_link):
                     see_link = 'Hidden'
                     see_link = 'Hidden'
                     link_id = 'id="inside"'
                     link_id = 'id="inside"'
-                    
+
                     main_link = re.sub('#blur', '', main_link)
                     main_link = re.sub('#blur', '', main_link)
                 else:
                 else:
                     link_id = ''
                     link_id = ''
 
 
                 backlink += [[title, main_link, 'cat']]
                 backlink += [[title, main_link, 'cat']]
                 category += '<a ' + link_id + ' href="' + tool.url_pas(main_link) + '">' + category_re.sub('', see_link) + '</a> | '
                 category += '<a ' + link_id + ' href="' + tool.url_pas(main_link) + '">' + category_re.sub('', see_link) + '</a> | '
-                
+
                 data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', '', data, 1)
                 data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', '', data, 1)
             elif re.search('^wiki:', main_link):
             elif re.search('^wiki:', main_link):
                 data = re.sub(
                 data = re.sub(
-                    '\[\[((?:(?!\[\[|\]\]).)+)\]\]', 
-                    '<a id="inside" href="/' + tool.url_pas(re.sub('^wiki:', '', main_link)) + '">' + see_link + '</a>', 
-                    data, 
+                    '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
+                    '<a id="inside" href="/' + tool.url_pas(re.sub('^wiki:', '', main_link)) + '">' + see_link + '</a>',
+                    data,
                     1
                     1
                 )
                 )
             elif re.search('^inter:((?:(?!:).)+):', main_link):
             elif re.search('^inter:((?:(?!:).)+):', main_link):
@@ -1014,14 +1014,14 @@ def namumark(conn, data, title, main_num, include_num):
                         data = re.sub(
                         data = re.sub(
                             '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
                             '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
                             '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_view + see_link + '</a>',
                             '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_view + see_link + '</a>',
-                            data, 
+                            data,
                             1
                             1
                         )
                         )
                     else:
                     else:
                         data = re.sub(
                         data = re.sub(
                             '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
                             '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
-                            '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_view + inter_data[1] + '</a>', 
-                            data, 
+                            '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_view + inter_data[1] + '</a>',
+                            data,
                             1
                             1
                         )
                         )
                 else:
                 else:
@@ -1047,7 +1047,7 @@ def namumark(conn, data, title, main_num, include_num):
                     main_link = re.sub('\.\.\/\/', '/', main_link)
                     main_link = re.sub('\.\.\/\/', '/', main_link)
                 elif re.search('^\.\.\/', main_link):
                 elif re.search('^\.\.\/', main_link):
                     main_link = re.sub('^\.\.\/', re.sub('(?P<in>.+)\/.*$', '\g<in>', title), main_link)
                     main_link = re.sub('^\.\.\/', re.sub('(?P<in>.+)\/.*$', '\g<in>', title), main_link)
-                
+
                 if not re.search('^\|', main_link):
                 if not re.search('^\|', main_link):
                     if main_link != title:
                     if main_link != title:
                         if main_link != '':
                         if main_link != '':
@@ -1058,31 +1058,31 @@ def namumark(conn, data, title, main_num, include_num):
                                 backlink += [[title, main_link, 'no']]
                                 backlink += [[title, main_link, 'no']]
                             else:
                             else:
                                 link_id = ''
                                 link_id = ''
-                        
+
                             backlink += [[title, main_link, '']]
                             backlink += [[title, main_link, '']]
-                            
+
                             data = re.sub(
                             data = re.sub(
-                                '\[\[((?:(?!\[\[|\]\]).)+)\]\]', 
+                                '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
                                 '<a ' + link_id + ' ' + \
                                 '<a ' + link_id + ' ' + \
                                     'title="' + main_link + other_link + '" ' + \
                                     'title="' + main_link + other_link + '" ' + \
                                     'href="/w/' + tool.url_pas(main_link) + other_link + '"' + \
                                     'href="/w/' + tool.url_pas(main_link) + other_link + '"' + \
-                                '>' + see_link + '</a>', 
-                                data, 
+                                '>' + see_link + '</a>',
+                                data,
                                 1
                                 1
                             )
                             )
                         else:
                         else:
                             data = re.sub(
                             data = re.sub(
-                                '\[\[((?:(?!\[\[|\]\]).)+)\]\]', 
-                                '<a title="' + other_link + '" href="' + other_link + '">' + see_link + '</a>', 
-                                data, 
+                                '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
+                                '<a title="' + other_link + '" href="' + other_link + '">' + see_link + '</a>',
+                                data,
                                 1
                                 1
                             )
                             )
                     else:
                     else:
                         if re.search('^#', other_link):
                         if re.search('^#', other_link):
                             data = re.sub(
                             data = re.sub(
-                                '\[\[((?:(?!\[\[|\]\]).)+)\]\]', 
-                                '<a title="' + other_link + '" href="' + other_link + '">' + other_link + '</a>', 
-                                data, 
+                                '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
+                                '<a title="' + other_link + '" href="' + other_link + '">' + other_link + '</a>',
+                                data,
                                 1
                                 1
                             )
                             )
                         else:
                         else:
@@ -1094,15 +1094,15 @@ def namumark(conn, data, title, main_num, include_num):
 
 
     br_re = re.compile('\[br\]', re.I)
     br_re = re.compile('\[br\]', re.I)
     data = br_re.sub('<br>', data)
     data = br_re.sub('<br>', data)
-            
+
     footnote_number = 0
     footnote_number = 0
-    
+
     footnote_all = []
     footnote_all = []
     footnote_dict = {}
     footnote_dict = {}
     footnote_re = {}
     footnote_re = {}
-    
+
     footdata_all = '<hr><ul id="footnote_data">'
     footdata_all = '<hr><ul id="footnote_data">'
-    
+
     re_footnote = re.compile('(?:\[\*((?:(?! |\]).)*)(?: ((?:(?!(?:\[\*|\])).)+))?\]|(\[(?:각주|footnote)\]))')
     re_footnote = re.compile('(?:\[\*((?:(?! |\]).)*)(?: ((?:(?!(?:\[\*|\])).)+))?\]|(\[(?:각주|footnote)\]))')
     while 1:
     while 1:
         footnote = re_footnote.search(data)
         footnote = re_footnote.search(data)
@@ -1110,7 +1110,7 @@ def namumark(conn, data, title, main_num, include_num):
             footnote_data = footnote.groups()
             footnote_data = footnote.groups()
             if footnote_data[2]:
             if footnote_data[2]:
                 footnote_all.sort()
                 footnote_all.sort()
-                
+
                 for footdata in footnote_all:
                 for footdata in footnote_all:
                     if footdata[2] == 0:
                     if footdata[2] == 0:
                         footdata_in = ''
                         footdata_in = ''
@@ -1126,9 +1126,9 @@ def namumark(conn, data, title, main_num, include_num):
                             '</a> <span id="' + include_num + 'fn-' + str(footdata[0]) + '">' + footdata_in + '</span>' + \
                             '</a> <span id="' + include_num + 'fn-' + str(footdata[0]) + '">' + footdata_in + '</span>' + \
                         '</li>' + \
                         '</li>' + \
                     ''
                     ''
-                
+
                 data = re_footnote.sub(footdata_all + '</ul>', data, 1)
                 data = re_footnote.sub(footdata_all + '</ul>', data, 1)
-                
+
                 footnote_all = []
                 footnote_all = []
                 footdata_all = '<hr><ul id="footnote_data">'
                 footdata_all = '<hr><ul id="footnote_data">'
             else:
             else:
@@ -1168,7 +1168,7 @@ def namumark(conn, data, title, main_num, include_num):
                         footnote_re[footnote_name] += 1
                         footnote_re[footnote_name] += 1
 
 
                     footnote_all += [[footnote_number, footnote_name, footnote]]
                     footnote_all += [[footnote_number, footnote_name, footnote]]
-                    
+
                     data = re_footnote.sub('' + \
                     data = re_footnote.sub('' + \
                         '<sup>' + \
                         '<sup>' + \
                             '<a href="#' + include_num + 'fn-' + str(footnote_number) + '" ' + \
                             '<a href="#' + include_num + 'fn-' + str(footnote_number) + '" ' + \
@@ -1215,7 +1215,7 @@ def namumark(conn, data, title, main_num, include_num):
         category = ''
         category = ''
 
 
     data += category
     data += category
-    
+
     i = 0
     i = 0
     while 1:
     while 1:
         try:
         try:
@@ -1262,7 +1262,7 @@ def namumark(conn, data, title, main_num, include_num):
                     j += 1
                     j += 1
 
 
             i += 1
             i += 1
-    
+
     data = re.sub('<\/td_1>', '</td>', data)
     data = re.sub('<\/td_1>', '</td>', data)
     data = re.sub('<\/ul>\n?', '</ul>', data)
     data = re.sub('<\/ul>\n?', '</ul>', data)
     data = re.sub('<\/pre>\n?', '</pre>', data)
     data = re.sub('<\/pre>\n?', '</pre>', data)
@@ -1277,7 +1277,7 @@ def namumark(conn, data, title, main_num, include_num):
     data = re.sub('<\/ul>\n<ul>', '</ul><ul>', data)
     data = re.sub('<\/ul>\n<ul>', '</ul><ul>', data)
     data = re.sub('\n<\/ul>', '</ul>', data)
     data = re.sub('\n<\/ul>', '</ul>', data)
     data = re.sub('\n', '<br>', data)
     data = re.sub('\n', '<br>', data)
-        
+
     plus_data = '<script>render_html("' + include_num + 'render_contect");</script>' + plus_data
     plus_data = '<script>render_html("' + include_num + 'render_contect");</script>' + plus_data
 
 
     return [data, plus_data, backlink]
     return [data, plus_data, backlink]

+ 8 - 8
route/tool/set_mark/tool.py

@@ -19,7 +19,7 @@ def db_change(data):
         data = data.replace('?', '%s')
         data = data.replace('?', '%s')
 
 
     return data
     return data
-    
+
 def ip_check(d_type = 0):
 def ip_check(d_type = 0):
     if d_type == 0:
     if d_type == 0:
         if flask.session and ('state' and 'id') in flask.session:
         if flask.session and ('state' and 'id') in flask.session:
@@ -27,7 +27,7 @@ def ip_check(d_type = 0):
         else:
         else:
             try:
             try:
                 ip = flask.request.environ.get('HTTP_X_REAL_IP', flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr))
                 ip = flask.request.environ.get('HTTP_X_REAL_IP', flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr))
-                
+
                 if ip == '::1' or ip == '127.0.0.1':
                 if ip == '::1' or ip == '127.0.0.1':
                     ip = flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr)
                     ip = flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr)
             except:
             except:
@@ -35,14 +35,14 @@ def ip_check(d_type = 0):
     else:
     else:
         try:
         try:
             ip = flask.request.environ.get('HTTP_X_REAL_IP', flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr))
             ip = flask.request.environ.get('HTTP_X_REAL_IP', flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr))
-            
+
             if ip == '::1' or ip == '127.0.0.1':
             if ip == '::1' or ip == '127.0.0.1':
                 ip = flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr)
                 ip = flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr)
         except:
         except:
             ip = '-'
             ip = '-'
-            
+
     return str(ip)
     return str(ip)
-    
+
 def link_fix(main_link):
 def link_fix(main_link):
     if re.search('^:', main_link):
     if re.search('^:', main_link):
         main_link = re.sub('^:', '', main_link)
         main_link = re.sub('^:', '', main_link)
@@ -60,18 +60,18 @@ def link_fix(main_link):
         other_link = ''
         other_link = ''
 
 
     main_link = re.sub('\\\\#', '%23', main_link)
     main_link = re.sub('\\\\#', '%23', main_link)
-        
+
     return [main_link, other_link]
     return [main_link, other_link]
 
 
 def savemark(data):
 def savemark(data):
     data = re.sub("\[date\(now\)\]", get_time(), data)
     data = re.sub("\[date\(now\)\]", get_time(), data)
-    
+
     ip = ip_check()
     ip = ip_check()
     if not re.search("\.", ip):
     if not re.search("\.", ip):
         name = '[[user:' + ip + '|' + ip + ']]'
         name = '[[user:' + ip + '|' + ip + ']]'
     else:
     else:
         name = ip
         name = ip
-        
+
     data = re.sub("\[name\]", name, data)
     data = re.sub("\[name\]", name, data)
 
 
     return data
     return data

+ 18 - 18
route/topic.py

@@ -18,7 +18,7 @@ def topic_2(conn, topic_num):
     topic_exist = curs.fetchall()
     topic_exist = curs.fetchall()
     if not topic_exist and len(sub) > 256:
     if not topic_exist and len(sub) > 256:
         return re_error('/error/11')
         return re_error('/error/11')
-    
+
     if flask.request.method == 'POST':
     if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')
             return re_error('/error/13')
@@ -27,10 +27,10 @@ def topic_2(conn, topic_num):
 
 
         ip = ip_check()
         ip = ip_check()
         today = get_time()
         today = get_time()
-        
+
         if ban == 1:
         if ban == 1:
             return re_error('/ban')
             return re_error('/ban')
-        
+
         curs.execute(db_change("select id from topic where title = ? and sub = ? order by id + 0 desc limit 1"), [name, sub])
         curs.execute(db_change("select id from topic where title = ? and sub = ? order by id + 0 desc limit 1"), [name, sub])
         old_num = curs.fetchall()
         old_num = curs.fetchall()
         if old_num:
         if old_num:
@@ -59,43 +59,43 @@ def topic_2(conn, topic_num):
 
 
             if y_check == 1:
             if y_check == 1:
                 curs.execute(db_change('insert into alarm (name, data, date) values (?, ?, ?)'), [
                 curs.execute(db_change('insert into alarm (name, data, date) values (?, ?, ?)'), [
-                    match.groups()[0], 
-                    ip + ' | <a href="/thread/' + str(topic_num) + '#' + str(num) + '">' + name + ' | ' + sub + ' | #' + str(num) + '</a>', 
+                    match.groups()[0],
+                    ip + ' | <a href="/thread/' + str(topic_num) + '#' + str(num) + '">' + name + ' | ' + sub + ' | #' + str(num) + '</a>',
                     today
                     today
                 ])
                 ])
-        
+
         cate_re = re.compile('\[\[((?:분류|category):(?:(?:(?!\]\]).)*))\]\]', re.I)
         cate_re = re.compile('\[\[((?:분류|category):(?:(?:(?!\]\]).)*))\]\]', re.I)
         data = cate_re.sub('[br]', flask.request.form.get('content', 'Test'))
         data = cate_re.sub('[br]', flask.request.form.get('content', 'Test'))
-        
+
         for rd_data in re.findall("(?:#([0-9]+))", data):
         for rd_data in re.findall("(?:#([0-9]+))", data):
             curs.execute(db_change("select ip from topic where title = ? and sub = ? and id = ?"), [name, sub, rd_data])
             curs.execute(db_change("select ip from topic where title = ? and sub = ? and id = ?"), [name, sub, rd_data])
             ip_data = curs.fetchall()
             ip_data = curs.fetchall()
             if ip_data and ip_or_user(ip_data[0][0]) == 0:
             if ip_data and ip_or_user(ip_data[0][0]) == 0:
                 curs.execute(db_change('insert into alarm (name, data, date) values (?, ?, ?)'), [
                 curs.execute(db_change('insert into alarm (name, data, date) values (?, ?, ?)'), [
-                    ip_data[0][0], 
-                    ip + ' | <a href="/thread/' + str(topic_num) + '#' + str(num) + '">' + name + ' | ' + sub + ' | #' + str(num) + '</a>', 
+                    ip_data[0][0],
+                    ip + ' | <a href="/thread/' + str(topic_num) + '#' + str(num) + '">' + name + ' | ' + sub + ' | #' + str(num) + '</a>',
                     today
                     today
                 ])
                 ])
-            
+
         data = re.sub("(?P<in>#(?:[0-9]+))", '[[\g<in>]]', data)
         data = re.sub("(?P<in>#(?:[0-9]+))", '[[\g<in>]]', data)
         data = savemark(data)
         data = savemark(data)
 
 
         rd_plus(name, sub, today)
         rd_plus(name, sub, today)
         curs.execute(db_change("insert into topic (id, title, sub, data, date, ip, block, top, code) values (?, ?, ?, ?, ?, ?, '', '', ?)"), [
         curs.execute(db_change("insert into topic (id, title, sub, data, date, ip, block, top, code) values (?, ?, ?, ?, ?, ?, '', '', ?)"), [
-            str(num), 
-            name, 
-            sub, 
-            data, 
-            today, 
+            str(num),
+            name,
+            sub,
+            data,
+            today,
             ip,
             ip,
             str(topic_num) if num == 1 else ''
             str(topic_num) if num == 1 else ''
         ])
         ])
         conn.commit()
         conn.commit()
-        
+
         return redirect('/thread/' + str(topic_num))
         return redirect('/thread/' + str(topic_num))
     else:
     else:
         data = ''
         data = ''
-    
+
         curs.execute(db_change("select stop from rd where title = ? and sub = ? and stop != ''"), [name, sub])
         curs.execute(db_change("select stop from rd where title = ? and sub = ? and stop != ''"), [name, sub])
         close_data = curs.fetchall()
         close_data = curs.fetchall()
         if (close_data and admin != 1) or ban == 1:
         if (close_data and admin != 1) or ban == 1:
@@ -123,7 +123,7 @@ def topic_2(conn, topic_num):
             <div id="see_preview"></div>
             <div id="see_preview"></div>
         '''
         '''
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('discussion') + ')', 0])],
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('discussion') + ')', 0])],
             data = '''
             data = '''
                 <h2 id="topic_top_title">''' + sub + '''</h2>
                 <h2 id="topic_top_title">''' + sub + '''</h2>

+ 2 - 2
route/topic_admin.py

@@ -33,7 +33,7 @@ def topic_admin_2(conn, topic_num, num):
 
 
         curs.execute(db_change("select end from ban where block = ?"), [data[0][1]])
         curs.execute(db_change("select end from ban where block = ?"), [data[0][1]])
         user_ban_d = curs.fetchall()
         user_ban_d = curs.fetchall()
-        
+
         ban += '''
         ban += '''
             <br>
             <br>
             <h2>''' + load_lang('admin_tool') + '''</h2>
             <h2>''' + load_lang('admin_tool') + '''</h2>
@@ -56,7 +56,7 @@ def topic_admin_2(conn, topic_num, num):
             </ul>
             </ul>
         '''
         '''
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('discussion_tool'), wiki_set(), custom(), other2([' (#' + str(num) + ')', 0])],
         imp = [load_lang('discussion_tool'), wiki_set(), custom(), other2([' (#' + str(num) + ')', 0])],
         data = ban,
         data = ban,
         menu = [['thread/' + str(topic_num) + '#' + str(num), load_lang('return')]]
         menu = [['thread/' + str(topic_num) + '#' + str(num), load_lang('return')]]

+ 3 - 3
route/topic_block.py

@@ -17,9 +17,9 @@ def topic_block_2(conn, topic_num, num):
             curs.execute(db_change("update topic set block = '' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
             curs.execute(db_change("update topic set block = '' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
         else:
         else:
             curs.execute(db_change("update topic set block = 'O' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
             curs.execute(db_change("update topic set block = 'O' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
-        
+
         rd_plus(name, sub, get_time())
         rd_plus(name, sub, get_time())
-        
+
         conn.commit()
         conn.commit()
-        
+
     return redirect('/thread/' + str(topic_num) + '#' + str(num))
     return redirect('/thread/' + str(topic_num) + '#' + str(num))

+ 14 - 14
route/topic_close_list.py

@@ -2,22 +2,22 @@ from .tool.func import *
 
 
 def topic_close_list_2(conn, name):
 def topic_close_list_2(conn, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     div = ''
     div = ''
     tool = flask.request.args.get('tool', '')
     tool = flask.request.args.get('tool', '')
 
 
     plus = ''
     plus = ''
     menu = [['topic/' + url_pas(name), load_lang('return')]]
     menu = [['topic/' + url_pas(name), load_lang('return')]]
-    
+
     if tool == 'close':
     if tool == 'close':
         curs.execute(db_change("select sub from rd where title = ? and stop = 'O' order by sub asc"), [name])
         curs.execute(db_change("select sub from rd where title = ? and stop = 'O' order by sub asc"), [name])
-        
+
         sub = load_lang('closed_discussion')
         sub = load_lang('closed_discussion')
     elif tool == 'agree':
     elif tool == 'agree':
         curs.execute(db_change("select sub from rd where title = ? and agree = 'O' order by sub asc"), [name])
         curs.execute(db_change("select sub from rd where title = ? and agree = 'O' order by sub asc"), [name])
-        
+
         sub = load_lang('agreed_discussion')
         sub = load_lang('agreed_discussion')
-    else:        
+    else:
         sub = load_lang('discussion_list')
         sub = load_lang('discussion_list')
         menu = [['w/' + url_pas(name), load_lang('document')]]
         menu = [['w/' + url_pas(name), load_lang('document')]]
 
 
@@ -32,7 +32,7 @@ def topic_close_list_2(conn, name):
             topic_num = str(int(t_data[0][0]) + 1)
             topic_num = str(int(t_data[0][0]) + 1)
         else:
         else:
             topic_num = '1'
             topic_num = '1'
-        
+
         plus = '''
         plus = '''
             <a href="/topic/''' + url_pas(name) + '?tool=close">(' + load_lang('closed_discussion') + ')</a> <a href="/topic/' + url_pas(name) + '?tool=agree">(' + load_lang('agreed_discussion') + ''')</a>
             <a href="/topic/''' + url_pas(name) + '?tool=close">(' + load_lang('closed_discussion') + ')</a> <a href="/topic/' + url_pas(name) + '?tool=agree">(' + load_lang('agreed_discussion') + ''')</a>
             <hr class=\"main_hr\">
             <hr class=\"main_hr\">
@@ -55,21 +55,21 @@ def topic_close_list_2(conn, name):
     t_num = 0
     t_num = 0
     for data in curs.fetchall():
     for data in curs.fetchall():
         t_num += 1
         t_num += 1
-        
+
         curs.execute(db_change("select code from topic where title = ? and sub = ? and id = '1'"), [name, data[0]])
         curs.execute(db_change("select code from topic where title = ? and sub = ? and id = '1'"), [name, data[0]])
         first_topic = curs.fetchall()
         first_topic = curs.fetchall()
-        if first_topic:                
+        if first_topic:
             it_p = 0
             it_p = 0
-            
+
             if tool == '':
             if tool == '':
                 curs.execute(db_change("select title from rd where title = ? and sub = ? and stop = 'O' order by sub asc"), [name, data[0]])
                 curs.execute(db_change("select title from rd where title = ? and sub = ? and stop = 'O' order by sub asc"), [name, data[0]])
                 if curs.fetchall():
                 if curs.fetchall():
                     it_p = 1
                     it_p = 1
-            
+
             if it_p != 1:
             if it_p != 1:
                 curs.execute(db_change("select id from topic where title = ? and sub = ? order by date desc limit 1"), [name, data[0]])
                 curs.execute(db_change("select id from topic where title = ? and sub = ? order by date desc limit 1"), [name, data[0]])
                 t_data = curs.fetchall()
                 t_data = curs.fetchall()
-            
+
                 div += '''
                 div += '''
                     <h2><a href="/thread/''' + first_topic[0][0] + '">' + str(t_num) + '. ' + data[0] + '''</a></h2>
                     <h2><a href="/thread/''' + first_topic[0][0] + '">' + str(t_num) + '. ' + data[0] + '''</a></h2>
                     <div id="topic_pre_''' + str(t_num) + '''"></div>
                     <div id="topic_pre_''' + str(t_num) + '''"></div>
@@ -81,11 +81,11 @@ def topic_close_list_2(conn, name):
                         }
                         }
                     </script>
                     </script>
                 '''
                 '''
-                
+
     if div == '':
     if div == '':
         plus = re.sub('^<br>', '', plus)
         plus = re.sub('^<br>', '', plus)
-    
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],
         imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],
         data = div + plus,
         data = div + plus,
         menu = menu
         menu = menu

+ 1 - 1
route/topic_delete.py

@@ -15,7 +15,7 @@ def topic_delete_2(conn, topic_num):
         curs.execute(db_change("delete from rd where title = ? and sub = ?"), [name, sub])
         curs.execute(db_change("delete from rd where title = ? and sub = ?"), [name, sub])
         conn.commit()
         conn.commit()
 
 
-        return redirect('/topic/' + url_pas(name))    
+        return redirect('/topic/' + url_pas(name))
     else:
     else:
         return easy_minify(flask.render_template(skin_check(),
         return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('topic_delete'), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang('topic_delete'), wiki_set(), custom(), other2([0, 0])],

+ 7 - 7
route/topic_stop.py

@@ -24,7 +24,7 @@ def topic_stop_2(conn, topic_num):
             curs.execute(db_change("update rd set stop = ?, agree = ? where title = ? and sub = ?"), [
             curs.execute(db_change("update rd set stop = ?, agree = ? where title = ? and sub = ?"), [
                 stop_d,
                 stop_d,
                 agree_d,
                 agree_d,
-                name, 
+                name,
                 sub
                 sub
             ])
             ])
 
 
@@ -36,17 +36,17 @@ def topic_stop_2(conn, topic_num):
                 t_state = 'Normal'
                 t_state = 'Normal'
 
 
             curs.execute(db_change("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')"), [
             curs.execute(db_change("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')"), [
-                str(int(topic_check[0][0]) + 1), 
-                name, 
-                sub, 
-                t_state + (' (Agree)' if agree_d != '' else '') + (('[br][br]Why : ' + why_d) if why_d else ''), 
-                time, 
+                str(int(topic_check[0][0]) + 1),
+                name,
+                sub,
+                t_state + (' (Agree)' if agree_d != '' else '') + (('[br][br]Why : ' + why_d) if why_d else ''),
+                time,
                 ip
                 ip
             ])
             ])
 
 
             rd_plus(name, sub, time)
             rd_plus(name, sub, time)
 
 
-        return redirect('/thread/' + str(topic_num))    
+        return redirect('/thread/' + str(topic_num))
     else:
     else:
         stop_d_list = ''
         stop_d_list = ''
         agree_check = ''
         agree_check = ''

+ 2 - 2
route/topic_tool.py

@@ -35,7 +35,7 @@ def topic_tool_2(conn, topic_num):
             <li>''' + load_lang('topic_state') + ''' : ''' + t_state + '' + (' (Agree)' if close_data and (close_data[0][1] == 'O') else '') + '''</li>
             <li>''' + load_lang('topic_state') + ''' : ''' + t_state + '' + (' (Agree)' if close_data and (close_data[0][1] == 'O') else '') + '''</li>
         </ul>
         </ul>
     '''
     '''
-    
+
     if admin_check(None) == 1:
     if admin_check(None) == 1:
         data += '''
         data += '''
             <h2>''' + load_lang('owner') + '''</h2>
             <h2>''' + load_lang('owner') + '''</h2>
@@ -48,7 +48,7 @@ def topic_tool_2(conn, topic_num):
             </ul>
             </ul>
         '''
         '''
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('topic_tool'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('topic_tool'), wiki_set(), custom(), other2([0, 0])],
         data = data,
         data = data,
         menu = [['thread/' + str(topic_num), load_lang('return')]]
         menu = [['thread/' + str(topic_num), load_lang('return')]]

+ 3 - 3
route/topic_top.py

@@ -6,7 +6,7 @@ def topic_top_2(conn, topic_num, num):
     topic_change_data = topic_change(topic_num)
     topic_change_data = topic_change(topic_num)
     name = topic_change_data[0]
     name = topic_change_data[0]
     sub = topic_change_data[1]
     sub = topic_change_data[1]
-    
+
     if admin_check(3, 'notice (' + name + ' - ' + sub + '#' + str(num) + ')') != 1:
     if admin_check(3, 'notice (' + name + ' - ' + sub + '#' + str(num) + ')') != 1:
         return re_error('/error/3')
         return re_error('/error/3')
 
 
@@ -19,9 +19,9 @@ def topic_top_2(conn, topic_num, num):
                 curs.execute(db_change("update topic set top = '' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
                 curs.execute(db_change("update topic set top = '' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
             else:
             else:
                 curs.execute(db_change("update topic set top = 'O' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
                 curs.execute(db_change("update topic set top = 'O' where title = ? and sub = ? and id = ?"), [name, sub, str(num)])
-        
+
         rd_plus(name, sub, get_time())
         rd_plus(name, sub, get_time())
 
 
         conn.commit()
         conn.commit()
 
 
-    return redirect('/thread/' + str(topic_num) + '#' + str(num))        
+    return redirect('/thread/' + str(topic_num) + '#' + str(num))

+ 1 - 1
route/user_count_edit.py

@@ -22,7 +22,7 @@ def user_count_edit_2(conn, name):
     else:
     else:
         t_data = 0
         t_data = 0
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('count'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('count'), wiki_set(), custom(), other2([0, 0])],
         data =  '''
         data =  '''
                 <ul>
                 <ul>

+ 3 - 3
route/user_custom_head_view.py

@@ -12,7 +12,7 @@ def user_custom_head_view_2(conn):
                 curs.execute(db_change("update custom set css = ? where user = ?"), [flask.request.form.get('content', None), ip + ' (head)'])
                 curs.execute(db_change("update custom set css = ? where user = ?"), [flask.request.form.get('content', None), ip + ' (head)'])
             else:
             else:
                 curs.execute(db_change("insert into custom (user, css) values (?, ?)"), [ip + ' (head)', flask.request.form.get('content', None)])
                 curs.execute(db_change("insert into custom (user, css) values (?, ?)"), [ip + ' (head)', flask.request.form.get('content', None)])
-            
+
             conn.commit()
             conn.commit()
 
 
         flask.session['head'] = flask.request.form.get('content', None)
         flask.session['head'] = flask.request.form.get('content', None)
@@ -30,7 +30,7 @@ def user_custom_head_view_2(conn):
                 data = ''
                 data = ''
         else:
         else:
             start = '<span>' + load_lang('user_head_warring') + '</span><hr class=\"main_hr\">'
             start = '<span>' + load_lang('user_head_warring') + '</span><hr class=\"main_hr\">'
-            
+
             if 'head' in flask.session:
             if 'head' in flask.session:
                 data = flask.session['head']
                 data = flask.session['head']
             else:
             else:
@@ -38,7 +38,7 @@ def user_custom_head_view_2(conn):
 
 
         start += '<span>&lt;style&gt;CSS&lt;/style&gt;<br>&lt;script&gt;JS&lt;/script&gt;</span><hr class=\"main_hr\">'
         start += '<span>&lt;style&gt;CSS&lt;/style&gt;<br>&lt;script&gt;JS&lt;/script&gt;</span><hr class=\"main_hr\">'
 
 
-        return easy_minify(flask.render_template(skin_check(), 
+        return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang(data = 'user_head', safe = 1), wiki_set(), custom(), other2([0, 0])],
             imp = [load_lang(data = 'user_head', safe = 1), wiki_set(), custom(), other2([0, 0])],
             data =  start + '''
             data =  start + '''
                     <form method="post">
                     <form method="post">

+ 3 - 3
route/user_info.py

@@ -12,7 +12,7 @@ def user_info_2(conn):
     else:
     else:
         plus2 = '<li><a href="/alarm">' + load_lang('alarm') + ' (0)</a></li>'
         plus2 = '<li><a href="/alarm">' + load_lang('alarm') + ' (0)</a></li>'
 
 
-    if ip_or_user(ip) == 0:  
+    if ip_or_user(ip) == 0:
         plus = '''
         plus = '''
             <li><a href="/logout">''' + load_lang('logout') + '''</a></li>
             <li><a href="/logout">''' + load_lang('logout') + '''</a></li>
             <li><a href="/change">''' + load_lang('user_setting') + '''</a></li>
             <li><a href="/change">''' + load_lang('user_setting') + '''</a></li>
@@ -20,7 +20,7 @@ def user_info_2(conn):
 
 
         plus2 += '<li><a href="/watch_list">' + load_lang('watchlist') + '</a></li>'
         plus2 += '<li><a href="/watch_list">' + load_lang('watchlist') + '</a></li>'
         plus3 = '<li><a href="/acl/user:' + url_pas(ip) + '">' + load_lang('user_document_acl') + '</a></li>'
         plus3 = '<li><a href="/acl/user:' + url_pas(ip) + '">' + load_lang('user_document_acl') + '</a></li>'
-    else:        
+    else:
         plus = '''
         plus = '''
             <li><a href="/login">''' + load_lang('login') + '''</a></li>
             <li><a href="/login">''' + load_lang('login') + '''</a></li>
             <li><a href="/register">''' + load_lang('register') + '''</a></li>
             <li><a href="/register">''' + load_lang('register') + '''</a></li>
@@ -32,7 +32,7 @@ def user_info_2(conn):
         if test and test[0][0] != '':
         if test and test[0][0] != '':
             plus += '<li><a href="/pass_find">' + load_lang('password_search') + '</a></li>'
             plus += '<li><a href="/pass_find">' + load_lang('password_search') + '</a></li>'
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('user_tool'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('user_tool'), wiki_set(), custom(), other2([0, 0])],
         data = '''
         data = '''
             <h2>''' + load_lang('state') + '''</h2>
             <h2>''' + load_lang('state') + '''</h2>

+ 5 - 5
route/user_setting.py

@@ -10,7 +10,7 @@ def user_setting_2(conn, server_init):
         return re_error('/ban')
         return re_error('/ban')
 
 
     if ip_or_user(ip) == 0:
     if ip_or_user(ip) == 0:
-        if flask.request.method == 'POST':    
+        if flask.request.method == 'POST':
             auto_list = ['email', 'skin', 'lang']
             auto_list = ['email', 'skin', 'lang']
 
 
             for auto_data in auto_list:
             for auto_data in auto_list:
@@ -22,9 +22,9 @@ def user_setting_2(conn, server_init):
                         curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), [auto_data, ip, flask.request.form.get(auto_data, '')])
                         curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), [auto_data, ip, flask.request.form.get(auto_data, '')])
 
 
             conn.commit()
             conn.commit()
-            
+
             return redirect('/change')
             return redirect('/change')
-        else:        
+        else:
             curs.execute(db_change('select data from user_set where name = "email" and id = ?'), [ip])
             curs.execute(db_change('select data from user_set where name = "email" and id = ?'), [ip])
             data = curs.fetchall()
             data = curs.fetchall()
             if data:
             if data:
@@ -58,12 +58,12 @@ def user_setting_2(conn, server_init):
                     oauth_content += '<li>{}</li>'.format(oauth_provider[i].capitalize() + ' : <img src="{}" width="17px" height="17px"> {}'.format(oauth_data[0][1], oauth_data[0][0]))
                     oauth_content += '<li>{}</li>'.format(oauth_provider[i].capitalize() + ' : <img src="{}" width="17px" height="17px"> {}'.format(oauth_data[0][1], oauth_data[0][0]))
                 else:
                 else:
                     oauth_content += '<li>{}</li>'.format(oauth_provider[i].capitalize() + ' <a href="/oauth/{}/init">({})</a>'.format(oauth_provider[i], load_lang('connect')))
                     oauth_content += '<li>{}</li>'.format(oauth_provider[i].capitalize() + ' <a href="/oauth/{}/init">({})</a>'.format(oauth_provider[i], load_lang('connect')))
-            
+
             oauth_content += '</ul>'
             oauth_content += '</ul>'
 
 
             http_warring = '<hr class=\"main_hr\"><span>' + load_lang('http_warring') + '</span>'
             http_warring = '<hr class=\"main_hr\"><span>' + load_lang('http_warring') + '</span>'
 
 
-            return easy_minify(flask.render_template(skin_check(),    
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('user_setting'), wiki_set(), custom(), other2([0, 0])],
                 imp = [load_lang('user_setting'), wiki_set(), custom(), other2([0, 0])],
                 data = '''
                 data = '''
                     <form method="post">
                     <form method="post">

+ 4 - 4
route/user_tool.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def user_tool_2(conn, name):
 def user_tool_2(conn, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     data = '''
     data = '''
         <h2>''' + load_lang('tool') + '''</h2>
         <h2>''' + load_lang('tool') + '''</h2>
         <ul>
         <ul>
@@ -10,14 +10,14 @@ def user_tool_2(conn, name):
             <li><a href="/topic/user:''' + url_pas(name) + '''">''' + load_lang('user_discussion') + '''</a></li>
             <li><a href="/topic/user:''' + url_pas(name) + '''">''' + load_lang('user_discussion') + '''</a></li>
         </ul>
         </ul>
     '''
     '''
-            
+
     if admin_check(1) == 1:
     if admin_check(1) == 1:
         curs.execute(db_change("select block from ban where block = ?"), [name])
         curs.execute(db_change("select block from ban where block = ?"), [name])
         if curs.fetchall():
         if curs.fetchall():
             ban_name = load_lang('ban_release')
             ban_name = load_lang('ban_release')
         else:
         else:
             ban_name = load_lang('ban')
             ban_name = load_lang('ban')
-    
+
         data += '''
         data += '''
             <h2>''' + load_lang('admin') + '''</h2>
             <h2>''' + load_lang('admin') + '''</h2>
             <ul>
             <ul>
@@ -26,7 +26,7 @@ def user_tool_2(conn, name):
             </ul>
             </ul>
         '''
         '''
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('tool') + ')', 0])],
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('tool') + ')', 0])],
         data = data,
         data = data,
         menu = 0
         menu = 0

+ 3 - 3
route/view_diff_data.py

@@ -21,11 +21,11 @@ def view_diff_data_2(conn, name):
         if second_raw_data:
         if second_raw_data:
             if first == second:
             if first == second:
                 result = ''
                 result = ''
-            else:            
+            else:
                 diff_data = difflib.SequenceMatcher(None, first_raw_data[0][0], second_raw_data[0][0])
                 diff_data = difflib.SequenceMatcher(None, first_raw_data[0][0], second_raw_data[0][0])
                 result = '<pre>' + diff(diff_data) + '</pre>'
                 result = '<pre>' + diff(diff_data) + '</pre>'
-            
-            return easy_minify(flask.render_template(skin_check(), 
+
+            return easy_minify(flask.render_template(skin_check(),
                 imp = [name, wiki_set(), custom(), other2([' (' + load_lang('compare') + ')', 0])],
                 imp = [name, wiki_set(), custom(), other2([' (' + load_lang('compare') + ')', 0])],
                 data = result,
                 data = result,
                 menu = [['history/' + url_pas(name), load_lang('return')]]
                 menu = [['history/' + url_pas(name), load_lang('return')]]

+ 3 - 3
route/view_down.py

@@ -8,10 +8,10 @@ def view_down_2(conn, name):
     curs.execute(db_change("select title from data where title like ?"), [name + '/%'])
     curs.execute(db_change("select title from data where title like ?"), [name + '/%'])
     for data in curs.fetchall():
     for data in curs.fetchall():
         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
-        
+
     div += '</ul>'
     div += '</ul>'
-    
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('sub') + ')', 0])],
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('sub') + ')', 0])],
         data = div,
         data = div,
         menu = [['w/' + url_pas(name), load_lang('return')]]
         menu = [['w/' + url_pas(name), load_lang('return')]]

+ 9 - 9
route/view_raw.py

@@ -11,22 +11,22 @@ def view_raw_2(conn, name, topic_num, num):
         topic_change_data = topic_change(topic_num)
         topic_change_data = topic_change(topic_num)
         name = topic_change_data[0]
         name = topic_change_data[0]
         sub_title = topic_change_data[1]
         sub_title = topic_change_data[1]
-    
+
     v_name = name
     v_name = name
     sub = ' (' + load_lang('raw') + ')'
     sub = ' (' + load_lang('raw') + ')'
-    
+
     if not num:
     if not num:
         num = flask.request.args.get('num', None)
         num = flask.request.args.get('num', None)
         if num:
         if num:
             num = int(number_check(num))
             num = int(number_check(num))
-    
+
     if not sub_title and num:
     if not sub_title and num:
         curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, str(num)])
         curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, str(num)])
         if curs.fetchall() and admin_check(6) != 1:
         if curs.fetchall() and admin_check(6) != 1:
             return re_error('/error/3')
             return re_error('/error/3')
-        
+
         curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
         curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
-        
+
         sub += ' (r' + str(num) + ')'
         sub += ' (r' + str(num) + ')'
 
 
         menu = [['history/' + url_pas(name), load_lang('history')]]
         menu = [['history/' + url_pas(name), load_lang('history')]]
@@ -35,22 +35,22 @@ def view_raw_2(conn, name, topic_num, num):
             curs.execute(db_change("select data from topic where id = ? and title = ? and sub = ? and block = ''"), [str(num), name, sub_title])
             curs.execute(db_change("select data from topic where id = ? and title = ? and sub = ? and block = ''"), [str(num), name, sub_title])
         else:
         else:
             curs.execute(db_change("select data from topic where id = ? and title = ? and sub = ?"), [str(num), name, sub_title])
             curs.execute(db_change("select data from topic where id = ? and title = ? and sub = ?"), [str(num), name, sub_title])
-        
+
         v_name = load_lang('discussion_raw')
         v_name = load_lang('discussion_raw')
         sub = ' (#' + str(num) + ')'
         sub = ' (#' + str(num) + ')'
 
 
         menu = [['topic/' + url_pas(name) + '/sub/' + url_pas(sub_title) + '#' + str(num), load_lang('discussion')], ['topic/' + url_pas(name) + '/sub/' + url_pas(sub_title) + '/admin/' + str(num), load_lang('return')]]
         menu = [['topic/' + url_pas(name) + '/sub/' + url_pas(sub_title) + '#' + str(num), load_lang('discussion')], ['topic/' + url_pas(name) + '/sub/' + url_pas(sub_title) + '/admin/' + str(num), load_lang('return')]]
     else:
     else:
         curs.execute(db_change("select data from data where title = ?"), [name])
         curs.execute(db_change("select data from data where title = ?"), [name])
-        
+
         menu = [['w/' + url_pas(name), load_lang('return')]]
         menu = [['w/' + url_pas(name), load_lang('return')]]
 
 
     data = curs.fetchall()
     data = curs.fetchall()
     if data:
     if data:
         p_data = html.escape(data[0][0])
         p_data = html.escape(data[0][0])
         p_data = '<textarea readonly rows="25">' + p_data + '</textarea>'
         p_data = '<textarea readonly rows="25">' + p_data + '</textarea>'
-        
-        return easy_minify(flask.render_template(skin_check(), 
+
+        return easy_minify(flask.render_template(skin_check(),
             imp = [v_name, wiki_set(), custom(), other2([sub, 0])],
             imp = [v_name, wiki_set(), custom(), other2([sub, 0])],
             data = p_data,
             data = p_data,
             menu = menu
             menu = menu

+ 24 - 24
route/view_read.py

@@ -17,7 +17,7 @@ def view_read_2(conn, name):
             r_db = curs.fetchall()
             r_db = curs.fetchall()
             if r_db:
             if r_db:
                 r_data = link_fix(r_db[0][0])
                 r_data = link_fix(r_db[0][0])
-            
+
                 return redirect('/w/' + r_data[0] + '?from=' + name + r_data[1])
                 return redirect('/w/' + r_data[0] + '?from=' + name + r_data[1])
 
 
     curs.execute(db_change("select sub from rd where title = ? and not stop = 'O' order by date desc"), [name])
     curs.execute(db_change("select sub from rd where title = ? and not stop = 'O' order by date desc"), [name])
@@ -27,27 +27,27 @@ def view_read_2(conn, name):
         topic = 0
         topic = 0
 
 
     curs.execute(db_change("select link from back where title = ? and type = 'cat' order by link asc"), [name])
     curs.execute(db_change("select link from back where title = ? and type = 'cat' order by link asc"), [name])
-                
+
     curs.execute(db_change("select title from data where title like ?"), ['%' + name + '/%'])
     curs.execute(db_change("select title from data where title like ?"), ['%' + name + '/%'])
     if curs.fetchall():
     if curs.fetchall():
         down = 1
         down = 1
     else:
     else:
         down = 0
         down = 0
-        
+
     m = re.search("^(.*)\/(.*)$", name)
     m = re.search("^(.*)\/(.*)$", name)
     if m:
     if m:
         uppage = m.groups()[0]
         uppage = m.groups()[0]
     else:
     else:
         uppage = 0
         uppage = 0
-        
-    if re.search('^category:', name):        
+
+    if re.search('^category:', name):
         curs.execute(db_change("select link from back where title = ? and type = 'cat' order by link asc"), [name])
         curs.execute(db_change("select link from back where title = ? and type = 'cat' order by link asc"), [name])
         back = curs.fetchall()
         back = curs.fetchall()
         if back:
         if back:
             div = '<br><h2 id="cate_normal">' + load_lang('category') + '</h2><ul>'
             div = '<br><h2 id="cate_normal">' + load_lang('category') + '</h2><ul>'
             u_div = ''
             u_div = ''
 
 
-            for data in back:    
+            for data in back:
                 if re.search('^category:', data[0]):
                 if re.search('^category:', data[0]):
                     u_div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
                     u_div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
                 else:
                 else:
@@ -55,14 +55,14 @@ def view_read_2(conn, name):
                     db_data = curs.fetchall()
                     db_data = curs.fetchall()
                     if db_data:
                     if db_data:
                         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a> <a id="inside" href="/xref/' + url_pas(data[0]) + '">(' + load_lang('backlink') + ')</a></li>'
                         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a> <a id="inside" href="/xref/' + url_pas(data[0]) + '">(' + load_lang('backlink') + ')</a></li>'
-                    else: 
+                    else:
                         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
                         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
 
 
             div += '</ul>'
             div += '</ul>'
-            
+
             if div == '<br><h2 id="cate_normal">' + load_lang('category') + '</h2><ul></ul>':
             if div == '<br><h2 id="cate_normal">' + load_lang('category') + '</h2><ul></ul>':
                 div = ''
                 div = ''
-            
+
             if u_div != '':
             if u_div != '':
                 div += '<br><h2 id="cate_under">' + load_lang('under_category') + '</h2><ul>' + u_div + '</ul>'
                 div += '<br><h2 id="cate_under">' + load_lang('under_category') + '</h2><ul>' + u_div + '</ul>'
 
 
@@ -75,7 +75,7 @@ def view_read_2(conn, name):
         curs.execute(db_change("select title, data from history where title = ? and id = ?"), [name, str(num)])
         curs.execute(db_change("select title, data from history where title = ? and id = ?"), [name, str(num)])
     else:
     else:
         curs.execute(db_change("select title, data from data where title = ?"), [name])
         curs.execute(db_change("select title, data from data where title = ?"), [name])
-    
+
     data = curs.fetchall()
     data = curs.fetchall()
     if data:
     if data:
         else_data = data[0][1]
         else_data = data[0][1]
@@ -86,11 +86,11 @@ def view_read_2(conn, name):
     data = curs.fetchall()
     data = curs.fetchall()
     if data:
     if data:
         acl = 1
         acl = 1
-            
+
     if flask.request.args.get('from', None) and else_data:
     if flask.request.args.get('from', None) and else_data:
         else_data = re.sub('^\r\n', '', else_data)
         else_data = re.sub('^\r\n', '', else_data)
         else_data = re.sub('\r\n$', '', else_data)
         else_data = re.sub('\r\n$', '', else_data)
-            
+
     end_data = render_set(
     end_data = render_set(
         title = name,
         title = name,
         data = else_data
         data = else_data
@@ -98,7 +98,7 @@ def view_read_2(conn, name):
 
 
     if end_data == 'HTTP Request 401.3':
     if end_data == 'HTTP Request 401.3':
         response_data = 401
         response_data = 401
-        
+
         curs.execute(db_change('select data from other where name = "error_401"'))
         curs.execute(db_change('select data from other where name = "error_401"'))
         sql_d = curs.fetchall()
         sql_d = curs.fetchall()
         if sql_d and sql_d[0][0] != '':
         if sql_d and sql_d[0][0] != '':
@@ -107,14 +107,14 @@ def view_read_2(conn, name):
             end_data = '<h2>' + load_lang('error') + '</h2><ul><li>' + load_lang('authority_error') + '</li></ul>'
             end_data = '<h2>' + load_lang('error') + '</h2><ul><li>' + load_lang('authority_error') + '</li></ul>'
     elif end_data == 'HTTP Request 404':
     elif end_data == 'HTTP Request 404':
         response_data = 404
         response_data = 404
-        
+
         curs.execute(db_change('select data from other where name = "error_404"'))
         curs.execute(db_change('select data from other where name = "error_404"'))
         sql_d = curs.fetchall()
         sql_d = curs.fetchall()
         if sql_d and sql_d[0][0] != '':
         if sql_d and sql_d[0][0] != '':
             end_data = '<h2>' + load_lang('error') + '</h2><ul><li>' + sql_d[0][0] + '</li></ul>'
             end_data = '<h2>' + load_lang('error') + '</h2><ul><li>' + sql_d[0][0] + '</li></ul>'
         else:
         else:
             end_data = '<h2>' + load_lang('error') + '</h2><ul><li>' + load_lang('decument_404_error') + '</li></ul>'
             end_data = '<h2>' + load_lang('error') + '</h2><ul><li>' + load_lang('decument_404_error') + '</li></ul>'
-            
+
         curs.execute(db_change('select ip, date, leng, send from history where title = ? order by id desc limit 3'), [name])
         curs.execute(db_change('select ip, date, leng, send from history where title = ? order by id desc limit 3'), [name])
         sql_d = curs.fetchall()
         sql_d = curs.fetchall()
         if sql_d:
         if sql_d:
@@ -126,13 +126,13 @@ def view_read_2(conn, name):
                     leng = '<span style="color:red;">(' + i[2] + ')</span>'
                     leng = '<span style="color:red;">(' + i[2] + ')</span>'
                 else:
                 else:
                     leng = '<span style="color:gray;">(' + i[2] + ')</span>'
                     leng = '<span style="color:gray;">(' + i[2] + ')</span>'
-            
+
                 end_data += '<li>' + i[1] + ' | ' + ip_pas(i[0]) + ' | ' + leng + (' | ' + i[3] if i[3] != '' else '') + '</li>'
                 end_data += '<li>' + i[1] + ' | ' + ip_pas(i[0]) + ' | ' + leng + (' | ' + i[3] if i[3] != '' else '') + '</li>'
-                
+
             end_data += '<li><a href="/history/' + url_pas(name) + '">(...)</a></li></ul>'
             end_data += '<li><a href="/history/' + url_pas(name) + '">(...)</a></li></ul>'
     else:
     else:
         response_data = 200
         response_data = 200
-    
+
     if num:
     if num:
         menu = [['history/' + url_pas(name), load_lang('history')]]
         menu = [['history/' + url_pas(name), load_lang('history')]]
         sub = ' (r' + str(num) + ')'
         sub = ' (r' + str(num) + ')'
@@ -160,7 +160,7 @@ def view_read_2(conn, name):
 
 
         if down:
         if down:
             menu += [['down/' + url_pas(name), load_lang('sub')]]
             menu += [['down/' + url_pas(name), load_lang('sub')]]
-    
+
         curs.execute(db_change("select date from history where title = ? order by date desc limit 1"), [name])
         curs.execute(db_change("select date from history where title = ? order by date desc limit 1"), [name])
         date = curs.fetchall()
         date = curs.fetchall()
         if date:
         if date:
@@ -169,7 +169,7 @@ def view_read_2(conn, name):
             r_date = 0
             r_date = 0
 
 
     div = end_data + div
     div = end_data + div
-            
+
     adsense_code = '<div align="center" style="display: block; margin-bottom: 10px;">{}</div>'
     adsense_code = '<div align="center" style="display: block; margin-bottom: 10px;">{}</div>'
 
 
     curs.execute(db_change("select data from other where name = 'adsense'"))
     curs.execute(db_change("select data from other where name = 'adsense'"))
@@ -179,7 +179,7 @@ def view_read_2(conn, name):
         adsense_code = adsense_code.format(curs.fetchall()[0][0])
         adsense_code = adsense_code.format(curs.fetchall()[0][0])
     else:
     else:
         adsense_code = adsense_code.format('')
         adsense_code = adsense_code.format('')
-    
+
     div = adsense_code + '<div>' + div + '</div>'
     div = adsense_code + '<div>' + div + '</div>'
 
 
     match = re.search("^user:([^/]*)", name)
     match = re.search("^user:([^/]*)", name)
@@ -194,7 +194,7 @@ def view_read_2(conn, name):
     body = curs.fetchall()
     body = curs.fetchall()
     if body:
     if body:
         div = body[0][0] + '<hr class=\"main_hr\">' + div
         div = body[0][0] + '<hr class=\"main_hr\">' + div
-        
+
     curs.execute(db_change("select data from other where name = 'bottom_body'"))
     curs.execute(db_change("select data from other where name = 'bottom_body'"))
     body = curs.fetchall()
     body = curs.fetchall()
     if body:
     if body:
@@ -208,8 +208,8 @@ def view_read_2(conn, name):
             watch_list = 1
             watch_list = 1
     else:
     else:
         watch_list = 0
         watch_list = 0
-        
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [flask.request.args.get('show', name), wiki_set(), custom(), other2([sub, r_date, watch_list])],
         imp = [flask.request.args.get('show', name), wiki_set(), custom(), other2([sub, r_date, watch_list])],
         data = div,
         data = div,
         menu = menu
         menu = menu

+ 9 - 9
route/view_xref.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def view_xref_2(conn, name):
 def view_xref_2(conn, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     if acl_check(name, 'render') == 1:
     if acl_check(name, 'render') == 1:
         return re_error('/ban')
         return re_error('/ban')
 
 
@@ -11,12 +11,12 @@ def view_xref_2(conn, name):
         sql_num = num * 50 - 50
         sql_num = num * 50 - 50
     else:
     else:
         sql_num = 0
         sql_num = 0
-        
+
     div = '<ul>'
     div = '<ul>'
 
 
     if re.search('#', name):
     if re.search('#', name):
         name = re.sub('#', '\\\\#', name)
         name = re.sub('#', '\\\\#', name)
-    
+
     curs.execute(db_change("" + \
     curs.execute(db_change("" + \
         "select link, type from back " + \
         "select link, type from back " + \
         "where (title = ? and not type = 'cat' and not type = 'no') or (title like ? and type = 'redirect')" + \
         "where (title = ? and not type = 'cat' and not type = 'no') or (title like ? and type = 'redirect')" + \
@@ -29,20 +29,20 @@ def view_xref_2(conn, name):
     data_list = curs.fetchall()
     data_list = curs.fetchall()
     for data in data_list:
     for data in data_list:
         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a>'
         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a>'
-        
-        if data[1]:                
+
+        if data[1]:
             div += ' (' + data[1] + ')'
             div += ' (' + data[1] + ')'
-        
+
         curs.execute(db_change("select title from back where title = ? and type = 'include'"), [data[0]])
         curs.execute(db_change("select title from back where title = ? and type = 'include'"), [data[0]])
         db_data = curs.fetchall()
         db_data = curs.fetchall()
         if db_data:
         if db_data:
             div += ' <a id="inside" href="/xref/' + url_pas(data[0]) + '">(' + load_lang('backlink') + ')</a>'
             div += ' <a id="inside" href="/xref/' + url_pas(data[0]) + '">(' + load_lang('backlink') + ')</a>'
 
 
         div += '</li>'
         div += '</li>'
-      
+
     div += '</ul>' + next_fix('/xref/' + url_pas(name) + '?num=', num, data_list)
     div += '</ul>' + next_fix('/xref/' + url_pas(name) + '?num=', num, data_list)
-    
-    return easy_minify(flask.render_template(skin_check(), 
+
+    return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('backlink') + ')', 0])],
         imp = [name, wiki_set(), custom(), other2([' (' + load_lang('backlink') + ')', 0])],
         data = div,
         data = div,
         menu = [['w/' + url_pas(name), load_lang('return')]]
         menu = [['w/' + url_pas(name), load_lang('return')]]

+ 2 - 2
route/watch_list.py

@@ -4,7 +4,7 @@ def watch_list_2(conn):
     curs = conn.cursor()
     curs = conn.cursor()
 
 
     div = 'Limit : 10<hr class=\"main_hr\">'
     div = 'Limit : 10<hr class=\"main_hr\">'
-    ip = ip_check()    
+    ip = ip_check()
 
 
     if ip_or_user(ip) != 0:
     if ip_or_user(ip) != 0:
         return redirect('/login')
         return redirect('/login')
@@ -22,7 +22,7 @@ def watch_list_2(conn):
 
 
     div += '<a href="/manager/13">(' + load_lang('add') + ')</a>'
     div += '<a href="/manager/13">(' + load_lang('add') + ')</a>'
 
 
-    return easy_minify(flask.render_template(skin_check(), 
+    return easy_minify(flask.render_template(skin_check(),
         imp = [load_lang('watchlist'), wiki_set(), custom(), other2([0, 0])],
         imp = [load_lang('watchlist'), wiki_set(), custom(), other2([0, 0])],
         data = div,
         data = div,
         menu = [['manager', load_lang('return')]]
         menu = [['manager', load_lang('return')]]

+ 2 - 2
route/watch_list_name.py

@@ -2,7 +2,7 @@ from .tool.func import *
 
 
 def watch_list_name_2(conn, name):
 def watch_list_name_2(conn, name):
     curs = conn.cursor()
     curs = conn.cursor()
-    
+
     ip = ip_check()
     ip = ip_check()
     if ip_or_user(ip) != 0:
     if ip_or_user(ip) != 0:
         return redirect('/login')
         return redirect('/login')
@@ -17,7 +17,7 @@ def watch_list_name_2(conn, name):
         curs.execute(db_change("delete from scan where user = ? and title = ?"), [ip, name])
         curs.execute(db_change("delete from scan where user = ? and title = ?"), [ip, name])
     else:
     else:
         curs.execute(db_change("insert into scan (user, title) values (?, ?)"), [ip, name])
         curs.execute(db_change("insert into scan (user, title) values (?, ?)"), [ip, name])
-    
+
     conn.commit()
     conn.commit()
 
 
     return redirect('/watch_list')
     return redirect('/watch_list')

+ 3 - 3
views/main_css/js/do_insert_data.js

@@ -1,16 +1,16 @@
 // https://stackoverflow.com/questions/11076975/insert-text-into-textarea-at-cursor-position-javascript
 // https://stackoverflow.com/questions/11076975/insert-text-into-textarea-at-cursor-position-javascript
 
 
 function do_insert_data(name, data) {
 function do_insert_data(name, data) {
-    if(document.selection) { 
+    if(document.selection) {
         document.getElementById(name).focus();
         document.getElementById(name).focus();
 
 
         sel = document.selection.createRange();
         sel = document.selection.createRange();
-        sel.text = data; 
+        sel.text = data;
     } else if(document.getElementById(name).selectionStart || document.getElementById(name).selectionStart == '0') {
     } else if(document.getElementById(name).selectionStart || document.getElementById(name).selectionStart == '0') {
         var startPos = document.getElementById(name).selectionStart;
         var startPos = document.getElementById(name).selectionStart;
         var endPos = document.getElementById(name).selectionEnd;
         var endPos = document.getElementById(name).selectionEnd;
 
 
-        document.getElementById(name).value = document.getElementById(name).value.substring(0, startPos) + data + document.getElementById(name).value.substring(endPos, document.getElementById(name).value.length); 
+        document.getElementById(name).value = document.getElementById(name).value.substring(0, startPos) + data + document.getElementById(name).value.substring(endPos, document.getElementById(name).value.length);
     } else {
     } else {
         document.getElementById(name).value += data;
         document.getElementById(name).value += data;
     }
     }

+ 4 - 4
views/main_css/js/do_open_folding.js

@@ -1,10 +1,10 @@
-function do_open_folding(data, element) { 
+function do_open_folding(data, element) {
     var fol = document.getElementById(data);
     var fol = document.getElementById(data);
-    if(fol.style.display === '' || (fol.style.display === 'inline-block' || fol.style.display === 'block')) { 
+    if(fol.style.display === '' || (fol.style.display === 'inline-block' || fol.style.display === 'block')) {
         document.getElementById(data).style.display = 'none';
         document.getElementById(data).style.display = 'none';
         element.innerHTML = '[+]'
         element.innerHTML = '[+]'
     } else {
     } else {
         document.getElementById(data).style.display = 'block';
         document.getElementById(data).style.display = 'block';
-        element.innerHTML = '[-]' 
-    } 
+        element.innerHTML = '[-]'
+    }
 }
 }

+ 1 - 1
views/main_css/js/do_open_foot.js

@@ -17,5 +17,5 @@ function do_open_foot(name, num = 0) {
         }
         }
     }
     }
 
 
-    
+
 }
 }

+ 1 - 1
views/main_css/js/do_stop_exit.js

@@ -6,7 +6,7 @@ function do_stop_exit() {
         data = document.getElementById('content').value;
         data = document.getElementById('content').value;
         origin = document.getElementById('origin').value;
         origin = document.getElementById('origin').value;
         if(data !== origin && go_save_zone != 1) {
         if(data !== origin && go_save_zone != 1) {
-            return ''; 
+            return '';
         }
         }
     }
     }
 }
 }

+ 5 - 5
views/main_css/js/dummy_do_open_foot.js

@@ -5,15 +5,15 @@ function dummy_do_open_foot(name) {
     } else {
     } else {
         var o_data = document.getElementById('c' + name);
         var o_data = document.getElementById('c' + name);
     }
     }
-    
+
     var g_data = document.getElementById(name.replace(/\.([0-9]+)$/, ''));
     var g_data = document.getElementById(name.replace(/\.([0-9]+)$/, ''));
 
 
     if(o_data.innerHTML === '') {
     if(o_data.innerHTML === '') {
         o_data.style.display = 'block';
         o_data.style.display = 'block';
-        o_data.innerHTML += '' + 
-            '<div class="foot_in">' + 
-                '<a onclick="do_open_foot(\'' + name + '\')" href="javascript:void(0);">(X)</a> <a onclick="do_open_foot(\'' + name + '\')" href="#' + name + '">(Go)</a> ' + g_data.innerHTML + 
-            '</div>' + 
+        o_data.innerHTML += '' +
+            '<div class="foot_in">' +
+                '<a onclick="do_open_foot(\'' + name + '\')" href="javascript:void(0);">(X)</a> <a onclick="do_open_foot(\'' + name + '\')" href="#' + name + '">(Go)</a> ' + g_data.innerHTML +
+            '</div>' +
         '';
         '';
     } else {
     } else {
         o_data.style.display = 'none';
         o_data.style.display = 'none';

+ 2 - 2
views/main_css/js/load_include.js

@@ -2,7 +2,7 @@ function load_include(title, name, p_data) {
     var o_data = document.getElementById(name);
     var o_data = document.getElementById(name);
 
 
     var url = "/api/w/" + encodeURI(title) + "?include=" + name;
     var url = "/api/w/" + encodeURI(title) + "?include=" + name;
-    
+
     var xhr = new XMLHttpRequest();
     var xhr = new XMLHttpRequest();
     xhr.open("GET", url, true);
     xhr.open("GET", url, true);
     xhr.send(null);
     xhr.send(null);
@@ -11,7 +11,7 @@ function load_include(title, name, p_data) {
         if(this.readyState === 4 && this.status === 200) {
         if(this.readyState === 4 && this.status === 200) {
             var o_p_data = JSON.parse(this.responseText);
             var o_p_data = JSON.parse(this.responseText);
             var g_data = o_p_data['data'];
             var g_data = o_p_data['data'];
-            
+
             for(key in p_data) {
             for(key in p_data) {
                 try {
                 try {
                     var patt = new RegExp('@' + p_data[key][0] + '@', 'g');
                     var patt = new RegExp('@' + p_data[key][0] + '@', 'g');

+ 1 - 1
views/main_css/js/load_preview.js

@@ -7,7 +7,7 @@ function load_preview(name) {
 
 
     var url = "/api/w/" + name;
     var url = "/api/w/" + name;
     var url_2 = "/api/markup";
     var url_2 = "/api/markup";
-    
+
     var xhr = new XMLHttpRequest();
     var xhr = new XMLHttpRequest();
     xhr.open("POST", url, true);
     xhr.open("POST", url, true);
     xhr.send(s_data);
     xhr.send(s_data);

+ 1 - 1
views/main_css/js/load_user_info.js

@@ -2,7 +2,7 @@ function load_user_info(name) {
     var n_ver = document.getElementById('get_user_info');
     var n_ver = document.getElementById('get_user_info');
 
 
     var url = "/api/user_info/" + encodeURI(name) + "?render=1";
     var url = "/api/user_info/" + encodeURI(name) + "?render=1";
-    
+
     var xhr = new XMLHttpRequest();
     var xhr = new XMLHttpRequest();
     xhr.open("GET", url, true);
     xhr.open("GET", url, true);
     xhr.send(null);
     xhr.send(null);

+ 1 - 1
views/main_css/js/load_ver.js

@@ -2,7 +2,7 @@ function load_ver() {
     var n_ver = document.getElementById('ver_send');
     var n_ver = document.getElementById('ver_send');
 
 
     var url = "/api/version";
     var url = "/api/version";
-    
+
     var xhr = new XMLHttpRequest();
     var xhr = new XMLHttpRequest();
     xhr.open("GET", url, true);
     xhr.open("GET", url, true);
     xhr.send(null);
     xhr.send(null);

+ 3 - 3
views/main_css/js/render_html.js

@@ -2,7 +2,7 @@ function render_html(name = '') {
     var num = 0;
     var num = 0;
     while(1) {
     while(1) {
         num += 1
         num += 1
-        
+
         if(document.getElementById(name + '_' + String(num))) {
         if(document.getElementById(name + '_' + String(num))) {
             data = document.getElementById(name + '_' + String(num)).innerHTML;
             data = document.getElementById(name + '_' + String(num)).innerHTML;
 
 
@@ -11,7 +11,7 @@ function render_html(name = '') {
                 var patt = new RegExp('&lt;' + t_data[key] + '&gt;((?:(?!&lt;\/' + t_data[key] + '&gt;).)*)&lt;\/' + t_data[key] + '&gt;', 'ig');
                 var patt = new RegExp('&lt;' + t_data[key] + '&gt;((?:(?!&lt;\/' + t_data[key] + '&gt;).)*)&lt;\/' + t_data[key] + '&gt;', 'ig');
                 data = data.replace(patt, '<' + t_data[key] + '>$1</' + t_data[key] + '>');
                 data = data.replace(patt, '<' + t_data[key] + '>$1</' + t_data[key] + '>');
             }
             }
-            
+
             var src_list = {
             var src_list = {
                 'www.youtube.com' : '1',
                 'www.youtube.com' : '1',
                 'www.google.com' : '1'
                 'www.google.com' : '1'
@@ -38,7 +38,7 @@ function render_html(name = '') {
             data = data.replace(/&lt;a href=["\']((?:(?!["\']).)+)["\']&gt;((?:(?!&lt;\/a&gt;).)*)&lt;\/a&gt;/ig, function(full, in_data, in_data_2) {
             data = data.replace(/&lt;a href=["\']((?:(?!["\']).)+)["\']&gt;((?:(?!&lt;\/a&gt;).)*)&lt;\/a&gt;/ig, function(full, in_data, in_data_2) {
                 return '<a id="out_link" href="' + in_data.replace(/^javascript/ig, '') + '">' + in_data_2 + '</a>'
                 return '<a id="out_link" href="' + in_data.replace(/^javascript/ig, '') + '">' + in_data_2 + '</a>'
             });
             });
-            
+
             document.getElementById(name + '_' + String(num)).innerHTML = data;
             document.getElementById(name + '_' + String(num)).innerHTML = data;
         } else {
         } else {
             break;
             break;

+ 1 - 1
views/main_css/js/render_markdown.js

@@ -5,6 +5,6 @@ function render_markdown() {
     data = data.replace(/__((?:(?!__).)+)__/, '<b>$1</b>');
     data = data.replace(/__((?:(?!__).)+)__/, '<b>$1</b>');
     data = data.replace(/\*((?:(?!\*).)+)\*/, '<i>$1</i>');
     data = data.replace(/\*((?:(?!\*).)+)\*/, '<i>$1</i>');
     data = data.replace(/_((?:(?!_).)+)_/, '<i>$1</i>');
     data = data.replace(/_((?:(?!_).)+)_/, '<i>$1</i>');
-    
+
     document.getElementById('render_contect').innerHTML = data;
     document.getElementById('render_contect').innerHTML = data;
 }
 }

+ 3 - 3
views/main_css/js/shotcuts_set.js

@@ -12,7 +12,7 @@ var check = setInterval(function() {
                 window.location.href = element[1];
                 window.location.href = element[1];
             }, {
             }, {
                 'disable_in_input' : true
                 'disable_in_input' : true
-            }); 
+            });
         });
         });
 
 
         all_list_2 = [
         all_list_2 = [
@@ -21,10 +21,10 @@ var check = setInterval(function() {
             ['E', '/edit'],
             ['E', '/edit'],
         ];
         ];
 
 
-        all_list_2.forEach(function(element) {    
+        all_list_2.forEach(function(element) {
             shortcut.add(element[0], function() {
             shortcut.add(element[0], function() {
                 href_d = window.location.href.split("/");
                 href_d = window.location.href.split("/");
-                if(href_d[4]) { 
+                if(href_d[4]) {
                     window.location.href = element[1] + '/' + href_d[4];
                     window.location.href = element[1] + '/' + href_d[4];
                 }
                 }
             }, {
             }, {

Некоторые файлы не были показаны из-за большого количества измененных файлов