Explorar el Código

Merge pull request #658 from 2du/master

버그 수정
잉여개발기 (SPUP) hace 7 años
padre
commit
be8514f33b
Se han modificado 6 ficheros con 25 adiciones y 24 borrados
  1. 1 1
      app.py
  2. 2 2
      language/en-US.json
  3. 2 2
      language/ko-KR.json
  4. 2 0
      route/list_block.py
  5. 3 2
      route/server_now_update.py
  6. 15 17
      route/tool/func.py

+ 1 - 1
app.py

@@ -8,7 +8,7 @@ for i_data in os.listdir("route"):
 
         exec("from route." + f_src + " import *")
 
-r_ver = 'v3.1.0-stable-99'
+r_ver = 'v3.1.0-stable-03'
 c_ver = '400001'
 s_ver = '2'
 

+ 2 - 2
language/en-US.json

@@ -256,7 +256,7 @@
         "no_login_warring" : "Non-login status. IP is logged when working with non-login.",
         "user_reset_sign" : "Your account information has changed like this.",
         "ban_explanation" : "If the blockout period is not set, it is an indefinite block.",
-        "update_warring" : "Manual updates are recommended if your version is 0.2 or lower than the latest version.",
+        "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.",
         "markup_enabled" : "Markup enabled",
         "_comment_3.1_" : "Error",
             "update_error" : "Auto update is not support.",
@@ -272,7 +272,7 @@
             "file_exist_error" : "File does not exist.",
             "password_error" : "The password is different.",
             "recaptcha_error" : "Go through the reCAPTCHA.",
-            "file_extension_error" : "Only jpg, gif, jpeg, png, webp is possible.",
+            "file_extension_error" : "Only JPG, GIF, JPEG, PNG, WEBP is possible.",
             "edit_record_error" : "Edit reason can not be more than 500 characters.",
             "same_file_error" : "A file with the same name exists.",
             "file_capacity_error" : "Maximum file capacity (MB) :",

+ 2 - 2
language/ko-KR.json

@@ -256,7 +256,7 @@
         "no_login_warring" : "비로그인 상태입니다. 편집시 지금 접속한 IP 명의로 기록됩니다.",
         "user_reset_sign" : "사용자의 계정 정보가 다음과 같이 변경 되었습니다.",
         "ban_explanation" : "차단 기간이 정해지지 않으면 무기한 차단 입니다.",
-        "update_warring" : "최신 버전보다 0.2 버전 이상 낮은 경우 수동 업데이트를 권장 드립니다.",
+        "update_warring" : "최신 버전보다 0.2 버전 이상 낮은 경우 수동 업데이트를 권장 드립니다. 윈도우의 경우 route 폴더의 내용이 사라집니다.",
         "markup_enabled" : "문법 사용 가능",
         "_comment_3.1_" : "오류",
             "update_error" : "자동 업데이트가 지원되지 않습니다.",
@@ -272,7 +272,7 @@
             "file_exist_error" : "파일이 존재하지 않습니다.",
             "password_error" : "비밀번호가 다릅니다.",
             "recaptcha_error" : "'나는 로봇이 아닙니다'를 통해 reCAPTCHA를 수행하세요.",
-            "file_extension_error" : "오직 jpg, gif, jpeg, png, webp 만 업로드할 수 있습니다.",
+            "file_extension_error" : "오직 JPG, GIF, JPEG, PNG, WEBP 만 업로드할 수 있습니다.",
             "edit_record_error" : "수정 요약은 500자를 넘길 수 없습니다.",
             "same_file_error" : "똑같은 이름의 파일이 존재합니다.",
             "file_capacity_error" : "최대 파일 크기 (MB) :",

+ 2 - 0
route/list_block.py

@@ -76,6 +76,8 @@ def list_block_2(conn, name, tool):
 
         if data[2] == '':
             admin = ''
+        elif re.search('^tool:', data[2]):
+            admin = data[2]
         else:
             admin = ip_pas(data[2])
 

+ 3 - 2
route/server_now_update.py

@@ -18,7 +18,7 @@ def server_now_update_2(conn):
 
         print('----')
         print('Update')
-
+        print('----')
         if platform.system() == 'Linux':
             ok = []
 
@@ -31,9 +31,10 @@ def server_now_update_2(conn):
             else:
                 print('Update error')
         elif platform.system() == 'Windows':
+            os.system('rd /s /q route')
             urllib.request.urlretrieve('https://github.com/2DU/opennamu/archive/' + up_data + '.zip', 'update.zip')
             zipfile.ZipFile('update.zip').extractall('')
-            ok = os.system('xcopy /y /r opennamu-' + up_data + ' .')
+            ok = os.system('xcopy /y /s /r opennamu-' + up_data + ' .')
             if ok == 0:
                 os.system('rd /s /q opennamu-' + up_data)
                 os.system('del update.zip')

+ 15 - 17
route/tool/func.py

@@ -314,10 +314,11 @@ def load_lang(data, num = 2, safe = 0):
         lang = json.loads(json_data)
 
         if data in lang:
+            t_data = re.sub('\[s\]', '\'s', lang[data])
             if safe == 1:
-                return lang[data]
+                return t_data
             else:
-                return html.escape(lang[data])
+                return html.escape(t_data)
         else:
             return html.escape(data + ' (M)')
     else:
@@ -331,10 +332,11 @@ def load_lang(data, num = 2, safe = 0):
                 return load_lang(data, 1, safe)
 
             if data in lang:
+                t_data = re.sub('\[s\]', '\'s', lang[data])
                 if safe == 1:
-                    return lang[data]
+                    return t_data
                 else:
-                    return html.escape(lang[data])
+                    return html.escape(t_data)
             else:
                 return load_lang(data, 1, safe)
         else:
@@ -587,20 +589,16 @@ def admin_check(num = None, what = None):
 def ip_pas(raw_ip):
     hide = 0
 
-    if re.search("(\.|:)", raw_ip):
-        if not re.search("^tool:", raw_ip):    
-            curs.execute("select data from other where name = 'ip_view'")
-            data = curs.fetchall()
-            if data and data[0][0] != '':
-                ip = '<span style="font-size: 75%;">' + hashlib.md5(bytes(raw_ip, 'utf-8')).hexdigest() + '</span>'
+    if re.search("(\.|:)", raw_ip):    
+        curs.execute("select data from other where name = 'ip_view'")
+        data = curs.fetchall()
+        if data and data[0][0] != '':
+            ip = '<span style="font-size: 75%;">' + hashlib.md5(bytes(raw_ip, 'utf-8')).hexdigest() + '</span>'
 
-                if not admin_check(1):
-                    hide = 1
-            else:
-                ip = raw_ip
+            if not admin_check(1):
+                hide = 1
         else:
             ip = raw_ip
-            hide = 1
     else:
         curs.execute("select title from data where title = ?", ['user:' + raw_ip])
         if curs.fetchall():
@@ -1023,9 +1021,9 @@ def edit_filter_do(data):
                 ban_insert(
                     ip_check(), 
                     '0' if data_list[1] == 'X' else data_list[1], 
-                    load_lang('edit', 1) + ' ' + load_lang('filter', 1), 
+                    'edit filter', 
                     None, 
-                    load_lang('tool', 1) + ':' + load_lang('edit', 1) + ' ' + load_lang('filter', 1)
+                    'tool:edit filter'
                 )
                 
                 return 1