File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ jobs:
124124 uses : pypa/gh-action-pypi-publish@release/v1
125125
126126 build-executable :
127- name : Build executable - vuegen_gui_${{ matrix.os.label }}
127+ name : Build-exe- vuegen_gui_${{ matrix.os.label }}
128128 runs-on : ${{ matrix.os.runner }}
129129 needs :
130130 - test
@@ -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 app.py
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
156156 - name : Upload executable
157157 uses : actions/upload-artifact@v4
158158 with :
Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ as the streamlit server and the GUI itself.
2929# from this README folder
3030pyinstaller \
3131-n vuegen_gui \
32- --no-confirm \
32+ --noconfirm \
3333--onedir \
3434--collect-all pyvis \
3535--collect-all streamlit \
3636--collect-all st_aggrid \
3737--collect-all customtkinter \
38+ --add-data ../docs/example_data/Basic_example_vuegen_demo_notebook:example_data/Basic_example_vuegen_demo_notebook \
3839app.py
3940```
Original file line number Diff line number Diff line change 2121
2222import sys
2323import tkinter as tk
24+ from pathlib import Path
2425
2526import customtkinter
2627
3031customtkinter .set_appearance_mode ("system" )
3132customtkinter .set_default_color_theme ("dark-blue" )
3233
34+ app_path = Path (__file__ ).absolute ()
35+ print ("app_path:" , app_path )
36+
37+ if getattr (sys , "frozen" , False ) and hasattr (sys , "_MEIPASS" ):
38+ # PyInstaller bundeled case
39+ path_to_dat = (
40+ app_path .parent / "example_data/Basic_example_vuegen_demo_notebook"
41+ ).resolve ()
42+ elif app_path .parent .name == "gui" :
43+ # should be always the case for GUI run from command line
44+ path_to_dat = (
45+ app_path .parent
46+ / ".."
47+ / "docs"
48+ / "example_data"
49+ / "Basic_example_vuegen_demo_notebook"
50+ ).resolve ()
51+ else :
52+ path_to_dat = "docs/example_data/Basic_example_vuegen_demo_notebook"
53+
3354
3455##########################################################################################
3556# callbacks
@@ -96,7 +117,7 @@ def radio_button_callback():
96117)
97118ctk_radio_config_1 .grid (row = 1 , column = 1 , padx = 20 , pady = 2 )
98119
99- config_path = tk .StringVar ()
120+ config_path = tk .StringVar (value = str ( path_to_dat ) )
100121config_path_entry = customtkinter .CTkEntry (
101122 app ,
102123 width = 400 ,
You can’t perform that action at this time.
0 commit comments