Commit 74015538 authored by mayinghao's avatar mayinghao

工厂上传添加已上传文件列表和刷新按钮

parent 1b68d653
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.8" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/emuafactory.iml" filepath="$PROJECT_DIR$/.idea/emuafactory.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
gAAAAABojF59CopXg1XOHp_3Aqu-KhwMznMHPpFxaoIcxHTQ25IJATEiYr0LPIqGe5hwsT0D1vNEAx4pCitPCCin7RWNs87DHIRVzOvc59yfHzfrurOZrqCiKbBRRwBbKCwihqB6OU-kfBwGukNfIW7CkWBKr6pw600G9M0Tv81fz9o45QmPdhM2M0OOBBX4dTWTNHvdPCGdGKQAx5kbPJo_T1-ovr_CEw==
\ No newline at end of file
This diff is collapsed.
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
......@@ -15,7 +15,7 @@ class Upload_Thread(QObject):
#自定义信号声明
# 使用自定义信号和UI主线程通讯,参数是发送信号时附带参数的数据类型,可以是str、int、list等
finishSignal = pyqtSignal(str)
finishSignal = pyqtSignal()
updateSignal = pyqtSignal(tuple)
def __init__(self, thread_num=0, order_id=None, type_info=None, token=""):
......@@ -105,7 +105,6 @@ class Upload_Thread(QObject):
self.send_data = 0
upload_id = bucket.init_multipart_upload(oss_key).upload_id
print(upload_id)
with open("./upload_tag/tmp_" + key + ".json", "w+") as f:
json.dump({upload_id: [self.filename, self.order_id, self.type_info, self.uuid_str, self.total_size]}, f)
......@@ -113,7 +112,6 @@ class Upload_Thread(QObject):
if os.path.exists(self.filename):
total_size = os.path.getsize(self.filename)
print(total_size)
circle = total_size // part_size
# 最后一包数据
left_bytes = total_size % part_size
......@@ -158,6 +156,10 @@ class Upload_Thread(QObject):
headers = {'token': self.token,
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"}
try:
response = requests.post(callback_url, data=datas,headers=headers)
res = response.json()
print(res["obj"])
self.finishSignal.emit()
except Exception as e:
print("wrong")
LnqGFP4d04AjE2AyhG9kPERz94o9xkDgKSP0teA05d8=
\ No newline at end of file
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