[Ocemp-CVS] ocempgui/doc/examples a11y_test.py, 1.13.2.1, 1.13.2.2 graph2d.py, 1.4, 1.4.2.1
Status: Beta
Brought to you by:
marcusva
From: Marcus v. A. <mar...@us...> - 2008-05-10 08:03:44
|
Update of /cvsroot/ocemp/ocempgui/doc/examples In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11993/doc/examples Modified Files: Tag: rel_0_2 a11y_test.py graph2d.py Log Message: Added numpy compatibility for pygame 1.8.x. Index: a11y_test.py =================================================================== RCS file: /cvsroot/ocemp/ocempgui/doc/examples/Attic/a11y_test.py,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -d -r1.13.2.1 -r1.13.2.2 --- a11y_test.py 25 Aug 2006 08:09:30 -0000 1.13.2.1 +++ a11y_test.py 10 May 2008 08:03:46 -0000 1.13.2.2 @@ -29,9 +29,13 @@ self.action_get_description = self.__get_description self.action_get_name = self.__get_name self.component_get_extents = self.__get_pos + self.ref_state_set = self.__ref_state_set def __get_pos (self, coords): return 10, 10, 99, 99 + + def __ref_state_set (self): + return papi.AtkStateSet () def __get_n_actions (self): return 1 Index: graph2d.py =================================================================== RCS file: /cvsroot/ocemp/ocempgui/doc/examples/graph2d.py,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- graph2d.py 30 Jun 2006 10:13:51 -0000 1.4 +++ graph2d.py 10 May 2008 08:03:46 -0000 1.4.2.1 @@ -1,7 +1,15 @@ # Graph2D examples. +import sys, math from ocempgui.widgets import * from ocempgui.widgets.Constants import * -import Numeric, math +try: + import Numeric as N +except ImportError: + try: + import numpy as N + except ImportError: + print "Numeric or numpy could not be found" + sys.exit (-1) __function = "func_1" @@ -36,7 +44,7 @@ # The evaluation function and data to use. graph.eval_func = lambda x: x**4.0 - 3 * x**2.0 + 2 * x - graph.data = Numeric.arrayrange (-10, 10, .001).tolist() + graph.data = N.arrayrange (-10, 10, .001).tolist() # Done, unlock. graph.unlock () |