Skip to content

Commit d46bc02

Browse files
committed
🐛 add bundle dependencies, RadioButton toggle
- radiobutton values are not correctly used in bundled app when built in runner - works locally (woth local bundle, and direct execution of app)
1 parent fb6d368 commit d46bc02

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.github/workflows/cdci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
- name: Build executable
153153
run: |
154154
cd gui
155-
pyinstaller -n vuegen_gui -D --collect-all pyvis --collect-all streamlit --collect-all st_aggrid --collect-all customtkinter --add-data ../docs/example_data/Basic_example_vuegen_demo_notebook:example_data/Basic_example_vuegen_demo_notebook app.py
155+
pyinstaller -n vuegen_gui -D --collect-all pyvis --collect-all streamlit --collect-all st_aggrid --collect-all customtkinter --collect-all quarto_cli --collect-all jupyter_core --collect-all yaml --collect-all ipykernel --collect-all nbconvert --collect-all notebook --collect-all ipywidgets --collect-all jupyter_console --collect-all jupyter_client -add-data ../docs/example_data/Basic_example_vuegen_demo_notebook:example_data/Basic_example_vuegen_demo_notebook app.py
156156
python copy_python_executable.py
157157
- name: Upload executable
158158
uses: actions/upload-artifact@v4

gui/app.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@
5959
def create_run_vuegen(is_dir, config_path, report_type, run_streamlit):
6060
def inner():
6161
args = ["vuegen"]
62+
print(f"{is_dir.get() = }")
6263
if is_dir.get():
6364
args.append("--directory")
6465
else:
6566
args.append("--config")
6667
args.append(config_path.get())
6768
args.append("--report_type")
6869
args.append(report_type.get())
70+
print(f"{run_streamlit.get() = }")
6971
if run_streamlit.get():
7072
args.append("--streamlit_autorun")
7173
print("args:", args)
@@ -80,9 +82,9 @@ def optionmenu_callback(choice):
8082
print("optionmenu dropdown clicked:", choice)
8183

8284

83-
def radiobutton_event(value):
85+
def radiobutton_event(value, name="radiobutton"):
8486
def radio_button_callback():
85-
print("radiobutton toggled, current value:", value.get())
87+
print(f"{name} toggled, current value:", value.get())
8688

8789
return radio_button_callback
8890

@@ -100,22 +102,22 @@ def radio_button_callback():
100102
text="Add path to config file or directory. Select radio button accordingly",
101103
)
102104
ctk_label_config.grid(row=0, column=0, columnspan=2, padx=20, pady=20)
103-
is_dir = tk.IntVar(value=1)
104-
callback_radio_config = radiobutton_event(is_dir)
105+
is_dir = tk.BooleanVar(value=True)
106+
callback_radio_config = radiobutton_event(is_dir, name="is_dir")
105107
ctk_radio_config_0 = customtkinter.CTkRadioButton(
106108
app,
107109
text="Use config",
108110
command=callback_radio_config,
109111
variable=is_dir,
110-
value=0,
112+
value=False,
111113
)
112114
ctk_radio_config_0.grid(row=1, column=0, padx=20, pady=2)
113115
ctk_radio_config_1 = customtkinter.CTkRadioButton(
114116
app,
115117
text="Use dir",
116118
command=callback_radio_config,
117119
variable=is_dir,
118-
value=1,
120+
value=True,
119121
)
120122
ctk_radio_config_1.grid(row=1, column=1, padx=20, pady=2)
121123

@@ -150,20 +152,20 @@ def radio_button_callback():
150152

151153
##########################################################################################
152154
# Run Streamlit radio button
153-
run_streamlit = tk.IntVar(value=1)
154-
callback_radio_st_run = radiobutton_event(run_streamlit)
155+
run_streamlit = tk.BooleanVar(value=True)
156+
callback_radio_st_run = radiobutton_event(run_streamlit, name="run_streamlit")
155157
ctk_radio_st_autorun_1 = customtkinter.CTkRadioButton(
156158
app,
157159
text="autorun streamlit",
158-
value=1,
160+
value=True,
159161
variable=run_streamlit,
160162
command=callback_radio_st_run,
161163
)
162164
ctk_radio_st_autorun_1.grid(row=5, column=0, padx=20, pady=20)
163165
ctk_radio_st_autorun_0 = customtkinter.CTkRadioButton(
164166
app,
165167
text="skip starting streamlit",
166-
value=0,
168+
value=False,
167169
variable=run_streamlit,
168170
command=callback_radio_st_run,
169171
)

0 commit comments

Comments
 (0)