feat: update
This commit is contained in:
parent
ec4b4f5e41
commit
1f51b32cf0
|
@ -19,6 +19,7 @@
|
|||
# Copyright (c) 2022- donkey <anjingyu_ws@foxmail.com>
|
||||
|
||||
import os
|
||||
import json
|
||||
import platform
|
||||
import tkinter as tk
|
||||
import tkinter.filedialog
|
||||
|
@ -218,7 +219,23 @@ class App(ttk.Window):
|
|||
pass
|
||||
|
||||
def __start(self):
|
||||
pass
|
||||
"""Generate the JSON file"""
|
||||
checked = self.tv.get_checked()
|
||||
if len(checked) == 0:
|
||||
return
|
||||
|
||||
result = {}
|
||||
for idd in checked:
|
||||
msgid, sig = idd.split('.')
|
||||
msg = self.__msgs[int(msgid)][0]
|
||||
|
||||
if msgid in result:
|
||||
result[msgid]['sigs'].append(sig)
|
||||
else:
|
||||
result[msgid] = {'name': msg.name, 'sigs': [sig]}
|
||||
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
|
||||
def __select_item(self, event):
|
||||
assert event.widget == self.tv
|
||||
|
@ -267,7 +284,7 @@ class App(ttk.Window):
|
|||
if platform.system() == "Linux":
|
||||
style = ttk.Style()
|
||||
style.configure("Custom.Treeview",
|
||||
font=("Noto Sans Mono CJK SC", 14, "normal"),
|
||||
font=("Noto Sans Mono CJK SC", 12, "normal"),
|
||||
rowheight=20)
|
||||
|
||||
self.tv.configure(style="Custom.Treeview")
|
||||
|
@ -315,7 +332,7 @@ class App(ttk.Window):
|
|||
self._btn_frame = ttk.Frame(master=self.main_frame)
|
||||
self._btn_frame.grid(row=1, column=0, padx=1, pady=1, sticky=NSEW)
|
||||
self.__upload_btn = ttk.Button(self._btn_frame,
|
||||
text="Update",
|
||||
text="Generate",
|
||||
bootstyle="success-outline",
|
||||
command=self.__start)
|
||||
self.__upload_btn.pack(side=RIGHT, padx=5, pady=5)
|
||||
|
|
Loading…
Reference in New Issue