iris-pex-embedded-python 3.4.0b3__tar.gz → 3.4.0b5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of iris-pex-embedded-python might be problematic. Click here for more details.
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/PKG-INFO +1 -3
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/pyproject.toml +1 -3
- iris_pex_embedded_python-3.4.0b5/src/iop/_dispatch.py +101 -0
- iris_pex_embedded_python-3.4.0b5/src/iop/_serialization.py +159 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_utils.py +3 -2
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iris_pex_embedded_python.egg-info/PKG-INFO +1 -3
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iris_pex_embedded_python.egg-info/requires.txt +0 -2
- iris_pex_embedded_python-3.4.0b3/src/iop/_dispatch.py +0 -223
- iris_pex_embedded_python-3.4.0b3/src/iop/_serialization.py +0 -236
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/LICENSE +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/README.md +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/setup.cfg +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/setup.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Common.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Director.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Message.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Test.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/PEX/Utils.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/cls/Grongier/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/__main__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/_business_host.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/_cli.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/_common.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/_director.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/_utils.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/grongier/pex/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_BufferReader.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_BufferWriter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_ConnectionInformation.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_ConnectionParameters.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_Constant.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_DBList.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_Device.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_GatewayContext.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_GatewayException.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_GatewayUtility.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRIS.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISConnection.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISEmbedded.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISGlobalNode.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISGlobalNodeView.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISIterator.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISList.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISNative.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISOREF.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISObject.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_IRISReference.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_InStream.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_LegacyIterator.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_ListItem.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_ListReader.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_ListWriter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_LogFileStream.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_MessageHeader.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_OutStream.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_PrintStream.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_PythonGateway.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/_SharedMemorySocket.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/__main__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_Column.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_DBAPI.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_Descriptor.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_IRISStream.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_Message.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_Parameter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_ParameterCollection.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_ResultSetRow.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/_SQLType.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/preparser/_PreParser.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/preparser/_Scanner.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/preparser/_Token.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/preparser/_TokenList.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/dbapi/preparser/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_BusinessHost.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_BusinessOperation.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_BusinessProcess.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_BusinessService.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_Common.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_Director.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_IRISBusinessOperation.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_IRISBusinessService.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_IRISInboundAdapter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_IRISOutboundAdapter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_InboundAdapter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_Message.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/_OutboundAdapter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/intersystems_iris/pex/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/__main__.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_async_request.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_business_host.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_business_operation.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_business_process.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_business_service.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_cli.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_common.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_decorators.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_director.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_inbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_log_manager.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_message.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_message_validator.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_outbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_private_session_duplex.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/_private_session_process.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/BusinessProcess.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Common.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Director.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Message/JSONSchema.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Message.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/PrivateSession/Duplex.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/PrivateSession/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Test.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/cls/IOP/Utils.cls +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iop/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iris_pex_embedded_python.egg-info/SOURCES.txt +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iris_pex_embedded_python.egg-info/dependency_links.txt +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iris_pex_embedded_python.egg-info/entry_points.txt +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/iris_pex_embedded_python.egg-info/top_level.txt +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/irisnative/_IRISNative.py +0 -0
- {iris_pex_embedded_python-3.4.0b3 → iris_pex_embedded_python-3.4.0b5}/src/irisnative/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: iris_pex_embedded_python
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.0b5
|
|
4
4
|
Summary: Iris Interoperability based on Embedded Python
|
|
5
5
|
Author-email: grongier <guillaume.rongier@intersystems.com>
|
|
6
6
|
License: MIT License
|
|
@@ -44,12 +44,10 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
44
44
|
Classifier: Topic :: Utilities
|
|
45
45
|
Description-Content-Type: text/markdown
|
|
46
46
|
License-File: LICENSE
|
|
47
|
-
Requires-Dist: dacite>=1.6.0
|
|
48
47
|
Requires-Dist: pydantic>=2.0.0
|
|
49
48
|
Requires-Dist: xmltodict>=0.12.0
|
|
50
49
|
Requires-Dist: iris-embedded-python-wrapper>=0.0.6
|
|
51
50
|
Requires-Dist: setuptools>=40.8.0
|
|
52
|
-
Requires-Dist: dc-schema>=0.0.8
|
|
53
51
|
Requires-Dist: jsonpath-ng>=1.7.0
|
|
54
52
|
|
|
55
53
|
# IoP (Interoperability On Python)
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "iris_pex_embedded_python"
|
|
6
|
-
version = "3.4.
|
|
6
|
+
version = "3.4.0b5"
|
|
7
7
|
description = "Iris Interoperability based on Embedded Python"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
authors = [
|
|
@@ -27,12 +27,10 @@ classifiers = [
|
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
dependencies = [
|
|
30
|
-
"dacite >=1.6.0",
|
|
31
30
|
"pydantic>=2.0.0",
|
|
32
31
|
"xmltodict>=0.12.0",
|
|
33
32
|
"iris-embedded-python-wrapper>=0.0.6",
|
|
34
33
|
"setuptools>=40.8.0",
|
|
35
|
-
"dc-schema>=0.0.8",
|
|
36
34
|
"jsonpath-ng>=1.7.0"
|
|
37
35
|
]
|
|
38
36
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
from inspect import signature
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from iop._serialization import serialize_message, serialize_pickle_message, deserialize_message, deserialize_pickle_message
|
|
5
|
+
from iop._message_validator import is_message_instance, is_pickle_message_instance, is_iris_object_instance
|
|
6
|
+
|
|
7
|
+
def dispatch_serializer(message: Any) -> Any:
|
|
8
|
+
"""Serializes the message based on its type.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
message: The message to serialize
|
|
12
|
+
|
|
13
|
+
Returns:
|
|
14
|
+
The serialized message
|
|
15
|
+
|
|
16
|
+
Raises:
|
|
17
|
+
TypeError: If message is invalid type
|
|
18
|
+
"""
|
|
19
|
+
if message is not None:
|
|
20
|
+
if is_message_instance(message):
|
|
21
|
+
return serialize_message(message)
|
|
22
|
+
elif is_pickle_message_instance(message):
|
|
23
|
+
return serialize_pickle_message(message)
|
|
24
|
+
elif is_iris_object_instance(message):
|
|
25
|
+
return message
|
|
26
|
+
|
|
27
|
+
if message == "" or message is None:
|
|
28
|
+
return message
|
|
29
|
+
|
|
30
|
+
raise TypeError("The message must be an instance of a class that is a subclass of Message or IRISObject %Persistent class.")
|
|
31
|
+
|
|
32
|
+
def dispatch_deserializer(serial: Any) -> Any:
|
|
33
|
+
"""Deserializes the message based on its type.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
serial: The serialized message
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
The deserialized message
|
|
40
|
+
"""
|
|
41
|
+
if (
|
|
42
|
+
serial is not None
|
|
43
|
+
and type(serial).__module__.startswith('iris')
|
|
44
|
+
and (
|
|
45
|
+
serial._IsA("IOP.Message")
|
|
46
|
+
or serial._IsA("Grongier.PEX.Message")
|
|
47
|
+
)
|
|
48
|
+
):
|
|
49
|
+
return deserialize_message(serial)
|
|
50
|
+
elif (
|
|
51
|
+
serial is not None
|
|
52
|
+
and type(serial).__module__.startswith('iris')
|
|
53
|
+
and (
|
|
54
|
+
serial._IsA("IOP.PickleMessage")
|
|
55
|
+
or serial._IsA("Grongier.PEX.PickleMessage")
|
|
56
|
+
)
|
|
57
|
+
):
|
|
58
|
+
return deserialize_pickle_message(serial)
|
|
59
|
+
else:
|
|
60
|
+
return serial
|
|
61
|
+
|
|
62
|
+
def dispach_message(host, request: Any) -> Any:
|
|
63
|
+
"""Dispatches the message to the appropriate method.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
request: The request object
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
The response object
|
|
70
|
+
"""
|
|
71
|
+
call = 'on_message'
|
|
72
|
+
|
|
73
|
+
module = request.__class__.__module__
|
|
74
|
+
classname = request.__class__.__name__
|
|
75
|
+
|
|
76
|
+
for msg, method in host.DISPATCH:
|
|
77
|
+
if msg == module + "." + classname:
|
|
78
|
+
call = method
|
|
79
|
+
|
|
80
|
+
return getattr(host, call)(request)
|
|
81
|
+
|
|
82
|
+
def create_dispatch(host) -> None:
|
|
83
|
+
"""Creates a list of tuples, where each tuple contains the name of a class and the name of a method
|
|
84
|
+
that takes an instance of that class as its only argument.
|
|
85
|
+
"""
|
|
86
|
+
if len(host.DISPATCH) == 0:
|
|
87
|
+
method_list = [func for func in dir(host) if callable(getattr(host, func)) and not func.startswith("_")]
|
|
88
|
+
for method in method_list:
|
|
89
|
+
try:
|
|
90
|
+
param = signature(getattr(host, method)).parameters
|
|
91
|
+
except ValueError as e:
|
|
92
|
+
param = ''
|
|
93
|
+
if (len(param) == 1):
|
|
94
|
+
annotation = str(param[list(param)[0]].annotation)
|
|
95
|
+
i = annotation.find("'")
|
|
96
|
+
j = annotation.rfind("'")
|
|
97
|
+
if j == -1:
|
|
98
|
+
j = None
|
|
99
|
+
classname = annotation[i+1:j]
|
|
100
|
+
host.DISPATCH.append((classname, method))
|
|
101
|
+
return
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import codecs
|
|
3
|
+
import importlib
|
|
4
|
+
import inspect
|
|
5
|
+
import pickle
|
|
6
|
+
import json
|
|
7
|
+
from dataclasses import asdict, is_dataclass
|
|
8
|
+
from typing import Any, Dict, Type
|
|
9
|
+
|
|
10
|
+
import iris
|
|
11
|
+
from pydantic import BaseModel, TypeAdapter
|
|
12
|
+
|
|
13
|
+
from iop._message import _PydanticPickleMessage
|
|
14
|
+
from iop._utils import _Utils
|
|
15
|
+
|
|
16
|
+
class SerializationError(Exception):
|
|
17
|
+
"""Exception raised for serialization errors."""
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
class TempPydanticModel(BaseModel):
|
|
21
|
+
model_config = {
|
|
22
|
+
'arbitrary_types_allowed' : True,
|
|
23
|
+
'extra' : 'allow'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class MessageSerializer:
|
|
27
|
+
"""Handles message serialization and deserialization."""
|
|
28
|
+
|
|
29
|
+
@staticmethod
|
|
30
|
+
def _convert_to_json_safe(obj: Any) -> Any:
|
|
31
|
+
"""Convert objects to JSON-safe format."""
|
|
32
|
+
if isinstance(obj, BaseModel):
|
|
33
|
+
return obj.model_dump_json()
|
|
34
|
+
elif is_dataclass(obj):
|
|
35
|
+
return TempPydanticModel.model_validate(dataclass_to_dict(obj)).model_dump_json()
|
|
36
|
+
else:
|
|
37
|
+
raise SerializationError(f"Object {obj} must be a Pydantic model or dataclass")
|
|
38
|
+
|
|
39
|
+
@staticmethod
|
|
40
|
+
def serialize(message: Any, use_pickle: bool = False) -> iris.cls:
|
|
41
|
+
"""Serializes a message to IRIS format."""
|
|
42
|
+
if isinstance(message, _PydanticPickleMessage) or use_pickle:
|
|
43
|
+
return MessageSerializer._serialize_pickle(message)
|
|
44
|
+
return MessageSerializer._serialize_json(message)
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def _serialize_json(message: Any) -> iris.cls:
|
|
48
|
+
json_string = MessageSerializer._convert_to_json_safe(message)
|
|
49
|
+
|
|
50
|
+
msg = iris.cls('IOP.Message')._New()
|
|
51
|
+
msg.classname = f"{message.__class__.__module__}.{message.__class__.__name__}"
|
|
52
|
+
|
|
53
|
+
if hasattr(msg, 'buffer') and len(json_string) > msg.buffer:
|
|
54
|
+
msg.json = _Utils.string_to_stream(json_string, msg.buffer)
|
|
55
|
+
else:
|
|
56
|
+
msg.json = json_string
|
|
57
|
+
return msg
|
|
58
|
+
|
|
59
|
+
@staticmethod
|
|
60
|
+
def deserialize(serial: iris.cls, use_pickle: bool = False) -> Any:
|
|
61
|
+
if use_pickle:
|
|
62
|
+
return MessageSerializer._deserialize_pickle(serial)
|
|
63
|
+
return MessageSerializer._deserialize_json(serial)
|
|
64
|
+
|
|
65
|
+
@staticmethod
|
|
66
|
+
def _deserialize_json(serial: iris.cls) -> Any:
|
|
67
|
+
if not serial.classname:
|
|
68
|
+
raise SerializationError("JSON message malformed, must include classname")
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
module_name, class_name = MessageSerializer._parse_classname(serial.classname)
|
|
72
|
+
module = importlib.import_module(module_name)
|
|
73
|
+
msg_class = getattr(module, class_name)
|
|
74
|
+
except Exception as e:
|
|
75
|
+
raise SerializationError(f"Failed to load class {serial.classname}: {str(e)}")
|
|
76
|
+
|
|
77
|
+
json_string = (_Utils.stream_to_string(serial.json)
|
|
78
|
+
if serial.type == 'Stream' else serial.json)
|
|
79
|
+
|
|
80
|
+
try:
|
|
81
|
+
if issubclass(msg_class, BaseModel):
|
|
82
|
+
return msg_class.model_validate_json(json_string)
|
|
83
|
+
elif is_dataclass(msg_class):
|
|
84
|
+
return dataclass_from_dict(msg_class, json.loads(json_string))
|
|
85
|
+
else:
|
|
86
|
+
raise SerializationError(f"Class {msg_class} must be a Pydantic model or dataclass")
|
|
87
|
+
except Exception as e:
|
|
88
|
+
raise SerializationError(f"Failed to deserialize JSON: {str(e)}")
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
def _serialize_pickle(message: Any) -> iris.cls:
|
|
92
|
+
pickle_string = codecs.encode(pickle.dumps(message), "base64").decode()
|
|
93
|
+
msg = iris.cls('IOP.PickleMessage')._New()
|
|
94
|
+
msg.classname = f"{message.__class__.__module__}.{message.__class__.__name__}"
|
|
95
|
+
msg.jstr = _Utils.string_to_stream(pickle_string)
|
|
96
|
+
return msg
|
|
97
|
+
|
|
98
|
+
@staticmethod
|
|
99
|
+
def _deserialize_pickle(serial: iris.cls) -> Any:
|
|
100
|
+
string = _Utils.stream_to_string(serial.jstr)
|
|
101
|
+
return pickle.loads(codecs.decode(string.encode(), "base64"))
|
|
102
|
+
|
|
103
|
+
@staticmethod
|
|
104
|
+
def _parse_classname(classname: str) -> tuple[str, str]:
|
|
105
|
+
j = classname.rindex(".")
|
|
106
|
+
if j <= 0:
|
|
107
|
+
raise SerializationError(f"Classname must include a module: {classname}")
|
|
108
|
+
return classname[:j], classname[j+1:]
|
|
109
|
+
|
|
110
|
+
def dataclass_from_dict(klass: Type, dikt: Dict) -> Any:
|
|
111
|
+
field_types = {
|
|
112
|
+
key: val.annotation
|
|
113
|
+
for key, val in inspect.signature(klass).parameters.items()
|
|
114
|
+
}
|
|
115
|
+
processed_dict = {}
|
|
116
|
+
for key, val in inspect.signature(klass).parameters.items():
|
|
117
|
+
if key not in dikt and val.default != val.empty:
|
|
118
|
+
processed_dict[key] = val.default
|
|
119
|
+
continue
|
|
120
|
+
|
|
121
|
+
value = dikt.get(key)
|
|
122
|
+
if value is None:
|
|
123
|
+
processed_dict[key] = None
|
|
124
|
+
continue
|
|
125
|
+
|
|
126
|
+
try:
|
|
127
|
+
field_type = field_types[key]
|
|
128
|
+
if field_type != inspect.Parameter.empty:
|
|
129
|
+
adapter = TypeAdapter(field_type)
|
|
130
|
+
processed_dict[key] = adapter.validate_python(value)
|
|
131
|
+
else:
|
|
132
|
+
processed_dict[key] = value
|
|
133
|
+
except Exception:
|
|
134
|
+
processed_dict[key] = value
|
|
135
|
+
|
|
136
|
+
instance = klass(
|
|
137
|
+
**processed_dict
|
|
138
|
+
)
|
|
139
|
+
# handle any extra fields
|
|
140
|
+
for k, v in dikt.items():
|
|
141
|
+
if k not in processed_dict:
|
|
142
|
+
setattr(instance, k, v)
|
|
143
|
+
return instance
|
|
144
|
+
|
|
145
|
+
def dataclass_to_dict(instance: Any) -> Dict:
|
|
146
|
+
"""Converts a class instance to a dictionary.
|
|
147
|
+
Handles non attended fields."""
|
|
148
|
+
dikt = asdict(instance)
|
|
149
|
+
# assign any extra fields
|
|
150
|
+
for k, v in vars(instance).items():
|
|
151
|
+
if k not in dikt:
|
|
152
|
+
dikt[k] = v
|
|
153
|
+
return dikt
|
|
154
|
+
|
|
155
|
+
# Maintain backwards compatibility
|
|
156
|
+
serialize_pickle_message = lambda msg: MessageSerializer.serialize(msg, use_pickle=True)
|
|
157
|
+
serialize_message = lambda msg: MessageSerializer.serialize(msg, use_pickle=False)
|
|
158
|
+
deserialize_pickle_message = lambda serial: MessageSerializer.deserialize(serial, use_pickle=True)
|
|
159
|
+
deserialize_message = lambda serial: MessageSerializer.deserialize(serial, use_pickle=False)
|
|
@@ -8,7 +8,7 @@ import pkg_resources
|
|
|
8
8
|
import importlib
|
|
9
9
|
import json
|
|
10
10
|
from iop._message import _Message, _PydanticMessage
|
|
11
|
-
from
|
|
11
|
+
from pydantic import TypeAdapter
|
|
12
12
|
|
|
13
13
|
class _Utils():
|
|
14
14
|
@staticmethod
|
|
@@ -46,7 +46,8 @@ class _Utils():
|
|
|
46
46
|
if issubclass(cls,_PydanticMessage):
|
|
47
47
|
schema = cls.model_json_schema()
|
|
48
48
|
elif issubclass(cls,_Message):
|
|
49
|
-
|
|
49
|
+
type_adapter = TypeAdapter(cls)
|
|
50
|
+
schema = type_adapter.json_schema()
|
|
50
51
|
else:
|
|
51
52
|
raise ValueError("The class must be a subclass of _Message or _PydanticMessage")
|
|
52
53
|
schema_name = cls.__module__ + '.' + cls.__name__
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: iris_pex_embedded_python
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.0b5
|
|
4
4
|
Summary: Iris Interoperability based on Embedded Python
|
|
5
5
|
Author-email: grongier <guillaume.rongier@intersystems.com>
|
|
6
6
|
License: MIT License
|
|
@@ -44,12 +44,10 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
44
44
|
Classifier: Topic :: Utilities
|
|
45
45
|
Description-Content-Type: text/markdown
|
|
46
46
|
License-File: LICENSE
|
|
47
|
-
Requires-Dist: dacite>=1.6.0
|
|
48
47
|
Requires-Dist: pydantic>=2.0.0
|
|
49
48
|
Requires-Dist: xmltodict>=0.12.0
|
|
50
49
|
Requires-Dist: iris-embedded-python-wrapper>=0.0.6
|
|
51
50
|
Requires-Dist: setuptools>=40.8.0
|
|
52
|
-
Requires-Dist: dc-schema>=0.0.8
|
|
53
51
|
Requires-Dist: jsonpath-ng>=1.7.0
|
|
54
52
|
|
|
55
53
|
# IoP (Interoperability On Python)
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import codecs
|
|
2
|
-
import importlib
|
|
3
|
-
from inspect import signature
|
|
4
|
-
import json
|
|
5
|
-
import pickle
|
|
6
|
-
from typing import Any, Dict, List, Type
|
|
7
|
-
|
|
8
|
-
import iris
|
|
9
|
-
from dacite import Config, from_dict
|
|
10
|
-
from pydantic import BaseModel
|
|
11
|
-
|
|
12
|
-
from iop._utils import _Utils
|
|
13
|
-
from iop._serialization import IrisJSONEncoder, IrisJSONDecoder
|
|
14
|
-
from iop._message_validator import is_message_instance, is_pickle_message_instance, is_iris_object_instance
|
|
15
|
-
|
|
16
|
-
def serialize_pickle_message(message: Any) -> iris.cls:
|
|
17
|
-
"""Converts a python dataclass message into an iris iop.message.
|
|
18
|
-
|
|
19
|
-
Args:
|
|
20
|
-
message: The message to serialize, an instance of a class that is a subclass of Message.
|
|
21
|
-
|
|
22
|
-
Returns:
|
|
23
|
-
The message in json format.
|
|
24
|
-
"""
|
|
25
|
-
pickle_string = codecs.encode(pickle.dumps(message), "base64").decode()
|
|
26
|
-
module = message.__class__.__module__
|
|
27
|
-
classname = message.__class__.__name__
|
|
28
|
-
|
|
29
|
-
msg = iris.cls('IOP.PickleMessage')._New()
|
|
30
|
-
msg.classname = module + "." + classname
|
|
31
|
-
|
|
32
|
-
stream = _Utils.string_to_stream(pickle_string)
|
|
33
|
-
msg.jstr = stream
|
|
34
|
-
|
|
35
|
-
return msg
|
|
36
|
-
|
|
37
|
-
def dispatch_serializer(message: Any) -> Any:
|
|
38
|
-
"""Serializes the message based on its type.
|
|
39
|
-
|
|
40
|
-
Args:
|
|
41
|
-
message: The message to serialize
|
|
42
|
-
|
|
43
|
-
Returns:
|
|
44
|
-
The serialized message
|
|
45
|
-
|
|
46
|
-
Raises:
|
|
47
|
-
TypeError: If message is invalid type
|
|
48
|
-
"""
|
|
49
|
-
if message is not None:
|
|
50
|
-
if is_message_instance(message):
|
|
51
|
-
return serialize_message(message)
|
|
52
|
-
elif is_pickle_message_instance(message):
|
|
53
|
-
return serialize_pickle_message(message)
|
|
54
|
-
elif is_iris_object_instance(message):
|
|
55
|
-
return message
|
|
56
|
-
|
|
57
|
-
if message == "" or message is None:
|
|
58
|
-
return message
|
|
59
|
-
|
|
60
|
-
raise TypeError("The message must be an instance of a class that is a subclass of Message or IRISObject %Persistent class.")
|
|
61
|
-
|
|
62
|
-
def serialize_message(message: Any) -> iris.cls:
|
|
63
|
-
"""Converts a python dataclass message into an iris iop.message.
|
|
64
|
-
|
|
65
|
-
Args:
|
|
66
|
-
message: The message to serialize, an instance of a class that is a subclass of Message.
|
|
67
|
-
|
|
68
|
-
Returns:
|
|
69
|
-
The message in json format.
|
|
70
|
-
"""
|
|
71
|
-
json_string = json.dumps(message, cls=IrisJSONEncoder, ensure_ascii=False)
|
|
72
|
-
module = message.__class__.__module__
|
|
73
|
-
classname = message.__class__.__name__
|
|
74
|
-
|
|
75
|
-
msg = iris.cls('IOP.Message')._New()
|
|
76
|
-
msg.classname = module + "." + classname
|
|
77
|
-
|
|
78
|
-
if hasattr(msg, 'buffer') and len(json_string) > msg.buffer:
|
|
79
|
-
msg.json = _Utils.string_to_stream(json_string, msg.buffer)
|
|
80
|
-
else:
|
|
81
|
-
msg.json = json_string
|
|
82
|
-
|
|
83
|
-
return msg
|
|
84
|
-
|
|
85
|
-
def deserialize_pickle_message(serial: iris.cls) -> Any:
|
|
86
|
-
"""Converts an iris iop.message into a python dataclass message.
|
|
87
|
-
|
|
88
|
-
Args:
|
|
89
|
-
serial: The serialized message
|
|
90
|
-
|
|
91
|
-
Returns:
|
|
92
|
-
The deserialized message
|
|
93
|
-
"""
|
|
94
|
-
string = _Utils.stream_to_string(serial.jstr)
|
|
95
|
-
msg = pickle.loads(codecs.decode(string.encode(), "base64"))
|
|
96
|
-
return msg
|
|
97
|
-
|
|
98
|
-
def dispatch_deserializer(serial: Any) -> Any:
|
|
99
|
-
"""Deserializes the message based on its type.
|
|
100
|
-
|
|
101
|
-
Args:
|
|
102
|
-
serial: The serialized message
|
|
103
|
-
|
|
104
|
-
Returns:
|
|
105
|
-
The deserialized message
|
|
106
|
-
"""
|
|
107
|
-
if (
|
|
108
|
-
serial is not None
|
|
109
|
-
and type(serial).__module__.startswith('iris')
|
|
110
|
-
and (
|
|
111
|
-
serial._IsA("IOP.Message")
|
|
112
|
-
or serial._IsA("Grongier.PEX.Message")
|
|
113
|
-
)
|
|
114
|
-
):
|
|
115
|
-
return deserialize_message(serial)
|
|
116
|
-
elif (
|
|
117
|
-
serial is not None
|
|
118
|
-
and type(serial).__module__.startswith('iris')
|
|
119
|
-
and (
|
|
120
|
-
serial._IsA("IOP.PickleMessage")
|
|
121
|
-
or serial._IsA("Grongier.PEX.PickleMessage")
|
|
122
|
-
)
|
|
123
|
-
):
|
|
124
|
-
return deserialize_pickle_message(serial)
|
|
125
|
-
else:
|
|
126
|
-
return serial
|
|
127
|
-
|
|
128
|
-
def deserialize_message(serial: iris.cls) -> Any:
|
|
129
|
-
"""Converts an iris iop.message into a python dataclass message.
|
|
130
|
-
|
|
131
|
-
Args:
|
|
132
|
-
serial: The serialized message
|
|
133
|
-
|
|
134
|
-
Returns:
|
|
135
|
-
The deserialized message
|
|
136
|
-
"""
|
|
137
|
-
if (serial.classname is None):
|
|
138
|
-
raise ValueError("JSON message malformed, must include classname")
|
|
139
|
-
classname = serial.classname
|
|
140
|
-
|
|
141
|
-
j = classname.rindex(".")
|
|
142
|
-
if (j <= 0):
|
|
143
|
-
raise ValueError("Classname must include a module: " + classname)
|
|
144
|
-
try:
|
|
145
|
-
module = importlib.import_module(classname[:j])
|
|
146
|
-
msg = getattr(module, classname[j+1:])
|
|
147
|
-
except Exception:
|
|
148
|
-
raise ImportError("Class not found: " + classname)
|
|
149
|
-
|
|
150
|
-
string = ""
|
|
151
|
-
if (serial.type == 'Stream'):
|
|
152
|
-
string = _Utils.stream_to_string(serial.json)
|
|
153
|
-
else:
|
|
154
|
-
string = serial.json
|
|
155
|
-
|
|
156
|
-
jdict = json.loads(string, cls=IrisJSONDecoder)
|
|
157
|
-
return dataclass_from_dict(msg, jdict)
|
|
158
|
-
|
|
159
|
-
def dataclass_from_dict(klass: Type, dikt: Dict) -> Any:
|
|
160
|
-
"""Converts a dictionary to a dataclass instance.
|
|
161
|
-
|
|
162
|
-
Args:
|
|
163
|
-
klass: The dataclass to convert to
|
|
164
|
-
dikt: The dictionary to convert to a dataclass
|
|
165
|
-
|
|
166
|
-
Returns:
|
|
167
|
-
A dataclass object with the fields of the dataclass and the fields of the dictionary.
|
|
168
|
-
"""
|
|
169
|
-
if issubclass(klass, BaseModel):
|
|
170
|
-
return klass.model_validate(dikt)
|
|
171
|
-
else:
|
|
172
|
-
ret = from_dict(klass, dikt, Config(check_types=False))
|
|
173
|
-
|
|
174
|
-
try:
|
|
175
|
-
fieldtypes = klass.__annotations__
|
|
176
|
-
except Exception as e:
|
|
177
|
-
fieldtypes = []
|
|
178
|
-
|
|
179
|
-
for key, val in dikt.items():
|
|
180
|
-
if key not in fieldtypes:
|
|
181
|
-
setattr(ret, key, val)
|
|
182
|
-
return ret
|
|
183
|
-
|
|
184
|
-
def dispach_message(host, request: Any) -> Any:
|
|
185
|
-
"""Dispatches the message to the appropriate method.
|
|
186
|
-
|
|
187
|
-
Args:
|
|
188
|
-
request: The request object
|
|
189
|
-
|
|
190
|
-
Returns:
|
|
191
|
-
The response object
|
|
192
|
-
"""
|
|
193
|
-
call = 'on_message'
|
|
194
|
-
|
|
195
|
-
module = request.__class__.__module__
|
|
196
|
-
classname = request.__class__.__name__
|
|
197
|
-
|
|
198
|
-
for msg, method in host.DISPATCH:
|
|
199
|
-
if msg == module + "." + classname:
|
|
200
|
-
call = method
|
|
201
|
-
|
|
202
|
-
return getattr(host, call)(request)
|
|
203
|
-
|
|
204
|
-
def create_dispatch(host) -> None:
|
|
205
|
-
"""Creates a list of tuples, where each tuple contains the name of a class and the name of a method
|
|
206
|
-
that takes an instance of that class as its only argument.
|
|
207
|
-
"""
|
|
208
|
-
if len(host.DISPATCH) == 0:
|
|
209
|
-
method_list = [func for func in dir(host) if callable(getattr(host, func)) and not func.startswith("_")]
|
|
210
|
-
for method in method_list:
|
|
211
|
-
try:
|
|
212
|
-
param = signature(getattr(host, method)).parameters
|
|
213
|
-
except ValueError as e:
|
|
214
|
-
param = ''
|
|
215
|
-
if (len(param) == 1):
|
|
216
|
-
annotation = str(param[list(param)[0]].annotation)
|
|
217
|
-
i = annotation.find("'")
|
|
218
|
-
j = annotation.rfind("'")
|
|
219
|
-
if j == -1:
|
|
220
|
-
j = None
|
|
221
|
-
classname = annotation[i+1:j]
|
|
222
|
-
host.DISPATCH.append((classname, method))
|
|
223
|
-
return
|