Skip to content

Commit e576977

Browse files
committed
bugfix: Fix import error in nuitka bulid after updating pygubu
1 parent d8c772d commit e576977

File tree

6 files changed

+35
-23
lines changed

6 files changed

+35
-23
lines changed

custom-nuitka-package.config.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,13 @@
4646
- 'pygubu.plugins.pygubu.dialog'
4747
- 'pygubu.plugins.pygubu.pathchooserinput'
4848
- 'pygubu.plugins.pygubu.combobox'
49-
when: 'version("pygubu") > (0, 24)'
50-
49+
when: '(0, 36) > version("pygubu") >= (0, 24)'
50+
- depends:
51+
- 'pygubu.plugins.tk.tkstdwidgets'
52+
- 'pygubu.plugins.ttk.ttkstdwidgets'
53+
- 'pygubu.plugins.pygubu.scrollbarhelper_bo'
54+
- 'pygubu.plugins.pygubu.dialog_bo'
55+
- 'pygubu.plugins.pygubu.pathchooserinput_bo'
56+
- 'pygubu.plugins.pygubu.combobox_bo'
57+
when: 'version("pygubu") >= (0, 36)'
58+

customwidgets/builder.py renamed to customwidgets_builder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
from pygubu import BuilderObject, register_widget # type: ignore
2727

2828
try:
29-
from wrapmessage import WrapMessage
30-
from checkablelabelframe import CheckableLabelFrame
29+
from customwidgets.wrapmessage import WrapMessage
30+
from customwidgets.checkablelabelframe import CheckableLabelFrame
3131
except ModuleNotFoundError:
32-
from .wrapmessage import WrapMessage
33-
from .checkablelabelframe import CheckableLabelFrame
32+
from .customwidgets.wrapmessage import WrapMessage
33+
from .customwidgets.checkablelabelframe import CheckableLabelFrame
3434

3535
class WrapMessageBuilder(BuilderObject): # type: ignore
3636
class_ = WrapMessage

nbstool.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@
7373
from pygubu import Builder
7474
# Explict imports for PyInstaller
7575
# from pygubu.builder import tkstdwidgets, ttkstdwidgets
76-
from pygubu.widgets import dialog, pathchooserinput
76+
from pygubu.widgets import dialog, pathchooserinput, tkscrollbarhelper
7777
from pygubu.widgets.dialog import Dialog
7878
from pygubu.widgets.pathchooserinput import PathChooserInput
7979
from pygubu.widgets.combobox import Combobox as PygubuCombobox
8080
from PIL import Image
8181
from coloraide import Color
8282

8383
# Explict import for Nuitka
84-
import customwidgets.builder
84+
import customwidgets_builder
8585

8686
from common import BASE_RESOURCE_PATH, resource_path
8787

@@ -91,7 +91,7 @@
9191
# Ensure pydub.utils.which can splits the added ffmpeg path properly
9292
# Fix for the issue #10
9393
if not os.environ["PATH"].endswith(os.pathsep):
94-
os.environ["PATH"] += os.pathsep
94+
os.environ["PATH"] += os.pathsep
9595
# Add the path of the ffmpeg before the first pydub import statement
9696
os.environ["PATH"] += resource_path('ffmpeg', 'bin')
9797

@@ -106,7 +106,7 @@
106106
from nbs2midi import nbs2midi
107107
from nbsio import NBS_VERSION, VANILLA_INSTS, Instrument, Layer, NbsSong, Note
108108

109-
__version__ = '1.4.0'
109+
__version__ = '1.5.0'
110110

111111
NBS_JSON_SCHEMA = {
112112
"type": "object",
@@ -2111,6 +2111,8 @@ def emit(self, record: logging.LogRecord) -> None:
21112111
retention=10, compression='bz2')
21122112
logging.basicConfig(handlers=[InterceptHandler()],
21132113
level=logging.INFO, force=True)
2114+
# logging.basicConfig(handlers=[InterceptHandler()],
2115+
# level=logging.DEBUG, force=True)
21142116

