84 lines
2.3 KiB
Plaintext
84 lines
2.3 KiB
Plaintext
|
# -*- mode: python ; coding: utf-8 -*-
|
|||
|
import sys
|
|||
|
import shutil
|
|||
|
import os
|
|||
|
import tarfile
|
|||
|
sys.setrecursionlimit(5000)
|
|||
|
|
|||
|
block_cipher = None
|
|||
|
|
|||
|
#######begin-<2D><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>##############
|
|||
|
#<23><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>tool<6F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>滻<EFBFBD><E6BBBB><EFBFBD><EFBFBD>ǰ·<C7B0><C2B7><EFBFBD>µ<EFBFBD>tool
|
|||
|
# <20><><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>
|
|||
|
cwdpath = os.getcwd()
|
|||
|
tool_path = ''
|
|||
|
src = '../tool'
|
|||
|
des = os.path.join(cwdpath, "tool")
|
|||
|
targz_path = os.path.join(cwdpath, "tool.tar.gz")
|
|||
|
#<23><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
if os.path.exists(des):
|
|||
|
if os.path.isdir(des):
|
|||
|
shutil.rmtree(des)
|
|||
|
os.makedirs(des)
|
|||
|
#ѹ<><D1B9>
|
|||
|
dir = os.path.split(targz_path )[0]
|
|||
|
if os.path.exists(dir) is False:
|
|||
|
os.makedirs(dir)
|
|||
|
with tarfile.open(targz_path, "w:gz") as tar:
|
|||
|
tar.add(src, arcname=os.path.basename(src))
|
|||
|
#<23><>ѹ
|
|||
|
t = tarfile.open(targz_path)
|
|||
|
t.extractall(path=cwdpath)
|
|||
|
#ɾ<><C9BE><EFBFBD><EFBFBD>ʱѹ<CAB1><D1B9><EFBFBD><EFBFBD>
|
|||
|
#os.remove(targz_path)
|
|||
|
|
|||
|
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
main_name = ''
|
|||
|
for name in os.listdir(cwdpath):
|
|||
|
if 'Main.py' in name:
|
|||
|
main_name = name
|
|||
|
exe_name = exe_name = main_name .split('.')[0][:-4] + '-C-SAR-V2.0'
|
|||
|
#######end-<2D><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>##############
|
|||
|
|
|||
|
a = Analysis(['VegetationHeightMain.py',
|
|||
|
'./tool/algorithm/algtools/ScatteringAuxData.py',
|
|||
|
'./tool/algorithm/algtools/CoordinateTransformation.py',
|
|||
|
'./tool/algorithm/algtools/DEMJoint.py',
|
|||
|
'./tool/algorithm/algtools/logHandler.py',
|
|||
|
'./tool/algorithm/algtools/PreProcess.py',
|
|||
|
'./tool/algorithm/algtools/RieveFilter.py',
|
|||
|
'./tool/algorithm/algtools/ROIAlg.py',
|
|||
|
'./tool/algorithm/block/blockprocess.py',
|
|||
|
'./tool/algorithm/image/ImageHandle.py',
|
|||
|
'./tool/algorithm/xml/AlgXmlHandle.py',
|
|||
|
'./tool/algorithm/xml/CreatMetafile.py',
|
|||
|
'./tool/config/ConfigeHandle.py',
|
|||
|
'./tool/logs/logHandler.py',],
|
|||
|
pathex=[cwdpath],
|
|||
|
binaries=[],
|
|||
|
datas=[],
|
|||
|
hiddenimports=[],
|
|||
|
hookspath=[],
|
|||
|
runtime_hooks=[],
|
|||
|
excludes=[],
|
|||
|
win_no_prefer_redirects=False,
|
|||
|
win_private_assemblies=False,
|
|||
|
cipher=block_cipher,
|
|||
|
noarchive=False)
|
|||
|
pyz = PYZ(a.pure, a.zipped_data,
|
|||
|
cipher=block_cipher)
|
|||
|
exe = EXE(pyz,
|
|||
|
a.scripts,
|
|||
|
a.binaries,
|
|||
|
a.zipfiles,
|
|||
|
a.datas,
|
|||
|
[],
|
|||
|
name='VegetationHeight-L-SAR-V2.1.exe',
|
|||
|
debug=False,
|
|||
|
bootloader_ignore_signals=False,
|
|||
|
strip=False,
|
|||
|
upx=True,
|
|||
|
upx_exclude=[],
|
|||
|
runtime_tmpdir=None,
|
|||
|
console=True )
|