Latest head broken on Linux

0 views
Skip to first unread message

Matt Harrison

unread,
Sep 2, 2008, 2:55:33 AM9/2/08
to bruce-users
Hey all-

I just svn-up'd my source, and it's broken on Linux. I tried to tweak
the following and now my preso at least shows now:

matt@t61p:~/work/pylibs/bruce$ svn diff pyglet/
Index: pyglet/image/codecs/__init__.py
===================================================================
--- pyglet/image/codecs/__init__.py (revision 2243)
+++ pyglet/image/codecs/__init__.py (working copy)
@@ -184,15 +184,16 @@
pass

# Mac OS X default: QuickTime
- try:
- import pyglet.image.codecs.quicktime
- add_encoders(quicktime)
- add_decoders(quicktime)
- except ImportError:
- pass
+ if 1: #sys.platform in ('darwin'):
+ try:
+ import pyglet.image.codecs.quicktime
+ add_encoders(quicktime)
+ add_decoders(quicktime)
+ except ImportError:
+ pass

# Windows XP default: GDI+
- if sys.platform in ('win32', 'cygwin'):
+ elif sys.platform in ('win32', 'cygwin'):
try:
import pyglet.image.codecs.gdiplus
add_encoders(gdiplus)
@@ -201,12 +202,13 @@
pass

# Linux default: GdkPixbuf 2.0
- try:
- import pyglet.image.codecs.gdkpixbuf2
- add_encoders(gdkpixbuf2)
- add_decoders(gdkpixbuf2)
- except ImportError:
- pass
+ elif sys.platform in ('linux2'):
+ try:
+ import pyglet.image.codecs.gdkpixbuf2
+ add_encoders(gdkpixbuf2)
+ add_decoders(gdkpixbuf2)
+ except ImportError:
+ pass

# Fallback: PIL
try:
Index: pyglet/lib.py
===================================================================
--- pyglet/lib.py (revision 2243)
+++ pyglet/lib.py (working copy)
@@ -98,7 +98,10 @@
if self.platform == 'linux2':
platform_names.extend(['lib%s.so' % n for n in names])

+ print "NAMES", names, "PN", platform_names
platform_names.extend(names)
+ #if not platform_names:
+ # return
for name in platform_names:
try:
lib = ctypes.cdll.LoadLibrary(name)
@@ -119,7 +122,10 @@
return lib
except OSError:
pass
- raise ImportError('Library "%s" not found.' % names[0])
+ if names:
+ raise ImportError('Library "%s" not found.' % names[0])
+ else:
+ raise ImportError("Empty library not found")

find_library = lambda self, name: ctypes.util.find_library(name)

Index: pyglet/gl/xlib.py
===================================================================
--- pyglet/gl/xlib.py (revision 2243)
+++ pyglet/gl/xlib.py (working copy)
@@ -113,7 +113,7 @@
x_screen = canvas.display.x_screen

self._visual_info = glx.glXChooseVisual(
- x_display, x_screen_id, attrib_list)
+ x_display, x_screen, attrib_list)
if not self._visual_info:
raise gl.ContextException('No conforming visual exists')

Index: pyglet/window/__init__.py
===================================================================
--- pyglet/window/__init__.py (revision 2243)
+++ pyglet/window/__init__.py (working copy)
@@ -1515,10 +1515,10 @@
elif sys.platform in ('win32', 'cygwin'):
from pyglet.window.win32 import Win32Window
Window = Win32Window
- else:
+ elif sys.platform in ('linux2'):
# XXX HACK around circ problem, should be fixed after removal
of
# shadow nonsense
- pyglet.window = sys.modules[__name__]
+ #pyglet.window = sys.modules[__name__]
import key, mouse

from pyglet.window.xlib import XlibWindow
matt@t61p:~/work/pylibs/bruce$


If I try to type into a python interpreter I get the following:

Traceback (most recent call last):
File "/home/matt/work/II/pyenv/bin/bruce", line 7, in <module>
execfile(__file__)
File "/home/matt/work/pylibs/bruce/scripts/bruce", line 5, in
<module>
run.main()
File "/home/matt/work/pylibs/bruce/bruce/run.py", line 120, in main
pres.start_presentation()
File "/home/matt/work/pylibs/bruce/bruce/presentation.py", line 33,
in start_presentation
director.run(self.page)
File "/home/matt/work/II/pyenv/lib/python2.5/site-packages/
cocos2d-0.3.0_rc0beta-py2.5.egg/cocos/director.py", line 288, in run
pyglet.app.run()
File "/home/matt/work/pylibs/bruce/pyglet/app/__init__.py", line
123, in run
event_loop.run()
File "/home/matt/work/pylibs/bruce/pyglet/app/xlib.py", line 136, in
run
device.select()
File "/home/matt/work/pylibs/bruce/pyglet/canvas/xlib.py", line 159,
in select
window.dispatch_platform_event(e)
File "/home/matt/work/pylibs/bruce/pyglet/window/xlib/__init__.py",
line 839, in dispatch_platform_event
event_handler(e)
File "/home/matt/work/pylibs/bruce/pyglet/window/xlib/__init__.py",
line 986, in _event_key
text, symbol = self._event_text_symbol(ev)
File "/home/matt/work/pylibs/bruce/pyglet/window/xlib/__init__.py",
line 883, in _event_text_symbol
byref(symbol), None)
ctypes.ArgumentError: argument 1: <type 'exceptions.TypeError'>:
expected LP_struct_anon_37 instance instead of struct_anon_37


Rather than debug more, I thought I'd ask. I'm assuming there is an
impedance mismatch of my pyglet/cocos2d/bruce files.... Am running
svn of pyglet/bruce and cocos2d-0.3.0rc0beta

-matt

ps- thanks for bruce. I used it this past week at UTOSC, and am
planning to use it more.
Reply all
Reply to author
Forward
0 new messages