Explorar o código

이전 버전 호환 제거, 일부 수정

Surplus_Up (2DU) %!s(int64=6) %!d(string=hai) anos
pai
achega
b6228cf1fa
Modificáronse 6 ficheiros con 15 adicións e 58 borrados
  1. 4 2
      app.py
  2. 5 0
      data/app_var.json
  3. 0 6
      data/app_variables.json
  4. 2 2
      data/oauth.json
  5. 3 47
      route/tool/func.py
  6. 1 1
      version.json

+ 4 - 2
app.py

@@ -19,7 +19,7 @@ print('DB set version : ' + c_ver)
 print('Skin set version : ' + s_ver)
 print('----')
 
-app_var = json.loads(open('data/app_variables.json', encoding='utf-8').read())
+app_var = json.loads(open('data/app_var.json', encoding='utf-8').read())
 
 # DB
 all_src = []
@@ -42,8 +42,10 @@ elif len(all_src) > 1:
 
         db_num += 1
 
-    print('Number : ', end = '')    
+    print('----')
+    print('Number : ', end = '')
     db_name = all_src[int(number_check(input())) - 1]
+    print('----')
 else:
     db_name = all_src[0]
 

+ 5 - 0
data/app_var.json

@@ -0,0 +1,5 @@
+{
+    "_conment_1_" : "Don't edit this file.",
+    "path_oauth_setting" : "data/oauth.json",
+    "path_data_image" : "data/images"
+}

+ 0 - 6
data/app_variables.json

@@ -1,6 +0,0 @@
-{
-    "_README" : "DO NOT MODIFY THIS FILE.",
-    "path_oauth_setting" : "data/oauthsettings.json",
-    "path_set_json" : "data/set.json",
-    "path_data_image" : "data/images"
-}

+ 2 - 2
data/oauthsettings.json → data/oauth.json

@@ -1,7 +1,7 @@
 {
     "_README" : {
-        "en" : "To use the oAuth login feature, you must set the 'publish_url' value to a domain address that includes the HTTPS protocol, and actually support HTTPS connections.",
-        "ko" : "oAuth 로그인 기능을 사용하려면 'publish_url' 값을 HTTPS 프로토콜을 포함한 도메인 주소로 설정하고, 실제로 HTTPS 연결을 지원해야 합니다.",
+        "en" : "To use the OAuth login feature, you must set the 'publish_url' value to a domain address that includes the HTTPS protocol, and actually support HTTPS connections.",
+        "ko" : "OAuth 로그인 기능을 사용하려면 'publish_url' 값을 HTTPS 프로토콜을 포함한 도메인 주소로 설정하고, 실제로 HTTPS 연결을 지원해야 합니다.",
         "support" : ["discord", "facebook", "naver", "kakao"]
     },
     "publish_url" : "https://",

+ 3 - 47
route/tool/func.py

@@ -64,7 +64,7 @@ for i in range(0, 2):
             print(e)
             raise
 
-app_var = json.loads(open('data/app_variables.json', encoding='utf-8').read())
+app_var = json.loads(open('data/app_var.json', encoding='utf-8').read())
 
 def load_conn(data):
     global conn
@@ -176,56 +176,12 @@ def captcha_get():
     return data
 
 def update():
-    # v3.0.8 rd, agreedis, stop 테이블 통합
+    # v3.1.2
     try:
-        curs.execute("select title, sub, close from stop")
-        for i in curs.fetchall():
-            if i[2] == '':
-                curs.execute("update rd set stop = 'S' where title = ? and sub = ?", [i[0], i[1]])
-            else:
-                curs.execute("update rd set stop = 'O' where title = ? and sub = ?", [i[0], i[1]])
-    except:
-        pass
-        
-    try:
-        curs.execute("select title, sub from agreedis")
-        for i in curs.fetchall():
-            curs.execute("update rd set agree = 'O' where title = ? and sub = ?", [i[0], i[1]])
-    except:
-        pass
-         
-    try:
-        curs.execute("drop table if exists stop")
-        curs.execute("drop table if exists agreedis")
+        os.rename('data/oauthsettings.json', 'data/oauth.json')
     except:
         pass
 
-    # Start : Data migration code
-    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_image'])
-
-    if os.path.exists('oauthsettings.json'):
-        os.rename('oauthsettings.json', app_var['path_oauth_setting'])
-
-    try:
-        load_oauth('discord')
-    except KeyError:
-        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']
-
-        old_oauth_data['discord'] = {}
-        old_oauth_data['discord']['client_id'] = ''
-        old_oauth_data['discord']['client_secret'] = ''
-
-        with open(app_var['path_oauth_setting'], 'w') as f:
-            f.write(json.dumps(old_oauth_data, sort_keys = True, indent = 4))
-
-    # End
-
 def pw_encode(data, data2 = '', type_d = ''):
     if type_d == '':
         curs.execute('select data from other where name = "encode"')

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.2-master-07",
+        "r_ver" : "v3.1.2-master-08",
         "c_ver" : "400001",
         "s_ver" : "2"
     }, "stable" : {