Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
编程深海AiKoder
nrfx_tool
提交
f2c40464
N
nrfx_tool
项目概览
编程深海AiKoder
/
nrfx_tool
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nrfx_tool
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f2c40464
编写于
12月 13, 2021
作者:
编程深海AiKoder
🚴🏻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
b9e59bd6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
8 deletion
+41
-8
config/__init__.py
config/__init__.py
+0
-0
gui/app.py
gui/app.py
+3
-4
gui/dfu_image_generator.py
gui/dfu_image_generator.py
+38
-4
gui/setting.py
gui/setting.py
+0
-0
未找到文件。
config/__init__.py
已删除
100644 → 0
浏览文件 @
b9e59bd6
gui/app.py
浏览文件 @
f2c40464
...
@@ -5,11 +5,10 @@
...
@@ -5,11 +5,10 @@
import
sys
import
sys
from
PyQt6.QtGui
import
QIcon
from
PyQt6.QtGui
import
QIcon
from
PyQt6.QtWidgets
import
QApplication
,
QLabel
,
QMainWindow
,
QTabWidget
,
QTextEdit
,
QVBoxLayout
,
QWidget
from
PyQt6.QtWidgets
import
(
QApplication
,
QLabel
,
QMainWindow
,
QTabWidget
,
QTextEdit
,
QVBoxLayout
,
QWidget
)
from
dfu_image_generator
import
DfuImageGenerator
from
dfu_image_generator
import
DfuImageGenerator
from
setting
import
Settings
sys
.
path
.
append
(
'..'
)
from
config.setting
import
Settings
class
NrfxToolbox
(
QMainWindow
):
class
NrfxToolbox
(
QMainWindow
):
...
...
gui/dfu_image_generator.py
浏览文件 @
f2c40464
#!/usr/bin/env python
#!/usr/bin/env python
from
PyQt6.QtGui
import
QTextLine
import
sys
from
PyQt6.QtWidgets
import
(
QComboBox
,
QGridLayout
,
QHBoxLayout
,
QLineEdit
,
from
PyQt6.QtWidgets
import
(
QComboBox
,
QGridLayout
,
QLineEdit
,
QPushButton
,
QPushButton
,
QTextEdit
,
QVBoxLayout
,
QWidget
,
QVBoxLayout
,
QWidget
,
QLabel
,
QTabWidget
)
QLabel
,
QTabWidget
)
sys
.
path
.
append
(
'..'
)
from
click.testing
import
CliRunner
from
nordicsemi
import
__main__
from
pathlib
import
Path
runner
=
CliRunner
()
cli
=
__main__
.
cli
# 获取根目录
root_dir
=
Path
.
cwd
().
parent
print
(
root_dir
)
# 创建输出目录
output_dir
=
'../_out/'
print
(
output_dir
)
if
root_dir
.
joinpath
(
'_out'
).
exists
():
print
(
'_out is exit.'
)
else
:
print
(
'create a new '
)
root_dir
.
joinpath
(
'_out'
).
mkdir
(
parents
=
False
,
exist_ok
=
False
)
class
DfuImageGenerator
(
QWidget
):
class
DfuImageGenerator
(
QWidget
):
...
@@ -40,6 +59,7 @@ class DfuImageGenerator(QWidget):
...
@@ -40,6 +59,7 @@ class DfuImageGenerator(QWidget):
class
GenerateKeyTab
(
QWidget
):
class
GenerateKeyTab
(
QWidget
):
def
__init__
(
self
,
parent
):
def
__init__
(
self
,
parent
):
super
(
GenerateKeyTab
,
self
).
__init__
(
parent
)
super
(
GenerateKeyTab
,
self
).
__init__
(
parent
)
self
.
init_ui
()
self
.
init_ui
()
def
init_ui
(
self
):
def
init_ui
(
self
):
...
@@ -65,9 +85,23 @@ class GenerateKeyTab(QWidget):
...
@@ -65,9 +85,23 @@ class GenerateKeyTab(QWidget):
def
gen_btn_handler
(
self
):
def
gen_btn_handler
(
self
):
print
(
'gen_btn_handler'
)
print
(
'gen_btn_handler'
)
out_file
=
'../_out/key.pem'
print
(
out_file
)
result
=
runner
.
invoke
(
cli
,
[
'keys'
,
'generate'
,
out_file
])
print
(
result
.
output
)
print
(
result
.
exit_code
)
#self.assertIsNone(result.exception)
def
dis_btn_handler
(
self
):
def
dis_btn_handler
(
self
):
print
(
'gen_btn_handler'
)
print
(
'gen_btn_handler'
)
key_file
=
'../_out/key.pem'
key_file_c
=
'../_out/dfu_public_key.c'
result
=
runner
.
invoke
(
cli
,
[
'keys'
,
'display'
,
'--key'
,
'pk'
,
'--format'
,
'code'
,
key_file
,
'--out_file'
,
key_file_c
])
print
(
result
.
output
)
print
(
result
.
exit_code
)
def
rst_btn_handler
(
self
):
def
rst_btn_handler
(
self
):
print
(
'gen_btn_handler'
)
print
(
'gen_btn_handler'
)
...
...
config
/setting.py
→
gui
/setting.py
浏览文件 @
f2c40464
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录