|
|
|
|
@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
|
|
|
|
|
import redis,sys,os |
|
|
|
|
import redis,sys,os,re |
|
|
|
|
import platform |
|
|
|
|
if platform.system() == 'Windows': |
|
|
|
|
#sys.path.append('e:\\libs\\') |
|
|
|
|
@ -94,3 +94,20 @@ def copy_remote_directory(remote_host, remote_path, local_path):
@@ -94,3 +94,20 @@ def copy_remote_directory(remote_host, remote_path, local_path):
|
|
|
|
|
# if __name__ == '__main__': |
|
|
|
|
# redis_conn = config.redis_local_common |
|
|
|
|
# print(redis_conn.sismember("photo3_no","1")) |
|
|
|
|
|
|
|
|
|
#读取rcbox文件进行修改指定的值 |
|
|
|
|
|
|
|
|
|
def change_rcbox_s(pid,new_value): |
|
|
|
|
rcbox_path = os.path.join(config.workdir, pid, f"{pid}.rcbox") |
|
|
|
|
old_value_pattern = r'<Residual s="([^"]+)"' |
|
|
|
|
#读取文件内容 |
|
|
|
|
with open(rcbox_path, 'r') as f: |
|
|
|
|
content = f.read() |
|
|
|
|
#使用正则表达式进行匹配 |
|
|
|
|
match = re.search(old_value_pattern,content) |
|
|
|
|
if match: |
|
|
|
|
old_value = match.group(1) |
|
|
|
|
new_content = re.sub(old_value_pattern,f'<Residual s="{new_value}"',content) |
|
|
|
|
#重新写入进去 |
|
|
|
|
with open(rcbox_path, 'w') as f: |
|
|
|
|
f.write(new_content) |