Ver Fonte

버그 수정, stable

Surplus_Up (2DU) há 7 anos atrás
pai
commit
486908d247
4 ficheiros alterados com 13 adições e 10 exclusões
  1. 2 2
      app.py
  2. 1 1
      route/custom_head_view.py
  3. 3 0
      route/setting.py
  4. 7 7
      route/tool/func.py

+ 2 - 2
app.py

@@ -8,8 +8,8 @@ for i_data in os.listdir("route"):
 
         exec("from route." + f_src + " import *")
 
-r_ver = 'v3.0.9-master-006'
-c_ver = '309002'
+r_ver = 'v3.0.9-stable'
+c_ver = '400000'
 
 print('Version : ' + r_ver)
 

+ 1 - 1
route/custom_head_view.py

@@ -36,7 +36,7 @@ def custom_head_view_2(conn):
             else:
                 data = ''
 
-        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(), 
             imp = [load_lang(data = 'user_head', safe = 1), wiki_set(), custom(), other2([0, 0])],

+ 3 - 0
route/setting.py

@@ -267,9 +267,11 @@ def setting_2(conn, num):
             if num == 4:
                 curs.execute("select data from other where name = 'body'")
                 title = '_body'
+                start = ''
             else:
                 curs.execute("select data from other where name = 'head'")
                 title = '_head'
+                start = '<span>&lt;style&gt;CSS&lt;/style&gt;<br>&lt;script&gt;JS&lt;/script&gt;</span><hr class=\"main_hr\">'
                 
             head = curs.fetchall()
             if head:
@@ -281,6 +283,7 @@ def setting_2(conn, num):
                 imp = [load_lang(data = 'main' + title, safe = 1), wiki_set(), custom(), other2([0, 0])],
                 data =  '''
                         <form method="post">
+                            ''' + start + '''
                             <textarea rows="25" name="content">''' + html.escape(data) + '''</textarea>
                             <hr class=\"main_hr\">
                             <button id="save" type="submit">''' + load_lang('save') + '''</button>

+ 7 - 7
route/tool/func.py

@@ -172,15 +172,15 @@ def update():
     app_var = json.loads(open(os.path.abspath('./data/app_variables.json'), encoding='utf-8').read())
 
     if os.path.exists('image'):
-        os.rename('image', app_var['PATH_DATA_IMAGES'])
+        os.rename('image', app_var['path_data_image'])
 
     if os.path.exists('oauthsettings.json'):
-        os.rename('oauthsettings.json', app_var['PATH_OAUTHSETTINGS'])
+        os.rename('oauthsettings.json', app_var['path_oauth_setting'])
 
     try:
         load_oauth('discord')
     except KeyError:
-        old_oauth_data = json.loads(open(app_var['PATH_OAUTHSETTINGS'], encoding='utf-8').read())
+        old_oauth_data = json.loads(open(app_var['path_oauth_setting'], encoding='utf-8').read())
 
         if 'discord' not in old_oauth_data['_README']['support']:
             old_oauth_data['_README']['support'] += ['discord']
@@ -189,7 +189,7 @@ def update():
         old_oauth_data['discord']['client_id'] = ''
         old_oauth_data['discord']['client_secret'] = ''
 
-        with open(app_var['PATH_OAUTHSETTINGS'], 'w') as f:
+        with open(app_var['path_oauth_setting'], 'w') as f:
             f.write(json.dumps(old_oauth_data, sort_keys = True, indent = 4))
 
     # -> End Data Migration Code
@@ -312,15 +312,15 @@ def load_lang(data, num = 2, safe = 0):
             return load_lang(data, 1, safe)
 
 def load_oauth(provider):
-    oauth = json.loads(open(app_var['PATH_OAUTHSETTINGS'], encoding='utf-8').read())
+    oauth = json.loads(open(app_var['path_oauth_setting'], encoding='utf-8').read())
 
     return oauth[provider]
 
 def update_oauth(provider, target, content):
-    oauth = json.loads(open(app_var['PATH_OAUTHSETTINGS'], encoding='utf-8').read())
+    oauth = json.loads(open(app_var['path_oauth_setting'], encoding='utf-8').read())
     oauth[provider][target] = content
 
-    with open(app_var['PATH_OAUTHSETTINGS'], 'w') as f:
+    with open(app_var['path_oauth_setting'], 'w') as f:
         f.write(json.dumps(oauth, sort_keys=True, indent=4))
 
     return 'Done'