diff --git a/plugins/gdrive/class/gdriveclient.py b/plugins/gdrive/class/gdriveclient.py index 349098cf3..d71f1e446 100644 --- a/plugins/gdrive/class/gdriveclient.py +++ b/plugins/gdrive/class/gdriveclient.py @@ -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: diff --git a/plugins/lvs/index.py b/plugins/lvs/index.py index e1f43e370..68683bd6c 100755 --- a/plugins/lvs/index.py +++ b/plugins/lvs/index.py @@ -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] diff --git a/plugins/php-yum/index.py b/plugins/php-yum/index.py index edae3a4b8..495332244 100755 --- a/plugins/php-yum/index.py +++ b/plugins/php-yum/index.py @@ -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) diff --git a/plugins/system_safe/system_safe.py b/plugins/system_safe/system_safe.py index d0f0352d1..62efb4e06 100755 --- a/plugins/system_safe/system_safe.py +++ b/plugins/system_safe/system_safe.py @@ -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")