2du 4 lat temu
rodzic
commit
54fd333e29

+ 7 - 7
app.py

@@ -299,13 +299,13 @@ for i in server_set_var:
 print('----')
 
 # Init-DB_care
-if set_data['db_type'] == 'sqlite':
+if data_db_set['type'] == 'sqlite':
     def back_up(back_time, back_up_where):
         print('----')
 
         try:
             shutil.copyfile(
-                set_data['db'] + '.db', 
+                data_db_set['name'] + '.db', 
                 back_up_where
             )
 
@@ -328,7 +328,7 @@ if set_data['db_type'] == 'sqlite':
         if back_up_where and back_up_where[0][0] != '':
             back_up_where = back_up_where[0][0]
         else:
-            back_up_where = 'back_' + set_data['db'] + '.db'
+            back_up_where = 'back_' + data_db_set['name'] + '.db'
 
         print('Back up state : ' + str(back_time) + ' hours')
 
@@ -926,7 +926,7 @@ def main_upload():
 @app.route('/setting')
 @app.route('/setting/<int:num>', methods = ['POST', 'GET'])
 def setting(num = 0):
-    return main_setting_2(load_db.db_get(), num, set_data['db_type'])
+    return main_setting_2(load_db.db_get(), num, data_db_set['type'])
 
 @app.route('/other')
 def main_other():
@@ -971,8 +971,8 @@ def main_error_404(e):
     return main_error_404_2(load_db.db_get())
     
 if __name__ == "__main__":
-    waitress.serve(
-        app,
+    do_server = netius.servers.WSGIServer(app = app)
+    do_server.serve(
         host = server_set['host'],
-        port = int(server_set['port']), 
+        port = int(server_set['port'])
     )

+ 2 - 0
requirements.txt

@@ -1,5 +1,7 @@
 flask
+
 waitress
+netius
 
 requests
 

+ 0 - 9
route/inter_wiki.py

@@ -15,47 +15,38 @@ def inter_wiki(conn, tool):
     admin = admin_check()
 
     if tool == 'inter_wiki':
-        plus_link = 'plus_inter_wiki'
         title = load_lang('interwiki_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'inter_wiki'"))
     elif tool == 'email_filter':
-        plus_link = 'plus_email_filter'
         title = load_lang('email_filter_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'email'"))
     elif tool == 'name_filter':
-        plus_link = 'plus_name_filter'
         title = load_lang('id_filter_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'name'"))
     elif tool == 'edit_filter':
-        plus_link = 'plus_edit_filter'
         title = load_lang('edit_filter_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'regex_filter'"))
     elif tool == 'file_filter':
-        plus_link = 'plus_file_filter'
         title = load_lang('file_filter_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'file'"))
     elif tool == 'file_filter':
-        plus_link = 'plus_file_filter'
         title = load_lang('file_filter_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'file'"))
     elif tool == 'image_license':
-        plus_link = 'plus_image_license'
         title = load_lang('image_license_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'image_license'"))
     elif tool == 'extension_filter':
-        plus_link = 'plus_extension_filter'
         title = load_lang('extension_filter_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'extension'"))
     else:
-        plus_link = 'plus_edit_top'
         title = load_lang('edit_tool_list')
 
         curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'edit_top'"))

+ 2 - 2
route/main_manager.py

@@ -6,12 +6,12 @@ def main_manager_2(conn, num):
     title_list = {
         0 : [load_lang('document_name'), 'acl', load_lang('acl')],
         1 : [0, 'check', load_lang('check')],
-        2 : [load_lang('file_name'), 'plus_file_filter', load_lang('file_filter_add')],
+        2 : [load_lang('file_name'), 'file_filter/add', load_lang('file_filter_add')],
         3 : [0, 'admin', load_lang('authorize')],
         4 : [0, 'record', load_lang('edit_record')],
         5 : [0, 'record/topic', load_lang('discussion_record')],
         6 : [load_lang('name'), 'admin_plus', load_lang('add_admin_group')],
-        7 : [load_lang('name'), 'plus_edit_filter', load_lang('edit_filter_add')],
+        7 : [load_lang('name'), 'edit_filter/add', load_lang('edit_filter_add')],
         8 : [load_lang('document_name'), 'search', load_lang('search')],
         9 : [0, 'block_log/user', load_lang('blocked_user')],
         10 : [0, 'block_log/admin', load_lang('blocked_admin')],

+ 2 - 2
route/main_update.py

@@ -47,8 +47,8 @@ def main_update_2(conn):
             data = load_lang('update_warning') + '''
                 <hr class=\"main_hr\">
                 <ul class="inside_ul">
-                        <li>''' + load_lang('version') + ''' : <span id="ver_send_2"></span></li>
-                        <li id="ver_send" style="display: none;">''' + load_lang('lastest') + ''' : </li>
+                    <li>''' + load_lang('version') + ''' : <span id="ver_send_2"></span></li>
+                    <li id="ver_send" style="display: none;">''' + load_lang('lastest') + ''' : </li>
                 </ul>
                 <a href="https://github.com/openNAMU/openNAMU">(Beta)</a> <a href="https://github.com/openNAMU/openNAMU/tree/stable">(Stable)</a>
                 <hr class=\"main_hr\">

+ 4 - 1
route/recent_discuss.py

@@ -32,7 +32,10 @@ def recent_discuss_2(conn):
     for data in curs.fetchall():
         div += '' + \
             '<tr>' + \
-                '<td><a href="/thread/' + data[3] + '">' + html.escape(sub) + '</a> <a href="/topic/' + url_pas(title) + '">(' + html.escape(title) + ')</a></td>' + \
+                '<td>' + \
+                    '<a href="/thread/' + data[3] + '">' + html.escape(data[1]) + '</a> ' + \
+                    '<a href="/topic/' + url_pas(data[0]) + '">(' + html.escape(data[0]) + ')</a>' + \
+                '</td>' + \
                 '<td>' + data[2] + '</td>' + \
             '</tr>' + \
         ''

+ 4 - 4
route/tool/func.py

@@ -64,7 +64,7 @@ from .func_mark import *
 
 from diff_match_patch import diff_match_patch
 
-import waitress
+import netius.servers
 
 import werkzeug.routing
 import werkzeug.debug
@@ -106,7 +106,7 @@ class get_db_connect:
         
     def db_load(self):
         if self.db_set['type'] == 'sqlite':
-            self.conn = sqlite3.connect(self.db_set['name'] + '.db', check_same_thread = False)
+            self.conn = sqlite3.connect(self.db_set['name'] + '.db')
         else:
             self.conn = pymysql.connect(
                 host = self.db_set['mysql_host'],
@@ -132,8 +132,8 @@ class get_db_connect:
         return self.conn
     
     def db_get(self):
-        if self.db_set['type'] != 'sqlite':
-            self.conn.ping(reconnect = True)
+        # if self.db_set['type'] != 'sqlite':
+        #     self.conn.ping(reconnect = True)
             
         return self.conn
 

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.5.0-beta (stable1) (beta11) (dev16)",
+        "r_ver" : "v3.5.0-beta (stable1) (beta12) (dev17)",
         "c_ver" : "3500101",
         "s_ver" : "3500110"
     }

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

@@ -379,7 +379,7 @@ function do_onmark_link_render(data, data_js, name_doc, name_include, data_nowik
                         );
                     }
                     
-                    var data_inter_var = do_link_change(link_real, data_nowiki, 0);
+                    var data_inter_var = do_link_change(link_real, data_nowiki, 1);
                     var data_inter_link_main = data_inter_var[0];
                     var data_inter_link_sub = data_inter_var[1];