Commit 7703fa6c authored by wanli's avatar wanli

update

parent 7b9da4f1
......@@ -2,6 +2,7 @@
# -*- coding: utf_8 -*-
import os
import re
import copy
import time
import types
......@@ -57,9 +58,14 @@ class BuildLogsManager(object):
app_files = []
for sf in source_files:
parsed_result = urlparse(sf.path)
target_file = os.sep.join([config.get("UPLOAD_PATH"), parsed_result.path.replace('\\', '/')])
shutil.move(os.path.normpath(target_file), os.path.normpath(dest_dir))
app_files.append([sf.id, os.sep.join([dest_dir, os.path.basename(parsed_result.path)])])
target_file = os.sep.join([config.get("UPLOAD_PATH"), parsed_result.path.replace('\\', ' / ')])
filename = os.path.basename(target_file)
name, suffix = os.path.splitext(filename)
name = re.sub(r"_\d{14}$", "", name)
dst_file = os.path.normpath(os.sep.join([dest_dir, name + suffix]))
shutil.move(os.path.normpath(target_file), dst_file)
app_files.append([sf.id, dst_file])
# if os.path.exists(target_file):
# shutil.move(target_file, dest_dir)
# app_files.append([sf.id, os.sep.join([dest_dir, os.path.basename(parsed_result.path)])])
......
......@@ -2,6 +2,7 @@
# -*- coding: utf_8 -*-
import os
import re
import copy
import time
import types
......@@ -146,7 +147,10 @@ class DownloadManager(object):
if not os.path.exists(tf):
return False, "{} not found".format(tf)
shutil.copy(tf, build_source_path)
filename = os.path.basename(tf)
name, suffix = os.path.splitext(filename)
name = re.sub(r"_\d{14}$", "", name)
shutil.copy(tf, os.sep.join([build_source_path, name + suffix]))
if len(temp) % 4 == 0 and temp:
result_json.append(copy.deepcopy(temp))
......
......@@ -62,7 +62,7 @@ def get():
# 读取epk文件,按照格式返回相应结构体数据
ret = ""
if os.path.exists(result):
with open(result, "r", encoding="utf-8") as f:
with open(result, "r") as f:
ret = f.read()
return ret
except Exception as e:
......
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 to comment