【发布时间】:2015-01-02 17:19:21
【问题描述】:
我为我的应用使用同步 JsonStorage,并希望切换到异步。
我的同步通话是:
store.exists(store_index)
我不工作的异步调用是:
def callback_function(store,key,result):
print "exists:",result
store.exists(store_index, callback=callback_function)
此异步调用引发以下异常:
store.exists(key=store_index,callback=callback_function)
TypeError: exists() got an unexpected keyword argument 'callback'
我也试过这个:
store.async_exists(store_index, callback=callback_function)
但这引发了:
File "main.py", line 199, in __init__ store.async_exists(key=store_index,callback=colorButtonCallback)
File "/home/mike/Dokumente/py-spielwiese/venv/local/lib/python2.7/sitepackages/kivy/storage/__init__.py", line 152, in async_existskey=key, callback=callback)
TypeError: _schedule() got multiple values for keyword argument 'callback'
我做错了什么?
【问题讨论】: