3 À<×eÒ ã@s4ddlmZddlZddlZGdd„dejjƒZdS)é)Ú interfaceséNcs eZdZdZ‡fdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Z‡ZS)$ÚExportsControllerz4 Controls and manages object interface exporting. cs$tt|ƒjƒg|_g|_d|_dS)NF)ÚsuperrÚ__init__Ú _exportersÚ_objectsÚ_exports_initialized)Úself)Ú __class__©ú /usr/lib/python3.6/controller.pyr szExportsController.__init__cCs|jj|ƒdS)zRegister objects exporter.N)rÚappend)r Úinstancer r r Úregister_exportersz#ExportsController.register_exportercCs|jj|ƒdS)zRegister object to be exported.N)rr)r rr r r Úregister_objectsz!ExportsController.register_objectcCstj|ƒot|dƒS)z8Check if method was marked with @exports.export wrapper.Ú export_params)ÚinspectÚismethodÚhasattr)r Úmethodr r r Ú_is_exportable_methodsz'ExportsController._is_exportable_methodcCstj|ƒot|dƒS)z8Check if method was marked with @exports.signal wrapper.Ú signal_params)rrr)r rr r r Ú_is_exportable_signalsz'ExportsController._is_exportable_signalcCstj|ƒot|dƒS)z>Check if method was marked with @exports.get_property wrapper.Úproperty_get_params)rrr)r rr r r Ú_is_exportable_getter sz'ExportsController._is_exportable_gettercCstj|ƒot|dƒS)z>Check if method was marked with @exports.set_property wrapper.Úproperty_set_params)rrr)r rr r r Ú_is_exportable_setter$sz'ExportsController._is_exportable_settercCs:x4|jD]*}|jd}|jd}|j|f|ž|ŽqWdS)z!Register method to all exporters.rrN)rrZexport)r rÚexporterÚargsÚkwargsr r r Ú_export_method(s   z ExportsController._export_methodcCs:x4|jD]*}|jd}|jd}|j|f|ž|ŽqWdS)z!Register signal to all exporters.rrN)rrÚsignal)r rrrr r r r Ú_export_signal/s   z ExportsController._export_signalcCs:x4|jD]*}|jd}|jd}|j|f|ž|ŽqWdS)z*Register property getter to all exporters.rrN)rrZproperty_getter)r rrrr r r r Ú_export_getter6s   z ExportsController._export_gettercCs:x4|jD]*}|jd}|jd}|j|f|ž|ŽqWdS)z*Register property setter to all exporters.rrN)rrZproperty_setter)r rrrr r r r Ú_export_setter=s   z ExportsController._export_settercOs&x |jD]}|j|f|ž|ŽqWdS)z!Register signal to all exporters.N)rÚ send_signal)r r"rr rr r r r&Ds zExportsController.send_signalcOs x|jD]}|j||ŽqWdS)N)rÚproperty_changed)r rr rr r r r'Is z"ExportsController.property_changedcCsx|jD] }|jƒqWdS)z=Allows to perform checks on exporters without special thread.N)rÚ period_check)r rr r r r(Ms zExportsController.period_checkcCs¼|jr dSx¦|jD]œ}x$tj||jƒD]\}}|j|ƒq&Wx$tj||jƒD]\}}|j|ƒqLWx$tj||jƒD]\}}|j |ƒqrWx$tj||j ƒD]\}}|j |ƒq˜WqWd|_dS)NT) r rrZ getmembersrr!rr#rr$rr%)r rÚnamerr r r Ú_initialize_exportsRs z%ExportsController._initialize_exportscCs$|jƒx|jD] }|jƒqWdS)zStart the exports.N)r*rÚstart)r rr r r r+bs zExportsController.startcCsx|jD] }|jƒqWdS)zStop the exports.N)rÚstop)r rr r r r,hs zExportsController.stop)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrrr!r#r$r%r&r'r(r*r+r,Ú __classcell__r r )r r rs$ r)ÚrrZtuned.patternsZtunedZpatternsZ Singletonrr r r r Ús