dev
This commit is contained in:
+4
-2
@@ -27,7 +27,7 @@ class Pattern:
|
||||
num = int(content)
|
||||
return self.sec_range(num)
|
||||
except:
|
||||
logger.debug ("[wait_msg]:模板内容错误:{}".format(content))
|
||||
logger.debug ("模板内容错误:{}".format(content))
|
||||
return None
|
||||
|
||||
def extract(self,o_str:str):
|
||||
@@ -38,14 +38,16 @@ class Pattern:
|
||||
# 对结果和源字符串处理
|
||||
o_str = o_str.replace(i.group(),"",1)
|
||||
num = self.load(i.group())
|
||||
logger.info("获得模板:{0}s".format(i.group()))
|
||||
|
||||
if num and timerSec:
|
||||
timerSec = num
|
||||
#消除不完整/非法模板
|
||||
o_str= o_str.replace("<wt>","")
|
||||
o_str=o_str.replace("</wt>","")
|
||||
|
||||
logger.info("[wait_msg]:获得模板:{0}s".format(timerSec))
|
||||
return {
|
||||
"content":o_str,
|
||||
"second":timerSec
|
||||
}
|
||||
print(Pattern("awdwadawd<wt>ada</wt>"))
|
||||
|
||||
Reference in New Issue
Block a user