Files
controller-wisetopdataserver/python/biopro/server/__pycache__/dispatcher.cpython-37.opt-2.pyc
T

23 lines
1.9 KiB
Plaintext
Raw Normal View History

2021-12-20 14:52:55 +08:00
B
2021-12-22 14:29:56 +08:00
ò0Àaïã@s6ddlmZmZmZmZmZddlTGdddƒZdS)é)ÚTypeÚUnionÚTupleÚAnyÚList)Ú*c@sxeZdZdZeeeedffedœddZe eeeedffdœddƒZ
2021-12-20 14:52:55 +08:00
e e e dœd d
ƒZ
e ed œd d
ZdS)Ú
APIDispatcher)Z __api_classZ__targetZ__method_cache.)Ú api_classÚtargetcst|ˆ_ˆˆ_tƒˆ_fdd}t|tƒrVxB|D]}tˆ|ƒsHtdƒ||ƒq2Wntˆ|ƒshtdƒ||ƒdS)Ncs:x4t|ƒD](}| d¡s
ttˆ|ƒƒr
2021-12-22 14:29:56 +08:00
ˆj |¡q
2021-12-20 14:52:55 +08:00
WdS)_)ÚdirÚ
startswithÚcallableÚgetattrÚ_APIDispatcher__method_cacheÚadd)Ú_clsÚ attr_name)Úselfr
©ú=/home/pi/wisetopdataserver/python/biopro/server/dispatcher.pyÚ _add_methodsz+APIDispatcher.__init__.<locals>._add_methodz target not subclass of api_class)Ú_APIDispatcher__api_classÚ_APIDispatcher__targetÚsetrÚ
isinstanceÚtupleÚ RuntimeError)rr r
rÚclsr)rr
rÚ__init__ s



zAPIDispatcher.__init__)ÚreturncCs|jS)N)r)rrrrr szAPIDispatcher.api_classcCs
t|jƒS)N)Úlistr)rrrrÚ api_methods$szAPIDispatcher.api_methods)Úmethodr cCsV| d¡rtt|ƒ||jkr(tt|ƒt|j|dƒ}|dk rH|||ŽStt|ƒdS)Nr )r
rÚCOMMAND_UNKNOWNrrr)rr#ÚargumentÚoptionsÚfuncrrrÚmethod_dispatch(s