This commit is contained in:
yumoqing 2020-08-10 21:08:21 +08:00
parent 8f8ab19f47
commit 1bcb5d346d

View File

@ -164,7 +164,11 @@ class Blocks(EventDispatcher):
g['__builtins__']['__loader__'] = None g['__builtins__']['__loader__'] = None
g['__builtins__']['open'] = None g['__builtins__']['open'] = None
g.update(self.env) 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) return eval(s,g,l)
def getUrlData(self,url,method='GET',params={}, files={}, def getUrlData(self,url,method='GET',params={}, files={},
@ -188,10 +192,10 @@ class Blocks(EventDispatcher):
return s return s
s = s[4:] s = s[4:]
try: try:
v = self.eval(s[4:],localnamespace) v = self.eval(s,localnamespace)
return v return v
except Exception as e: except Exception as e:
print('Exception .... ',e,s) print('Exception .... ',e,'script=',s)
print_exc() print_exc()
return s return s
@ -398,7 +402,7 @@ class Blocks(EventDispatcher):
rf = RegistedFunction() rf = RegistedFunction()
name = desc.get('rfname') name = desc.get('rfname')
func = rf.get(name) func = rf.get(name)
params = desc.get(params,{}) params = desc.get('params',{})
d = self.getActionData(widget,desc) d = self.getActionData(widget,desc)
params.update(d) params.update(d)
func(**params) func(**params)