21152117
showwarning_ = warnings.showwarning
21162118

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ package-mode = false
99
python = ">=3.8, <3.9"
1010
Pillow = ">=9.0.0"
1111
pygubu = ">=0.23"
12+
# pygubu = "0.35.6"
13+
# pygubu = "0.36"
1214
mido = ">=1.2.9"
1315
lxml = ">=4.9.1"
1416
lark = ">=1.0.0"

ui/toplevel.ui

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<interface version="1.4" author="PygubuDesigner 0.39.3">
2+
<interface version="1.4" author="PygubuDesigner 0.40.2">
33
<project>
44
<settings>
55
<setting id="name">Main window</setting>
@@ -20,7 +20,7 @@
2020
<setting id="ttk_style_definition_file" />
2121
</settings>
2222
<customwidgets>
23-
<customwidget path="../customwidgets/builder.py" />
23+
<customwidget path="../customwidgets_builder.py" />
2424
</customwidgets>
2525
</project>
2626
<object class="tk.Toplevel" id="toplevel">
@@ -50,28 +50,28 @@
5050
<property name="side">top</property>
5151
</layout>
5252
<child>
53-
<object class="pygubu.builder.widgets.tkscrollbarhelper" id="tkscrollbarhelper">
53+
<object class="pygubu.widgets.ScrollbarHelper" id="scrollbarhelper1">
5454
<property name="scrolltype">both</property>
55-
<property name="usemousewheel">true</property>
55+
<property name="usemousewheel">false</property>
5656
<layout manager="pack">
5757
<property name="expand">true</property>
58-
<property name="fill">both</property>
59-
<property name="padx">5</property>
60-
<property name="pady">5</property>
6158
<property name="side">top</property>
6259
</layout>
6360
<child>
6461
<object class="ttk.Treeview" id="fileTable">
6562
<property name="selectmode">extended</property>
6663
<layout manager="pack">
6764
<property name="expand">true</property>
65+
<property name="fill">both</property>
66+
<property name="padx">5</property>
67+
<property name="pady">5</property>
6868
<property name="side">top</property>
6969
</layout>
7070
<child>
7171
<object class="ttk.Treeview.Column" id="filePathColumn">
7272
<property name="column_anchor">w</property>
7373
<property name="heading_anchor">w</property>
74-
<property name="minwidth">20</property>
74+
<property name="minwidth">100</property>
7575
<property name="stretch">true</property>
7676
<property name="text" translatable="yes">File path</property>
7777
<property name="tree_column">true</property>
@@ -95,7 +95,7 @@
9595
<object class="ttk.Treeview.Column" id="songNameColumn">
9696
<property name="column_anchor">w</property>
9797
<property name="heading_anchor">w</property>
98-
<property name="minwidth">20</property>
98+
<property name="minwidth">40</property>
9999
<property name="stretch">true</property>
100100
<property name="text" translatable="yes">Name</property>
101101
<property name="tree_column">false</property>
@@ -107,7 +107,7 @@
107107
<object class="ttk.Treeview.Column" id="songAuthorColumn">
108108
<property name="column_anchor">w</property>
109109
<property name="heading_anchor">w</property>
110-
<property name="minwidth">20</property>
110+
<property name="minwidth">40</property>
111111
<property name="stretch">true</property>
112112
<property name="text" translatable="yes">Author</property>
113113
<property name="tree_column">false</property>
@@ -119,7 +119,7 @@
119119
<object class="ttk.Treeview.Column" id="songOrgiAuthorColumn">
120120
<property name="column_anchor">w</property>
121121
<property name="heading_anchor">w</property>
122-
<property name="minwidth">20</property>
122+
<property name="minwidth">40</property>
123123
<property name="stretch">true</property>
124124
<property name="text" translatable="yes">Original author</property>
125125
<property name="tree_column">false</property>

0 commit comments

Comments
 (0)