Commit 13cfef5b by 陈森彬

参数的特殊情况

parent 8de26270
Showing with 6 additions and 5 deletions
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
import re import re
from config import unit_map, cast_map, unit_regex, special_tuple, encap_list, temp_map, special_str, encap_regex from config import unit_map, cast_map, unit_regex, special_tuple, encap_list, temp_map, special_str, encap_regex
unit_pattern = re.compile('(\d+|\d+[\\\./?]\d+)(' + unit_regex + ')([.a-zA-Z\\-]?)') unit_pattern = re.compile('([.a-zA-Z\\-]?)(\d+|\d+[\\\./?]\d+)(' + unit_regex + ')([.a-zA-Z\\-]?)')
encap_pattern = re.compile('.*('+encap_regex+').*') encap_pattern = re.compile('.*(' + encap_regex + ').*')
def is_float(s): def is_float(s):
...@@ -66,8 +66,9 @@ def check_param(kw): ...@@ -66,8 +66,9 @@ def check_param(kw):
else: else:
new_list = [] new_list = []
for param in check_res: for param in check_res:
if not param[2].isalpha() and param[2] not in special_tuple: if not param[0].isalpha() and param[0] not in special_tuple and not param[3].isalpha() and param[
new_list.append(param[0] + param[1]) 3] not in special_tuple:
new_list.append(param[1] + param[2])
check_res = new_list check_res = new_list
return check_res return check_res
......
...@@ -132,7 +132,7 @@ class UCHandler(tornado.web.RequestHandler): ...@@ -132,7 +132,7 @@ class UCHandler(tornado.web.RequestHandler):
if check_temp(kw_info): if check_temp(kw_info):
attrs_list.append(kw_info) attrs_list.append(kw_info)
else: else:
encap_res = check_encap(kw) encap_res = check_encap(kw_info)
if encap_res: if encap_res:
encap_list.append(encap_res[0]) encap_list.append(encap_res[0])
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment