Skip to content

Commit cbafc55

Browse files
author
Tom De Smedt
committed
nodebox.gui bug fix for py2app
1 parent ce38688 commit cbafc55

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

nodebox/graphics/context.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,8 +1699,11 @@ def __repr__(self):
16991699
self.__class__.__name__, self.x, self.y, self.width, self.height, self.alpha)
17001700

17011701
def __del__(self):
1702-
if hasattr(self, "_cache") and self._cache is not None and flush:
1703-
flush(self._cache)
1702+
try:
1703+
if hasattr(self, "_cache") and self._cache is not None and flush:
1704+
flush(self._cache)
1705+
except:
1706+
pass
17041707

17051708
_IMAGE_CACHE = 200
17061709
_image_cache = {} # Image object referenced by Image.texture.id.

nodebox/gui/controls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self, path, **kwargs):
5858
self["fontweight"] = kwargs.get("fontweight", NORMAL)
5959
self["text"] = kwargs.get("text", Color(1.0))
6060

61-
theme = Theme(os.path.join(os.path.dirname(__file__), "theme"))
61+
theme = Theme(os.path.join(os.path.dirname(os.path.abspath(__file__)), "theme"))
6262

6363
#=====================================================================================================
6464

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ def read(fname):
1212
description="NodeBox for OpenGL is a free, cross-platform library for "
1313
"generating 2D animations with Python programming code.",
1414
long_description=read("README.txt"),
15-
keywords = "2d graphics sound physics games multimedia",
16-
license = "BSD",
15+
keywords="2d graphics sound physics games multimedia",
16+
license="BSD",
1717
author="Tom De Smedt, Frederik De Bleser",
1818
url="http://www.cityinabottle.org/nodebox/",
1919
packages=find_packages(),
20+
package_data={
21+
"nodebox.gui": ["theme/*"]
22+
},
2023
install_requires=[
2124
"pyglet",
2225
],

0 commit comments

Comments
 (0)