From 1bcb5d346d661353279707cb37435362e4a990aa Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 10 Aug 2020 21:08:21 +0800 Subject: [PATCH] bugfix --- kivyblocks/blocks.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kivyblocks/blocks.py b/kivyblocks/blocks.py index 9b92333..dfdc4a3 100755 --- a/kivyblocks/blocks.py +++ b/kivyblocks/blocks.py @@ -164,7 +164,11 @@ class Blocks(EventDispatcher): g['__builtins__']['__loader__'] = None g['__builtins__']['open'] = None g.update(self.env) - + for k,v in g.items(): + if isinstance(k,str): + print('k=',k) + if k=='get_playerid': + print('s=',s) return eval(s,g,l) def getUrlData(self,url,method='GET',params={}, files={}, @@ -188,10 +192,10 @@ class Blocks(EventDispatcher): return s s = s[4:] try: - v = self.eval(s[4:],localnamespace) + v = self.eval(s,localnamespace) return v except Exception as e: - print('Exception .... ',e,s) + print('Exception .... ',e,'script=',s) print_exc() return s @@ -398,7 +402,7 @@ class Blocks(EventDispatcher): rf = RegistedFunction() name = desc.get('rfname') func = rf.get(name) - params = desc.get(params,{}) + params = desc.get('params',{}) d = self.getActionData(widget,desc) params.update(d) func(**params)