This commit is contained in:
yumoqing 2020-12-07 11:52:17 +08:00
parent 29bdc3293d
commit ae89547b70

View File

@ -496,16 +496,20 @@ class Blocks(EventDispatcher):
if name == 'urlwidget': if name == 'urlwidget':
opts = desc.get('options').copy() opts = desc.get('options').copy()
addon = desc.get('extend')
url = opts.get('url') url = opts.get('url')
if url is None: if url is None:
self.dispatch('on_failed',Exception('miss url')) self.dispatch('on_failed',Exception('miss url'))
def cb(o,d): def cb(addon,o,d):
if addon is not None:
d = dictExtend(d,addon)
doit(d) doit(d)
if opts.get('url'): if opts.get('url'):
del opts['url'] del opts['url']
self.getUrlData(url,callback=cb,errback=doerr,**opts) self.getUrlData(url,callback=partial(cb,addon),
errback=doerr,**opts)
return return
doit(desc) doit(desc)