Skip to content

Commit

Permalink
v0.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
USTHzhanglu committed Nov 1, 2023
1 parent 54651d3 commit cc78aaf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
18 changes: 5 additions & 13 deletions build/probe-rs-gui-alone.spec
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(
['../src/probe-rs-gui.py'],
['..\\src\\probe-rs-gui.py'],
pathex=[],
binaries=[],
datas=[('./probe-rs.exe','./'),

],
datas=[('../src/probe-rs.exe','.')],

hiddenimports=[],
hookspath=[],
hooksconfig={},
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)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='probe-rs-gui',
Expand All @@ -37,7 +29,7 @@ exe = EXE(
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
Expand Down
2 changes: 1 addition & 1 deletion build/probe-rs-gui.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ a = Analysis(
['..\\src\\probe-rs-gui.py'],
pathex=[],
binaries=[],
datas=[],
datas=[('../src/probe-rs.exe','.')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
Expand Down
15 changes: 12 additions & 3 deletions src/probe-rs-gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@
import webbrowser
import yaml

app_path = os.getcwd()
import os
import sys
#生成资源文件目录访问路径
def app_path():
if getattr(sys, 'frozen', False): #是否Bundle Resource
base_path = sys._MEIPASS
else:
base_path = os.path.abspath(".")
return base_path

version = '0.0.1'
author = '[email protected]'
copyright = 'USTHzhanglu'
Expand Down Expand Up @@ -57,7 +66,7 @@ def download_bin(ui):
try:
ret = ''
#probe-rs download --chip HC32F4A0PIHB --chip-description-path .\HC32F4A0-Series.yaml --format bin --speed 16000 bootloader.bin
cmd = app_path + '\probe-rs download ' + \
cmd = app_path() + '\probe-rs download ' + \
'--chip %s '%cfg.chip + '--chip-description-path %s '%cfg.pack_yaml + \
'--speed %s '%cfg.speed + '--format %s '%cfg.format + cfg.bin_path
# print(cmd)
Expand All @@ -80,7 +89,7 @@ def erase_bin(ui):
try:
ret = ''
#probe-rs erase --chip HC32F4A0PIHB --chip-description-path .\HC32F4A0-Series.yaml
cmd = app_path + '\probe-rs erase ' + \
cmd = app_path() + '\probe-rs erase ' + \
'--chip %s '%cfg.chip + '--chip-description-path %s '%cfg.pack_yaml
# print(cmd)
ret = os.popen(cmd).read()
Expand Down

0 comments on commit cc78aaf

Please sign in to comment.