Skip to content

Commit 289e0cf

Browse files
authored
Merge pull request #32 from bhowiebkr/bug-fixing
Restructure project for better organization and Nuitka compilation
2 parents 1953be3 + bcd2feb commit 289e0cf

18 files changed

+57
-46
lines changed

.github/workflows/windows-build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,22 @@ jobs:
6565

6666
- name: Build app with Nuitka
6767
run: |
68+
cd src
6869
python -m nuitka `
6970
--standalone `
7071
--enable-plugin=pyside6 `
7172
--include-qt-plugins=platforms `
72-
--output-dir=NodeEditor_Build `
73-
--include-package=src `
73+
--output-dir=../NodeEditor_Build `
7474
--nofollow-import-to=tkinter,unittest,setuptools,pip,wheel `
7575
--windows-disable-console `
7676
--remove-output `
7777
--lto=yes `
78-
--include-data-dir=examples=examples `
78+
--include-data-dir=../examples=examples `
7979
--include-data-dir=resources=resources `
80-
--include-data-file=dark_theme.qss=dark_theme.qss `
80+
--include-data-file=../dark_theme.qss=dark_theme.qss `
8181
--assume-yes-for-downloads `
82-
src/main.py
82+
main.py
83+
cd ..
8384
8485
- name: Copy Python runtime after Nuitka build
8586
shell: pwsh

CLAUDE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
PyFlowGraph is a universal node-based visual scripting editor built with Python and PySide6. It allows users to create, connect, and execute Python code as nodes in a data-driven graph. The project follows a "Code as Nodes" philosophy where pins are automatically generated by parsing Python function signatures.
88

9+
# git and Github
10+
11+
- Don't ever add that it was generated with claude at the end of comments. This is bloat! Stop that!
12+
913
## Common Commands
1014

1115
### Running the Application
@@ -144,4 +148,4 @@ PyFlowGraph/
144148
- All nodes execute in isolated environments for security
145149
- Dependencies are managed via `requirements.txt` (PySide6, Nuitka for compilation)
146150

147-
- Don't add claude attribution to git commits
151+
- Don't add claude attribution to git commits
79.5 MB
Binary file not shown.

run.bat

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,17 @@ if not exist "%PYTHON_SCRIPT%" (
2525
exit /b 1
2626
)
2727

28+
rem Change to src directory so Python can find modules
29+
cd src
30+
2831
rem Execute the python script.
2932
rem Any arguments passed to run.bat will be passed to main.py
3033
rem For example: run.bat arg1 arg2
31-
echo Running %PYTHON_SCRIPT%...
32-
python "%PYTHON_SCRIPT%" %*
34+
echo Running main.py from src directory...
35+
python main.py %*
36+
37+
rem Return to original directory
38+
cd ..
3339

3440
rem Deactivate the virtual environment after the script finishes.
3541
call deactivate

run.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ if [ ! -f "$PYTHON_SCRIPT" ]; then
3131
exit 1
3232
fi
3333

34+
# Change to src directory so Python can find modules
35+
cd src
36+
3437
# Execute the python script.
3538
# Any arguments passed to run.sh will be passed to main.py
3639
# For example: ./run.sh arg1 arg2
37-
echo "Running $PYTHON_SCRIPT..."
38-
python "$PYTHON_SCRIPT" "$@"
40+
echo "Running main.py from src directory..."
41+
python main.py "$@"
42+
43+
# Return to original directory
44+
cd ..
3945

4046
# The script will automatically deactivate the venv when it exits.
4147
# You can also add 'deactivate' here if you have cleanup commands to run after.

src/code_editor_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from PySide6.QtWidgets import QDialog, QVBoxLayout, QDialogButtonBox, QTabWidget
66
from PySide6.QtGui import QFont
7-
from .python_code_editor import PythonCodeEditor
7+
from python_code_editor import PythonCodeEditor
88

99

1010
class CodeEditorDialog(QDialog):

src/execution_controller.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Execution controller for managing batch and live mode execution
33

44
from PySide6.QtWidgets import QPushButton, QLabel
5-
from .graph_executor import GraphExecutor
6-
from .event_system import LiveGraphExecutor
7-
from .ui_utils import ButtonStyleManager
5+
from graph_executor import GraphExecutor
6+
from event_system import LiveGraphExecutor
7+
from ui_utils import ButtonStyleManager
88

99

1010
class ExecutionController:

src/file_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
from PySide6.QtWidgets import QFileDialog
77
from PySide6.QtCore import QSettings
8-
from .flow_format import FlowFormatHandler, extract_title_from_filename
8+
from flow_format import FlowFormatHandler, extract_title_from_filename
99

1010

1111
class FileOperationsManager:

src/graph_executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import os
88
import sys
99
from collections import deque
10-
from .node import Node
11-
from .reroute_node import RerouteNode
10+
from node import Node
11+
from reroute_node import RerouteNode
1212

1313

1414
class GraphExecutor:

src/main.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44

55
import sys
66
import os
7-
8-
# Add project root to Python path so we can import from src
9-
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
10-
if project_root not in sys.path:
11-
sys.path.insert(0, project_root)
12-
137
from PySide6.QtWidgets import QApplication
148
from PySide6.QtCore import qInstallMessageHandler, QtMsgType
159
from PySide6.QtGui import QFontDatabase
16-
from src.node_editor_window import NodeEditorWindow
10+
from node_editor_window import NodeEditorWindow
1711

1812

1913
def custom_message_handler(mode, context, message):
@@ -33,7 +27,7 @@ def custom_message_handler(mode, context, message):
3327
app = QApplication(sys.argv)
3428

3529
# --- Load Font Awesome Regular ---
36-
font_path_regular = os.path.join(os.path.dirname(os.path.dirname(__file__)), "resources", "Font Awesome 7 Free-Regular-400.otf")
30+
font_path_regular = os.path.join(os.path.dirname(__file__), "resources", "Font Awesome 7 Free-Regular-400.otf")
3731
if os.path.exists(font_path_regular):
3832
font_id = QFontDatabase.addApplicationFont(font_path_regular)
3933
if font_id == -1:
@@ -44,7 +38,7 @@ def custom_message_handler(mode, context, message):
4438
print("Warning: Font Awesome Regular font file not found at 'resources/Font Awesome 7 Free-Regular-400.otf'", file=sys.stderr)
4539

4640
# --- Load Font Awesome Solid ---
47-
font_path_solid = os.path.join(os.path.dirname(os.path.dirname(__file__)), "resources", "Font Awesome 6 Free-Solid-900.otf")
41+
font_path_solid = os.path.join(os.path.dirname(__file__), "resources", "Font Awesome 6 Free-Solid-900.otf")
4842
if os.path.exists(font_path_solid):
4943
font_id = QFontDatabase.addApplicationFont(font_path_solid)
5044
if font_id == -1:
@@ -56,7 +50,7 @@ def custom_message_handler(mode, context, message):
5650

5751
# Load the dark theme stylesheet
5852
try:
59-
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "dark_theme.qss"), "r") as f:
53+
with open("dark_theme.qss", "r") as f:
6054
style = f.read()
6155
app.setStyleSheet(style)
6256
except FileNotFoundError:

0 commit comments

Comments
 (0)