Quellcode durchsuchen

나머지도 변경

Surplus_Up (2DU) vor 6 Jahren
Ursprung
Commit
0bb65b19ae

+ 2 - 2
app.py

@@ -2,7 +2,7 @@ import os
 import re
 
 for i_data in os.listdir("route"):
-    f_src = re.search("(.+)\.py$", i_data)
+    f_src = re.search(r"(.+)\.py$", i_data)
     if f_src:
         f_src = f_src.group(1)
 
@@ -54,7 +54,7 @@ while 1:
 
             all_src = []
             for i_data in os.listdir("."):
-                f_src = re.search("(.+)\.db$", i_data)
+                f_src = re.search(r"(.+)\.db$", i_data)
                 if f_src:
                     all_src += [f_src.group(1)]
 

+ 2 - 2
emergency_tool.py

@@ -48,7 +48,7 @@ while 1:
 
             all_src = []
             for i_data in os.listdir("."):
-                f_src = re.search("(.+)\.db$", i_data)
+                f_src = re.search(r"(.+)\.db$", i_data)
                 if f_src:
                     all_src += [f_src.group(1)]
 
@@ -186,7 +186,7 @@ elif what_i_do == '3':
     print('IP or Name : ', end = '')
     user_data = input()
 
-    if re.search("^([0-9]{1,3}\.[0-9]{1,3})$", user_data):
+    if re.search(r"^([0-9]{1,3}\.[0-9]{1,3})$", user_data):
         band = 'O'
     else:
         band = ''

+ 2 - 2
route/api_skin_info.py

@@ -9,7 +9,7 @@ def api_skin_info_2(conn, name):
         name = './views/' + name + '/index.html'
 
     if not flask.request.args.get('all', None):
-        json_address = re.sub("(((?!\.|\/).)+)\.html$", "info.json", name)
+        json_address = re.sub(r"(((?!\.|\/).)+)\.html$", "info.json", name)
         try:
             json_data = json.loads(open(json_address, encoding='utf8').read())
         except:
@@ -28,7 +28,7 @@ def api_skin_info_2(conn, name):
         }
 
         for i in load_skin(skin_check(1), 1):
-            json_address = re.sub("(((?!\.|\/).)+)\.html$", "info.json", './views/' + i + '/index.html')
+            json_address = re.sub(r"(((?!\.|\/).)+)\.html$", "info.json", './views/' + i + '/index.html')
             try:
                 json_data = json.loads(open(json_address, encoding='utf8').read())
             except:

+ 1 - 1
route/api_user_info.py

@@ -48,7 +48,7 @@ def api_user_info_2(conn, name):
         else:
             plus_t += [load_lang('blocked') + '<br>']
 
-            match = re.search("^([0-9]{1,3}\.[0-9]{1,3})", name)
+            match = re.search(r"^([0-9]{1,3}\.[0-9]{1,3})", name)
             match = match.group(1) if match else '-'
             regex_ban = 0
 

+ 1 - 1
route/give_user_ban.py

@@ -73,7 +73,7 @@ def give_user_ban_2(conn, name):
             if name:
                 main_name = name
 
-                if name and re.search("^([0-9]{1,3}\.[0-9]{1,3})$", name):
+                if name and re.search(r"^([0-9]{1,3}\.[0-9]{1,3})$", name):
                     b_now = load_lang('band_ban')
                 else:
                     b_now = load_lang('ban')

+ 3 - 3
route/recent_changes.py

@@ -109,12 +109,12 @@ def recent_changes_2(conn, name, tool):
             send = '<br>'
 
             if data[4]:
-                if not re.search("^(?: *)$", data[4]):
+                if not re.search(r"^(?: *)$", data[4]):
                     send = data[4]
 
-            if re.search("\+", data[5]):
+            if re.search(r"\+", data[5]):
                 leng = '<span style="color:green;">(' + data[5] + ')</span>'
-            elif re.search("\-", data[5]):
+            elif re.search(r"\-", data[5]):
                 leng = '<span style="color:red;">(' + data[5] + ')</span>'
             else:
                 leng = '<span style="color:gray;">(' + data[5] + ')</span>'

+ 4 - 4
route/tool/func.py

@@ -118,7 +118,7 @@ def send_email(who, title, data):
         print('Error : Email send error')
 
 def last_change(data):
-    json_address = re.sub("(((?!\.|\/).)+)\.html$", "set.json", skin_check())
+    json_address = re.sub(r"(((?!\.|\/).)+)\.html$", "set.json", skin_check())
     try:
         json_data = json.loads(open(json_address, encoding='utf8').read())
     except:
@@ -814,7 +814,7 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
     get_ban = ban_check()
     
     if name:
-        acl_c = re.search("^user:((?:(?!\/).)*)", name)
+        acl_c = re.search(r"^user:((?:(?!\/).)*)", name)
     else:
         acl_c = None
 
@@ -965,7 +965,7 @@ def ban_check(ip = None, tool = None):
     if admin_check(None, None, ip) == 1:
         return 0
 
