return self.args[0].code() def error_routine(self): return self.args[0].routine() def error_what(self): return self.args[0].what() Error.__str__ = error_str Error.code = property(error_code) Error.routine = property(error_routine) Error.what = property(error_what) # }}} if _cl.have_gl(): def gl_object_get_gl_object(self): return self.get_gl_object_info()[1] GLBuffer.gl_object = property(gl_object_get_gl_object) GLTexture.gl_object = property(gl_object_get_gl_object) _add_functionality() # {{{ find pyopencl shipped source code def _find_pyopencl_include_path(): from imp import find_module import sys
return self.args[0].code() def error_routine(self): return self.args[0].routine() def error_what(self): return self.args[0].what() Error.__str__ = error_str Error.code = property(error_code) Error.routine = property(error_routine) Error.what = property(error_what) # }}} if _cl.have_gl(): def gl_object_get_gl_object(self): return self.get_gl_object_info()[1] GLBuffer.gl_object = property(gl_object_get_gl_object) GLTexture.gl_object = property(gl_object_get_gl_object) _add_functionality() # {{{ convenience def create_some_context(interactive=True, answers=None): import os