[visionegg] upgrading code to work with 0.99...
- From: Mark Tovey <mtovey@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "visionegg@xxxxxxxxxxxxx" <visionegg@xxxxxxxxxxxxx>
- Date: Sat, 31 Jan 2004 21:39:43 -0500
Hi Andrew,
I'm upgrading my code to work with 0.99, and I've played around with this
error for a while now, and I'm stumped.
I suspect I fell afoul of the new type check system, but you'll probably see
immediately what needs to be changed to make this code 0.99 compliant:
handle_evenhandle_event_callbacks = [(pygame.locals.QUIT, quit),
(pygame.locals.MOUSEBUTTONDOWN,
button_down.click),
(pygame.locals.MOUSEBUTTONUP, mouse_button_up),
(pygame.locals.KEYDOWN, keydown),
(pygame.locals.KEYUP, keyup)]
setup = Presentation(go_duration=('forever',), viewports=[viewportforsetup,
left_mask, bracketviewport], handle_event_callbacks=handle_event_callbacks)
The error message I get is as below:
Traceback (most recent call last):
File "controlprotocol9.py", line 494, in ?
setup = Presentation(go_duration=('forever',),
viewports=[viewportforsetup, left_mask, bracketviewport],
handle_event_callbacks=handle_event_callbacks)
File
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packag
es/VisionEgg/FlowControl.py", line 145, in __init__
VisionEgg.ClassWithParameters.__init__(self,**kw)
File
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packag
es/VisionEgg/__init__.py", line 325, in __init__
raise TypeError("Parameter '%s' value %s is type %s (not type %s) in
%s"%(parameter_name,value_str,type(value),tipe,self))
TypeError: Parameter 'handle_event_callbacks' value [(12, 'Use Ctrl-D (i.e.
EOF) to exit.'), (5, <bound method ButtonDown.click of <__main__.ButtonDown
instance at 0x27ae9e0>>), (6, <function mouse_button_up at 0x279c2b0>), (2,
<function keydown at 0x279c2f0>), (3, <function keyup at 0x279c3b0>)] is
type <type 'list'> (not type Sequence of Sequence2 of AnyOf(Integer or
Callable)) in <VisionEgg.FlowControl.Presentation object at 0x27aea08>
As always, thanks so much for your help!
Mark
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- Follow-Ups:
- [visionegg] Re: upgrading code to work with 0.99...
- From: Andrew Straw
Other related posts:
- » [visionegg] upgrading code to work with 0.99...
- » [visionegg] Re: upgrading code to work with 0.99...
- [visionegg] Re: upgrading code to work with 0.99...
- From: Andrew Straw