-    band = re.search("^([0-9]{1,3}\.[0-9]{1,3})", ip)
+    band = re.search(r"^([0-9]{1,3}\.[0-9]{1,3})", ip)
     if band:
         band_it = band.group(1)
     else:
@@ -1011,7 +1011,7 @@ def ban_insert(name, end, why, login, blocker, type_d = None):
     if type_d:
         band = type_d
     else:
-        if re.search("^([0-9]{1,3}\.[0-9]{1,3})$", name):
+        if re.search(r"^([0-9]{1,3}\.[0-9]{1,3})$", name):
             band = 'O'
         else:
             band = ''

+ 23 - 20
route/tool/set_mark/namumark.py

@@ -72,27 +72,27 @@ def table_parser(data, cel_data, cel_num, start_data, num = 0, cel_color = {}):
 
     table_state = re.findall(r'&lt;((?:(?!&gt;).)+)&gt;', data)
     for in_state in table_state:
-        if re.search("^table ?width=([^=]+)$", in_state):
+        if re.search(r"^table ?width=([^=]+)$", in_state):
             table_data = re.sub(r'^table ?width=', '', in_state)
             div_style += 'width: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
             all_table += 'width: 100%;'
-        elif re.search("^table ?height=([^=]+)$", in_state):
+        elif re.search(r"^table ?height=([^=]+)$", in_state):
             table_data = re.sub(r'^table ?height=', '', in_state)
             div_style += 'height: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
-        elif re.search("^table ?align=([^=]+)$", in_state):
+        elif re.search(r"^table ?align=([^=]+)$", in_state):
             table_data = re.sub(r'^table ?align=', '', in_state)
             if table_data == 'right':
                 div_style += 'float: right;'
             elif table_data == 'center':
                 all_table += 'margin: auto;'
-        elif re.search("^table ?textalign=([^=]+)$", in_state):
+        elif re.search(r"^table ?textalign=([^=]+)$", in_state):
             num = 1
             table_data = re.sub(r'^table ?textalign=', '', in_state)
             if table_data == 'right':
                 all_table += 'text-align: right;'
             elif table_data == 'center':
                 all_table += 'text-align: center;'
-        elif re.search("^row ?textalign=([^=]+)$", in_state):
+        elif re.search(r"^row ?textalign=([^=]+)$", in_state):
             table_data = re.sub(r'^row ?textalign=', '', in_state)
             if table_data == 'right':
                 row_style += 'text-align: right;'
@@ -102,48 +102,48 @@ def table_parser(data, cel_data, cel_num, start_data, num = 0, cel_color = {}):
                 row_style += 'text-align: left;'
         elif re.search(r'^-([0-9]+)$', in_state):
             cel = 'colspan="' + re.sub(r'^-', '', in_state) + '"'
-        elif re.search("^(\^|v)?\|([^|]+)$", in_state):
+        elif re.search(r"^(\^|v)?\|([^|]+)$", in_state):
             if re.search(r'^\^', in_state):
                 cel_style += 'vertical-align: top;'
             elif re.search(r'^v', in_state):
                 cel_style += 'vertical-align: bottom;'
 
             row = 'rowspan="' + re.sub(r'^(\^|v)?\|', '', in_state) + '"'
-        elif re.search("^row ?bgcolor=([^=]+)$", in_state):
+        elif re.search(r"^row ?bgcolor=([^=]+)$", in_state):
             table_data = re.sub(r'^row ?bgcolor=', '', in_state)
             row_style += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
-        elif re.search("^row ?color=([^=]+)$", in_state):
+        elif re.search(r"^row ?color=([^=]+)$", in_state):
             table_data = re.sub(r'^row ?color=', '', in_state)
             row_style += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
-        elif re.search("^table ?bordercolor=([^=]+)$", in_state):
+        elif re.search(r"^table ?bordercolor=([^=]+)$", in_state):
             table_data = re.sub(r'^table ?bordercolor=', '', in_state)
             all_table += 'border: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ' 2px solid;'
-        elif re.search("^table ?bgcolor=([^=]+)$", in_state):
+        elif re.search(r"^table ?bgcolor=([^=]+)$", in_state):
             table_data = re.sub(r'^table ?bgcolor=', '', in_state)
             all_table += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
-        elif re.search("^table ?color=([^=]+)$", in_state):
+        elif re.search(r"^table ?color=([^=]+)$", in_state):
             table_data = re.sub(r'^table ?color=', '', in_state)
             all_table += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
-        elif re.search("^col ?bgcolor=([^=]+)$", in_state):
+        elif re.search(r"^col ?bgcolor=([^=]+)$", in_state):
             table_data = re.sub(r'^col ?bgcolor=', '', in_state)
             table_data = (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data)
             cel_color[cel_num] += 'background: ' + table_data + ';'
             cel_style += 'background: ' + table_data + ';'
-        elif re.search("^col ?color=([^=]+)$", in_state):
+        elif re.search(r"^col ?color=([^=]+)$", in_state):
             table_data = re.sub(r'^col ?color=', '', in_state)
             table_data = (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data)
             cel_color[cel_num] += 'color: ' + table_data + ';'
             cel_style += 'color: ' + table_data + ';'
-        elif re.search("^(bgcolor=([^=]+)|#(?:[0-9a-f-A-F]{3}){1,2}|\w+)$", in_state):
+        elif re.search(r"^(bgcolor=([^=]+)|#(?:[0-9a-f-A-F]{3}){1,2}|\w+)$", in_state):
             table_data = re.sub(r'^bgcolor=', '', in_state)
             cel_style += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
-        elif re.search("^color=([^=]+)$", in_state):
+        elif re.search(r"^color=([^=]+)$", in_state):
             table_data = re.sub(r'^color=', '', in_state)
             cel_style += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
-        elif re.search("^width=([^=]+)$", in_state):
+        elif re.search(r"^width=([^=]+)$", in_state):
             table_data = re.sub(r'^width=', '', in_state)
             cel_style += 'width: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
-        elif re.search("^height=([^=]+)$", in_state):
+        elif re.search(r"^height=([^=]+)$", in_state):
             table_data = re.sub(r'^height=', '', in_state)
             cel_style += 'height: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
         elif re.search(r'^\(|:|\)$', in_state):
@@ -153,8 +153,8 @@ def table_parser(data, cel_data, cel_num, start_data, num = 0, cel_color = {}):
                 cel_style += 'text-align: center;'
             else:
                 cel_style += 'text-align: left;'
-        elif re.search("^table ?class=([^=]+)$", in_state):
-            table_class += re.sub("^table ?class=", '', in_state)
+        elif re.search(r"^table ?class=([^=]+)$", in_state):
+            table_class += re.sub(r"^table ?class=", '', in_state)
 
     div_style += '"'
     all_table += '"'
@@ -498,7 +498,10 @@ def namumark(conn, data, title, include_num):
     nowiki_num = 0
     data = '\n' + data + '\n'
     include_num = include_num + '_' if include_num else ''
-    plus_data = 'get_link_state("' + include_num + '");\nget_file_state("' + include_num + '");\n'
+    plus_data = '' + \
+        'get_link_state("' + include_num + '");\n' + \
+        'get_file_state("' + include_num + '");\n' + \
+    ''
 
     backlink = []
     end_data = {}

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

@@ -38,12 +38,12 @@ def ip_check(d_type = 0):
     return str(ip)
 
 def savemark(data):
-    data = re.sub("\[date\(now\)\]", get_time(), data)
+    data = re.sub(r"\[date\(now\)\]", get_time(), data)
 
     ip = ip_check()
-    name = '[[user:' + ip + '|' + ip + ']]' if not re.search("\.|:", ip) else ip
+    name = '[[user:' + ip + '|' + ip + ']]' if not re.search(r"\.|:", ip) else ip
 
-    data = re.sub("\[name\]", name, data)
+    data = re.sub(r"\[name\]", name, data)
 
     return data
 

+ 2 - 2
route/topic.py

@@ -70,7 +70,7 @@ def topic_2(conn, topic_num):
         cate_re = re.compile(r'\[\[((?:분류|category):(?:(?:(?!\]\]).)*))\]\]', re.I)
         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(r"(?:#([0-9]+))", data):
             curs.execute(db_change("select ip from topic where code = ? and id = ?"), [topic_num, rd_data])
             ip_data = curs.fetchall()
             if ip_data and ip_or_user(ip_data[0][0]) == 0:
@@ -80,7 +80,7 @@ def topic_2(conn, topic_num):
                     today
                 ])
 
-        data = re.sub("(?P<in>#(?:[0-9]+))", '[[\g<in>]]', data)
+        data = re.sub(r"(?P<in>#(?:[0-9]+))", '[[\g<in>]]', data)
         data = savemark(data)
 
         rd_plus(topic_num, today, name, sub)

+ 4 - 4
route/view_read.py

@@ -30,7 +30,7 @@ def view_read_2(conn, name):
     else:
         down = 0
 
-    m = re.search("^(.*)\/(.*)$", name)
+    m = re.search(r"^(.*)\/(.*)$", name)
     if m:
         uppage = m.group(1)
     else:
@@ -136,9 +136,9 @@ def view_read_2(conn, name):
         if sql_d:
             end_data += '<h2>' + load_lang('history') + '</h2><ul>'
             for i in sql_d:
-                if re.search("\+", i[2]):
+                if re.search(r"\+", i[2]):
                     leng = '<span style="color:green;">(' + i[2] + ')</span>'
-                elif re.search("\-", i[2]):
+                elif re.search(r"\-", i[2]):
                     leng = '<span style="color:red;">(' + i[2] + ')</span>'
                 else:
                     leng = '<span style="color:gray;">(' + i[2] + ')</span>'
@@ -201,7 +201,7 @@ def view_read_2(conn, name):
 
     div = adsense_code + '<div>' + div + '</div>'
 
-    match = re.search("^user:([^/]*)", name)
+    match = re.search(r"^user:([^/]*)", name)
     if match:
         user_name = match.group(1)
         div = '''

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.8-master-24",
+        "r_ver" : "v3.1.8-master-25",
         "c_ver" : "3182000",
         "s_ver" : "8"
     }, "stable" : {