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

236 lines
20 KiB
Plaintext
Raw Normal View History

2021-12-20 14:52:55 +08:00
B
”Ú`F©ã@ddlZddlmZmZmZmZddlTddlTddlm Z m
Z
m Z yddl m
Z
mZWn ek
rxeZddZ
YnXedƒZGd d
d
eeƒZGd d d ed
ZGddde ee
eƒd
ZGdddeƒZdS)éN)ÚOptionalÚIterableÚTypeVarÚGeneric)Ú*)Ú SocketClientÚSocketClientMacroÚSocketTimeoutError)ÚrouterÚRoutercOsddS)NcSs|S))Úfr r ú1/home/pi/bioprorelife/python/biopro/controller.pyÚ<lambda>ózrouter.<locals>.<lambda>r )ÚargsÚkwargsr r rr
sr
ÚTc@s@eZdZdZd eeeeefdfdœddZedœddZ dS)
ÚComplexResponse)ÚresponseÚresponse_cookieN)rÚcookiecCs>||_t|tƒrt|ƒ}nt|tƒr0t|jƒ}ni}||_dS)N)rÚ
isinstanceÚdictrr)Úselfrrr r rÚ__init__!s


 zComplexResponse.__init__)rcKs|j |¡dS)N)rÚupdate)rrr r rÚ
set_cookie/szComplexResponse.set_cookie)N)
Ú__name__Ú
__module__Ú __qualname__Ú __slots__rÚUnionÚDictÚstrrrr r r rrs"rc @sp
eZdZdZdZedƒedœddƒZededd id
e e
e
d œd d
ƒZ edide dœddƒZ
edƒedœddƒZedidddœe
e
edœddƒZedidee
efed œddƒZee
efed œddZedddid ed!id d!e ee d#œd$d%„ƒƒZed&ƒe edœd'd(„ƒZed)ƒe
e
ed*œd+d,„ƒZed-ƒedœd.d/„ƒZed0ƒeed#œd1d2„ƒZed3ƒeee
d#œd4d5„ƒZed6ide
e
e d7œd8d9„ƒZed:idee
e d;œd<d=„ƒZed>id?eedœd@dA„ƒZedBid?eedœdCdD„ƒZ edEid?eedœdFdG„ƒZ!edHid?e
dœdIdJ„ƒZ"edKid?eee dLœdMdN„ƒZ#edOid?eee dPœdQdR„ƒZ$edSid?eee dTœdUdV„ƒZ%edWid?eed#œdXdY„ƒZ&edZiid
d"ee
e e
ed[œd\d]„ƒZ'ed^id?ee
ed_œd`da„ƒZ(edbdcd"idcddideee e e
dfœdgdh„ƒZ)edbdid"ididdidjee
e e
dkœdldm„ƒZ*edndodid?edpƒe e
edqœdrds„ƒƒZ+edtƒe
edqœdudv„ƒZ,edwƒe
eedxœdydz„ƒZ-edpddid ed{id e
e ee dxœd|d}„ƒƒZ.ed~id edœdd€„ƒZ/edƒedœddƒ„ƒZ0ed„d…d†id?ed‡ƒe
edˆœd‰dŠ„ƒƒZ1ed„d†dddŒœd?edƒe
edˆœdŽdƒƒZ2ed‡ide
e
edœdd’„ƒZ3ed‡ide
edˆœd“d”„ƒZ4ed‡id e
edˆœd•d–„ƒZ5ed—d…d†id?ed˜ƒe
edˆœd™dš„ƒƒZ6ed›ƒe
edˆœdœdƒZ7edžƒe
edˆœdŸd „ƒZ8ed¡ƒedœd¢d£„ƒZ9ed¤ƒe
ed¥œd¦d§„ƒZ:ed¨ƒe
e
e
e
d©œdªd«„ƒZ;ed¬ed­d†d†d®d ed¯ed°d±ed²d±ed³d±ed´e
e
ed¶œd·d¸„ƒƒZ<ed¹ƒee
edºœd»d¼„ƒZ=ed½ide
ed œd¾d¿„ƒZ>edÀid?eedÁœdÂdăZ?edÀid edÄœdÅdÆ„ƒZ@edoƒedœdÇdÈ„ƒZAedÉed†dÊd?ed˃ddÌœe
e e
edÍœdÎdÏ„ƒƒZBedËidÌdÐddÌœe
e
e e
eCedÑœdÒdÓ„ƒZDedÔidÌdÐd#e e
edÕœdÖdׄƒZEedËidÌdØddÌœe
e
e e
eCedÑœdÙdÚ„ƒZFedËidÌdÛe
e
e e
e dÑœdÜdÝ„ƒZGedÞidÌdÐe e
e dÕœdßdà„ƒZHedádÌdâe e
e
ee
dãœdäd儃ZIedædÌdâd$e
e e
edçœdèd鄃ZJedæidÌdØd%e
e
e e
e dêœdëd섃ZKedæidÌdÛd&e
e e
e dçœdídZLedæidÌdÐd'e
e
e e
e dêœdïdð„ƒZMedñdÌdâd(e e
ee
dÕœdòdó„ƒZNedôdÌdâd)e
e e
edçœdõdö„ƒZOedôidÌdØd*e
e e
edçœd÷dø„ƒZPedôidÌdÛd+e
e e
e dçœdùdú„ƒZQedûdÌdâd,e e
edÕœdüdý„ƒZRedþdÌdâd-e
e e
edçœdÿdƒZSedþied†d dd.e
e
e e
edêœddƒZTedƒedœddƒZUedidÌdØddÌœe
e e
edœdd „ƒZVed
id?eed œd d
ƒZWeded†d†dd ededd ied†d dd/ee
e e
e dœddƒƒZXedƒedœddƒZYedƒeed œddƒZZedidee
e dœddƒZ[edƒddœdd „ƒZ\dS(0Ú
ControlAPIz/tmp/BPS.socketr z
hardware/init)ÚreturncCs
tƒdS)N)ÚNotImplementedError)rr r rÚ
hardware_infoSs zControlAPI.hardware_infozhardware/datetimeN)Úcontent)ÚGETÚPOST)r)r&cCs
tƒdS)N)r')rr)r r rÚhardware_datetimeaszControlAPI.hardware_datetimez
hardware/scan)ÚPUTcCs
tƒdS)N)r')rr r rÚ
hardware_scanqszControlAPI.hardware_scanzhardware/devicecCs
tƒdS)N)r')rr r rÚhardware_devices zControlAPI.hardware_device)r+Zfalse)Úscan)r)r0r&cCs
tƒdS)N)r')rr)r0r r rÚhardware_device_foundsz ControlAPI.hardware_device_foundcCs
tƒdS)N)r')rr)r r rÚhardware_device_connect¡sz"ControlAPI.hardware_device_connectcCs
tƒdS)N)r')rr)r r rÚhardware_device_direct_connect¼sz)ControlAPI.hardware_device_direct_connectÚdevice)ÚDELzhardware/device/<int:device>F)r4r&cCs
tƒdS)N)r')rr4Zforcer r rÚhardware_device_disconnectÖsz%ControlAPI.hardware_device_disconnectz
hardware/menucCs
tƒdS)N)r')rr r rÚ
hardware_menuészControlAPI.hardware_menuzhardware/send/<str:command>)ÚcommandÚoptionsr&cKs
tƒdS)N)r')rr8r9r r rÚ
hardware_sendùs#zControlAPI.hardware_sendzdevice/cCs
tƒdS)N)r')rr r rÚget_device_info_alls zControlAPI.get_device_info_allzdevice/<int:device>/infocCs
tƒdS)N)r')rr4r r rÚget_device_info,s
zControlAPI.get_device_infozdevice/<int:device>/instructioncCs
tƒdS)N)r')rr4r r rÚdevice_instruction_all;s
z!ControlAPI.device_instruction_allz(device/all/instruction/<str:instruction>)Ú instructionr)r&cCs
tƒdS)N)r')rr>r)r r rÚdevice_all_instructionJsz!ControlAPI.device_all_instructionz1device/<int:device>/instruction/<str:instruction>)r4r>r&cCs
tƒdS)N)r')rr4r>r r rÚdevice_instruction^szControlAPI.device_instructionzdevice/battery)r*cCs
tƒdS)N)r')rr r rÚdevice_batteryns zControlAPI.device_batteryz
device/parentcCs
tƒdS)N)r')rr r rÚ
device_parent|s zControlAPI.device_parentzdevice/recording_file_namecCs
tƒdS)N)r')rr r rÚdevice_recording_file_nameŠs z%ControlAPI.device_recording_file_namezdevice/<int:device>/calibrationcCs
tƒdS)N)r')rr r rÚdevice_update_calibration˜s z$ControlAPI.device_update_calibrationz)device/<int:device>/<int:radio_frequency>)r4Úradio_frequencyr&cCs
tƒdS)N)r')rr4rEr r rÚdevice_update_radio_frequency¦s
z(ControlAPI.device_update_radio_frequencyz(device/<int:device>/<int:led_brightness>)r4Úled_brightnessr&cCs
tƒdS)N)r')rr4rGr r rÚdevice_update_led_brightness²s
z'ControlAPI.device_update_led_brightnessz1device/<int:device>/<int:accelerator_sensitivity>)r4Úaccelerator_sensitivityr&cCs
tƒdS)N)r')rr4rIr r rÚ%device_update_accelerator_sensitivity¾s
z0ControlAPI.device_update_accelerator_sensitivityzdevice/<int:device>/pcCs
tƒdS)N)r')rr4r r rÚ&device_parameter_last_update_timestampÊs
z1ControlAPI.device_parameter_last_update_timestampz%device/<int:device>/p/<str:parameter>)r4Ú parameterr)r&cCs
tƒdS)N)r')rr4rLr)r r rÚdevice_parameterÙszControlAPI.device_parameterz%device/<int:device>/P/<str:parameter>)r4rLr&cCs
tƒdS)N)r')rr4rLr r rÚdevice_parameter_valueîsz!ControlAPI.device_parameter_valuezdevice/<int:device>/fileÚunsetT)r*r5)r4rOr&cCs
tƒdS)N)r')rr4rOr r rÚdevice_save_pathþszControlAPI.device_save_pathÚdry_run)r-r+)r4r)rQr&cCs
tƒdS)N)r')rr4r)rQr r rÚdevice_save_path_sets-zControlAPI.device_save_path_setzdevice/history/Úuserzdevice/history/<str:user>)rSr&cCs
tƒdS)N)r')rrSr r rÚdevice_history_get>szControlAPI.device_history_getz#device/history/<str:user>/all/foundcCs
tƒdS)N)r')rrSr r rÚdevice_history_found_allNs
z#ControlAPI.device_history_found_allz,device/history/<str:user>/<int:device>/found)rSr4r&cCs
tƒdS)N)r')rrSr4r r rÚdevice_history_found]szControlAPI.device_history_foundz&device/history/<str:user>/<int:device>cCs
tƒdS)N)r')rrSr4r r rÚdevice_history_deletemsz ControlAPI.device_history_deletezfile/cCs
tƒdS)N)r')rr r rÚfile_clean_storage~szControlAPI.file_clean_storagezfile/pcCs
tƒdS)N)r')rr r rÚ
file_indexszControlAPI.file_indexzfile/p/ÚpathÚzfile/p/<path:path>)rZr&cCs
tƒdS)N)r')rrZr r rÚ file_list¡szControlAPI.file_listr)rZÚstartÚendz(file/p/<path:path>/<start:int>/<end:int>cCs
tƒdS)N)r')rrZr r rÚfile_list_rangeµszControlAPI.file_list_range)rZr)r&cCs
tƒdS)N)r')rrZr)r r rÚ file_renameÉszControlAPI.file_renamecCs
tƒdS)N)r')rrZr r rÚ
file_mkdirászControlAPI.file_mkdircCs
tƒdS)N)r')rrZr r rÚ file_deleteôszControlAPI.file_deletezfile/f/zfile/f/<path:path>cCs
tƒdS)N)r')rrZr r rÚ file_infoszControlAPI.file_infozfile/f/<path:path>/-metacCs
tƒdS)N)r')rrZr r rÚfile_meta_infoszControlAPI.file_meta_infozfile/f/<path:path>/-exportcCs
tƒdS)N)r')rrZr r rÚfile_export_info0szControlAPI.file_export_infozfile/e/cCs
tƒdS)N)r')rr r rÚfile_export_functionsAsz ControlAPI.file_export_functionszfile/e/<str:ftype>)Úftyper&cCs
tƒdS)N)r')rrgr r rÚfile_export_parametersSsz!ControlAPI.file_export_parameterszfile/e/<str:ftype>/<path:path>)rgrZr9r&cKs
tƒdS)N)r')rrgrZr9r r rÚ file_exportfszControlAPI.file_exportzfile/sZ invalid_all)ÚmethodrgrZzfile/s/p/<path:path>Úinfo)rjÚnewÚreloadÚinvalid)r*r-r+r5)rjrZr&cCs
tƒdS)N)r')rrjrZr r rÚ file_segmentszControlAPI.file_segmentz file/s/<int:segment>/<path:path>)ÚsegmentrZr&cCs
tƒdS)N)r')rrprZr r rÚfile_segment_getœszControlAPI.file_segment_getzfile/hcCs
tƒdS)N)r')rr)r r rÚfile_handle_open¬szControlAPI.file_handle_openzfile/h/<int:handle>)Úhandler&cCs
tƒdS)N)r')rrsr r rÚfile_handle_infoÄszControlAPI.file_handle_info)rscCs
tƒdS)N)r')rrsr r rÚfile_handle_close×szControlAPI.file_handle_closecCs
tƒdS)N)r')rr r rÚuser_allêszControlAPI.user_allz
user/-info)rSzuser/u/<str:user>)Ú user_session)rSrwr&cCs
tƒdS)N)r')rrSrwr r rÚ user_infoüszControlAPI.user_info)r+ÚCOOKIE)rSr)rwr&cCs
tƒdS)N)r')rrSr)rwr r rÚ
user_loginszControlAPI.user_loginz user/-logout)rwr&cCs
tƒdS)N)r')rrwr r rÚ user_logout,szControlAPI.user_logout)r-rycCs
tƒdS)N)r')rrSr)rwr r rÚuser_addAszControlAPI.user_add)r5rycCs
tƒdS)N)r')rrSr)rwr r rÚuser_delYszControlAPI.user_delz
user/-synccCs
tƒdS)N)r')rrwr r rÚ user_syncqszControlAPI.user_synczuser/c)ry)rwr9r&cKs
tƒdS)N)r')rrwr9r r rÚuser_configuration_listsz"ControlAPI.user_configuration_listzuser/c/<str:name>)Únamerwr&cCs
tƒdS)N)r')rr€rwr r rÚuser_configuration_get™sz!ControlAPI.user_configuration_get)r€r)rwr&cCs
tƒdS)N)r')rr€r)rwr r rÚuser_configuration_add­sz!ControlAPI.user_configuration_addcCs
tƒdS)N)r')rr€rwr r rÚuser_configuration_delÄsz!ControlAPI.user_configuration_delcCs
tƒdS)N)r')rr€r)rwr r rÚuser_configuration_cloneÖsz#ControlAPI.user_configuration_clonezuser/ecCs
tƒdS)N)r')rrwr r rÚuser_setup_listðszControlAPI.user_setup_listzuser/e/<str:name>cCs
tƒdS)N)r')rr€rwr r rÚuser_setup_infoszControlAPI.user_setup_infocCs
tƒdS)N)r')rr€rwr r rÚuser_setup_newszControlAPI.user_setup_newcCs
tƒdS)N)r')rr€rwr r rÚuser_setup_del%szControlAPI.user_setup_delzuser/acCs
tƒdS)N)r')rrwr r rÚuser_alias_list7szControlAPI.user_alias_listzuser/a/<str:name>cCs
tƒdS)N)r')rr€rwr r rÚuser_alias_infoHszControlAPI.user_alias_info)r-r5rycCs
tƒdS)N)r')rr€r)rwr r rÚuser_alias_editZszControlAPI.user_alias_editÚexpcCs
tƒdS)N)r')rr r rÚ exp_pro_listvszControlAPI.exp_pro_list)r)rwr&cCs
tƒdS)N)r')rr)rwr r rÚexp_pro_createˆszControlAPI.exp_pro_createzexp/p/<int:protocol>)Úprotocolr&cCs
tƒdS)N)r')rrr r rÚexp_pro_options¡szControlAPI.exp_pro_optionszexp/p/<int:protocol>/)Úoptionr)z!exp/p/<int:protocol>/<str:option>)r*r-r5)rrr)r&cCs
tƒdS)N)r')rrrr)r r rÚexp_pro_option´szControlAPI.exp_pro_optionzexp/scCs
tƒdS)N)r')rr r rÚexp_pro_status_allÔszControlAPI.exp_pro_status_allzexp/s/<int:protocol>cCs
tƒdS)N)r')rrr r rÚexp_pro_statusçszControlAPI.exp_pro_status)rr)r&cCs
tƒdS)N)r')rrr)r r rÚexp_pro_commandüszControlAPI.exp_pro_commandzhardware/restartcCs
tƒdS)N)r')rr r rÚrestart_servers zControlAPI.restart_server)F)N)N)N)N)N)N)N)N)N)N)N)N)N)N)]rrr ÚADDRr!r
Ú JSON_OBJECTr(rrr$r,Úboolr.Z
JSON_ARRAYr/ÚJSONr1r"r2r3Úintr6r7r:r;r<ÚListr=r?r@rArBrCrDrFrHrJrKrMrNrPrRrTrUrVrWrXrYr\r_r`rarbrcrdrerfrhrirorqrrrtrurvrxrrzr{r|r}r~rrrr„r…r†r‡r‰rrrrr“r”r•rr r r rr%3s`




$










 
-