X-Injected-By: benja@lorien.it.jyu.fi Date: Sun, 31 Mar 2002 17:57:09 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: binary -*) # Note that the bindings hang from *this cell, the cell containing # the Python keybinder code. from org.gzigzag.impl import Id import sys d_bind = Id.space.getCell("home-id:0000000008000000EC3C9A087E0004B427DF63991E19767E74EC6A30450C561D9ECE873684FA91-4"); d_bind_list = Id.space.getCell("home-id:0000000008000000EC3C9A087E0004B427DF63991E19767E74EC6A30450C561D9ECE873684FA912"); def call(c, *keys): script = c.t() if not script.startswith("#"): raise ZZError("Not a code cell: "+c keys['this_cell'] = c exec scriptinglobals(),keys defcall_binding(code): import sys en) # call th bindingcall_bindig(code: ", sysexc_info()[0] print"this_ell: """ Call the contents of a cell as a kind-of function, with local variables and so on. You can pass keyword arguments to this function; they will be put in the local namespace. 'this_cell' in the local namespace denotes the called cell. You can also pass 'this_cell' as a keyword argument instead of passing it as the first argument to this function. Examples call(cell) call(cell, str="foo", count=17) call(cell, param=otherCell) call(foo=x, this_cell=cell, str="quux") """ this_ellthis_ell # Python says multiline scripts passed to 'exec' must end with a newline. script = script + '\n'this_ell