re 修复

This commit is contained in:
Mr Chen 2024-12-08 22:41:10 +08:00
parent f50be939f5
commit d75c729e29
4 changed files with 5 additions and 5 deletions

View File

@ -215,7 +215,7 @@ class gdriveclient():
print("data_type 类型错误!!!")
exit(1)
file_regx = prefix_dict.get(data_type) + "_(.+)_20\d+_\d+\."
file_regx = prefix_dict.get(data_type) + r"_(.+)_20\d+_\d+\."
sub_search = re.search(file_regx.lower(), file_name)
sub_path_name = ""
if sub_search:

View File

@ -154,7 +154,7 @@ def initdUinstall():
def runLog():
path = getConf()
content = mw.readFile(path)
rep = 'log\s*=\s*(.*)'
rep = r'log\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0]

View File

@ -307,7 +307,7 @@ def getPhpConf(version):
phpini = mw.readFile(getConf(version))
result = []
for g in gets:
rep = g['name'] + '\s*=\s*([0-9A-Za-z_& ~]+)(\s*;?|\r?\n)'
rep = g['name'] + r'\s*=\s*([0-9A-Za-z_& ~]+)(\s*;?|\r?\n)'
tmp = re.search(rep, phpini)
if not tmp:
continue
@ -326,7 +326,7 @@ def submitPhpConf(version):
phpini = mw.readFile(filename)
for g in gets:
if g in args:
rep = g + '\s*=\s*(.+)\r?\n'
rep = g + r'\s*=\s*(.+)\r?\n'
val = g + ' = ' + args[g] + '\n'
phpini = re.sub(rep, val, phpini)
mw.writeFile(filename, phpini)

View File

@ -578,7 +578,7 @@ class App:
# 转换时间格式
def __to_date(self, date_str):
tmp = re.split('\s+', date_str)
tmp = re.split(r'\s+', date_str)
s_date = str(datetime.now().year) + '-' + \
self.__months.get(tmp[0]) + '-' + tmp[1] + ' ' + tmp[2]
time_array = time.strptime(s_date, "%Y-%m-%d %H:%M:%S")