iris-pex-embedded-python 3.4.4b3__tar.gz → 3.4.4b5__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.

Files changed (87) hide show
  1. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/PKG-INFO +1 -1
  2. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/pyproject.toml +1 -1
  3. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_async_request.py +6 -3
  4. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_business_host.py +5 -6
  5. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_business_operation.py +4 -3
  6. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_business_process.py +9 -8
  7. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_business_service.py +3 -2
  8. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_cli.py +10 -8
  9. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_common.py +11 -8
  10. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_debugpy.py +1 -1
  11. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_decorators.py +2 -1
  12. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_director.py +16 -16
  13. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_dispatch.py +44 -24
  14. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_inbound_adapter.py +1 -1
  15. iris_pex_embedded_python-3.4.4b5/src/iop/_iris.py +8 -0
  16. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_log_manager.py +27 -10
  17. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_message.py +1 -0
  18. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_message_validator.py +2 -1
  19. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_outbound_adapter.py +1 -1
  20. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_private_session_duplex.py +5 -3
  21. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_private_session_process.py +3 -3
  22. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_serialization.py +4 -4
  23. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/_utils.py +21 -19
  24. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Common.cls +2 -0
  25. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Utils.cls +4 -0
  26. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iris_pex_embedded_python.egg-info/PKG-INFO +1 -1
  27. iris_pex_embedded_python-3.4.4b3/src/iop/_iris.py +0 -7
  28. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/LICENSE +0 -0
  29. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/README.md +0 -0
  30. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/setup.cfg +0 -0
  31. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/setup.py +0 -0
  32. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/__init__.py +0 -0
  33. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/BusinessOperation.cls +0 -0
  34. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -0
  35. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/BusinessService.cls +0 -0
  36. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Common.cls +0 -0
  37. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Director.cls +0 -0
  38. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Duplex/Operation.cls +0 -0
  39. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Duplex/Process.cls +0 -0
  40. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Duplex/Service.cls +0 -0
  41. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/InboundAdapter.cls +0 -0
  42. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Message.cls +0 -0
  43. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/OutboundAdapter.cls +0 -0
  44. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/PickleMessage.cls +0 -0
  45. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +0 -0
  46. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +0 -0
  47. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +0 -0
  48. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +0 -0
  49. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +0 -0
  50. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Test.cls +0 -0
  51. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/PEX/Utils.cls +0 -0
  52. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/cls/Grongier/Service/WSGI.cls +0 -0
  53. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/__init__.py +0 -0
  54. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/__main__.py +0 -0
  55. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/_business_host.py +0 -0
  56. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/_cli.py +0 -0
  57. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/_common.py +0 -0
  58. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/_director.py +0 -0
  59. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/_utils.py +0 -0
  60. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/grongier/pex/wsgi/handlers.py +0 -0
  61. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/__init__.py +0 -0
  62. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/__main__.py +0 -0
  63. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/BusinessOperation.cls +0 -0
  64. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/BusinessProcess.cls +0 -0
  65. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/BusinessService.cls +0 -0
  66. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Director.cls +0 -0
  67. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Duplex/Operation.cls +0 -0
  68. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Duplex/Process.cls +0 -0
  69. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Duplex/Service.cls +0 -0
  70. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/InboundAdapter.cls +0 -0
  71. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Message/JSONSchema.cls +0 -0
  72. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Message.cls +0 -0
  73. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/OutboundAdapter.cls +0 -0
  74. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/PickleMessage.cls +0 -0
  75. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/PrivateSession/Duplex.cls +0 -0
  76. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/PrivateSession/Message/Ack.cls +0 -0
  77. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/PrivateSession/Message/Poll.cls +0 -0
  78. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/PrivateSession/Message/Start.cls +0 -0
  79. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/PrivateSession/Message/Stop.cls +0 -0
  80. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Service/WSGI.cls +0 -0
  81. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/cls/IOP/Test.cls +0 -0
  82. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iop/wsgi/handlers.py +0 -0
  83. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iris_pex_embedded_python.egg-info/SOURCES.txt +0 -0
  84. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iris_pex_embedded_python.egg-info/dependency_links.txt +0 -0
  85. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iris_pex_embedded_python.egg-info/entry_points.txt +0 -0
  86. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iris_pex_embedded_python.egg-info/requires.txt +0 -0
  87. {iris_pex_embedded_python-3.4.4b3 → iris_pex_embedded_python-3.4.4b5}/src/iris_pex_embedded_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iris_pex_embedded_python
3
- Version: 3.4.4b3
3
+ Version: 3.4.4b5
4
4
  Summary: Iris Interoperability based on Embedded Python
5
5
  Author-email: grongier <guillaume.rongier@intersystems.com>
6
6
  License: MIT License
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "iris_pex_embedded_python"
6
- version = "3.4.4b3"
6
+ version = "3.4.4b5"
7
7
  description = "Iris Interoperability based on Embedded Python"
8
8
  readme = "README.md"
9
9
  authors = [
@@ -1,8 +1,9 @@
1
1
  import asyncio
2
- from . import _iris
3
2
  from typing import Any, Optional, Union
4
- from iop._dispatch import dispatch_deserializer, dispatch_serializer
5
- from iop._message import _Message as Message
3
+
4
+ from . import _iris
5
+ from ._dispatch import dispatch_deserializer, dispatch_serializer
6
+ from ._message import _Message as Message
6
7
 
7
8
  class AsyncRequest(asyncio.Future):
8
9
  _message_header_id: int = 0
@@ -19,6 +20,8 @@ class AsyncRequest(asyncio.Future):
19
20
  self.timeout = timeout
20
21
  self.description = description
21
22
  self.host = host
23
+ if host is None:
24
+ raise ValueError("host parameter cannot be None")
22
25
  self._iris_handle = host.iris_handle
23
26
  asyncio.create_task(self.send())
24
27
 
@@ -2,12 +2,11 @@ from inspect import getsource
2
2
  from typing import Any,List, Optional, Tuple, Union
3
3
 
4
4
  from . import _iris
5
-
6
- from iop._common import _Common
7
- from iop._message import _Message as Message
8
- from iop._decorators import input_serializer_param, output_deserializer
9
- from iop._dispatch import dispatch_serializer, dispatch_deserializer
10
- from iop._async_request import AsyncRequest
5
+ from ._common import _Common
6
+ from ._message import _Message as Message
7
+ from ._decorators import input_serializer_param, output_deserializer
8
+ from ._dispatch import dispatch_serializer, dispatch_deserializer
9
+ from ._async_request import AsyncRequest
11
10
 
12
11
  class _BusinessHost(_Common):
13
12
  """Base class for business components that defines common methods.
@@ -1,8 +1,9 @@
1
1
  import importlib
2
2
  from typing import Any, List, Optional, Union, Tuple
3
- from iop._business_host import _BusinessHost
4
- from iop._decorators import input_deserializer, output_serializer, input_serializer, output_deserializer
5
- from iop._dispatch import create_dispatch, dispach_message
3
+
4
+ from ._business_host import _BusinessHost
5
+ from ._decorators import input_deserializer, output_serializer, input_serializer, output_deserializer
6
+ from ._dispatch import create_dispatch, dispach_message
6
7
 
7
8
  class _BusinessOperation(_BusinessHost):
8
9
  """Business operation component that handles outbound communication.
@@ -1,7 +1,8 @@
1
1
  from typing import Any, List, Optional, Union
2
- from iop._business_host import _BusinessHost
3
- from iop._decorators import input_deserializer, input_serializer_param, output_serializer, input_serializer, output_deserializer
4
- from iop._dispatch import create_dispatch, dispach_message
2
+
3
+ from ._business_host import _BusinessHost
4
+ from ._decorators import input_deserializer, input_serializer_param, output_serializer, input_serializer, output_deserializer
5
+ from ._dispatch import create_dispatch, dispach_message
5
6
 
6
7
  class _BusinessProcess(_BusinessHost):
7
8
  """Business process component that contains routing and transformation logic.
@@ -72,23 +73,23 @@ class _BusinessProcess(_BusinessHost):
72
73
  return self.iris_handle.dispatchReply(response)
73
74
 
74
75
  @input_serializer_param(1,'request')
75
- def send_request_async(self, target: str, request: Any, response_required: bool=True, completion_key: Optional[str]=None, description: Optional[str]=None) -> None:
76
+ def send_request_async(self, target: str, request: Any, description: Optional[str]=None, completion_key: Optional[str]=None, response_required: bool=True) -> None:
76
77
  """Send the specified message to the target business process or business operation asynchronously.
77
78
 
78
79
  Args:
79
80
  target: The name of the business process or operation to receive the request
80
81
  request: The message to send to the target
81
- response_required: Whether a response is required
82
- completion_key: A string that will be returned with the response if the maximum time is exceeded
83
82
  description: An optional description property in the message header
83
+ completion_key: A string that will be returned with the response if the maximum time is exceeded
84
+ response_required: Whether a response is required
84
85
 
85
86
  Raises:
86
87
  TypeError: If request is not of type Message or IRISObject
87
88
  """
88
89
  if response_required:
89
- response_required = 1
90
+ response_required = True
90
91
  else:
91
- response_required = 0
92
+ response_required = False
92
93
  return self.iris_handle.dispatchSendRequestAsync(target, request, response_required, completion_key, description)
93
94
 
94
95
  def set_timer(self, timeout: Union[int, str], completion_key: Optional[str]=None) -> None:
@@ -1,6 +1,7 @@
1
1
  import importlib
2
- from iop._business_host import _BusinessHost
3
- from iop._decorators import input_deserializer, output_serializer, input_serializer, output_deserializer
2
+
3
+ from ._business_host import _BusinessHost
4
+ from ._decorators import input_deserializer, output_serializer, input_serializer, output_deserializer
4
5
 
5
6
  class _BusinessService(_BusinessHost):
6
7
  """ This class is responsible for receiving the data from external system and sending it to business processes or business operations in the production.
@@ -7,8 +7,9 @@ from enum import Enum, auto
7
7
  import sys
8
8
  from typing import Optional, Callable
9
9
  from importlib.metadata import version
10
- from iop._director import _Director
11
- from iop._utils import _Utils
10
+
11
+ from ._director import _Director
12
+ from ._utils import _Utils
12
13
 
13
14
 
14
15
  class CommandType(Enum):
@@ -97,7 +98,7 @@ class Command:
97
98
  def _handle_default(self) -> None:
98
99
  if self.args.default == 'not_set':
99
100
  print(_Director.get_default_production())
100
- else:
101
+ elif self.args.default is not None:
101
102
  _Director.set_default_production(self.args.default)
102
103
 
103
104
  def _handle_list(self) -> None:
@@ -143,15 +144,16 @@ class Command:
143
144
 
144
145
  def _handle_migrate(self) -> None:
145
146
  migrate_path = self.args.migrate
146
- if not os.path.isabs(migrate_path):
147
- migrate_path = os.path.join(os.getcwd(), migrate_path)
148
- _Utils.migrate(migrate_path)
147
+ if migrate_path is not None:
148
+ if not os.path.isabs(migrate_path):
149
+ migrate_path = os.path.join(os.getcwd(), migrate_path)
150
+ _Utils.migrate(migrate_path)
149
151
 
150
152
  def _handle_log(self) -> None:
151
153
  if self.args.log == 'not_set':
152
154
  print(_Director.log_production())
153
- else:
154
- print(_Director.log_production_top(self.args.log))
155
+ elif self.args.log is not None:
156
+ print(_Director.log_production_top(int(self.args.log)))
155
157
 
156
158
  def _handle_init(self) -> None:
157
159
  _Utils.setup(None)
@@ -1,14 +1,11 @@
1
1
  import abc
2
2
  import inspect
3
3
  import traceback
4
-
5
4
  from typing import Any, ClassVar, List, Optional, Tuple
6
5
 
7
6
  from . import _iris
8
-
9
- from iop._log_manager import LogManager, logging
10
-
11
- from iop._debugpy import debugpython
7
+ from ._log_manager import LogManager, logging
8
+ from ._debugpy import debugpython
12
9
 
13
10
  class _Common(metaclass=abc.ABCMeta):
14
11
  """Base class that defines common methods for all component types.
@@ -21,7 +18,12 @@ class _Common(metaclass=abc.ABCMeta):
21
18
  ICON_URL: ClassVar[str]
22
19
  iris_handle: Any = None
23
20
  _log_to_console: bool = False
24
- _logger: logging.Logger = None
21
+ _logger: Optional[logging.Logger] = None
22
+
23
+ @staticmethod
24
+ def get_adapter_type() -> Optional[str]:
25
+ """Get the adapter type for this component. Override in subclasses."""
26
+ return None
25
27
 
26
28
  @property
27
29
  def logger(self) -> logging.Logger:
@@ -104,7 +106,8 @@ class _Common(metaclass=abc.ABCMeta):
104
106
  super_class = classname[1:-1]
105
107
  adapter = cls.get_adapter_type()
106
108
  if adapter is None:
107
- adapter = cls.getAdapterType()
109
+ # for retro-compatibility
110
+ adapter = cls.getAdapterType() # type: ignore
108
111
  break
109
112
  elif classname in ["'iop.BusinessProcess'","'iop.DuplexProcess'","'iop.InboundAdapter'","'iop.OutboundAdapter'",
110
113
  "'grongier.pex.BusinessProcess'","'grongier.pex.DuplexProcess'","'grongier.pex.InboundAdapter'","'grongier.pex.OutboundAdapter'"] :
@@ -113,7 +116,7 @@ class _Common(metaclass=abc.ABCMeta):
113
116
  break
114
117
 
115
118
  if ""==super_class:
116
- return ""
119
+ return []
117
120
  ret.append(super_class)
118
121
 
119
122
  # Get the class documentation, if any
@@ -83,7 +83,7 @@ def wait_for_debugpy_connected(timeout: float = 30, port: int = 0) -> bool:
83
83
 
84
84
  def timeout_handler():
85
85
  time.sleep(timeout)
86
- debugpy.wait_for_client.cancel()
86
+ debugpy.wait_for_client.cancel() # type: ignore
87
87
 
88
88
  threading.Thread(target=timeout_handler, daemon=True).start()
89
89
 
@@ -1,6 +1,7 @@
1
1
  from functools import wraps
2
2
  from typing import Any, Callable
3
- from iop._dispatch import dispatch_deserializer, dispatch_serializer
3
+
4
+ from ._dispatch import dispatch_deserializer, dispatch_serializer
4
5
 
5
6
  def input_serializer(fonction: Callable) -> Callable:
6
7
  """Decorator that serializes all input arguments."""
@@ -1,12 +1,24 @@
1
1
  import asyncio
2
2
  import datetime
3
3
  import functools
4
- from . import _iris
5
4
  import signal
6
5
  from dataclasses import dataclass
7
6
 
8
- from iop._dispatch import dispatch_deserializer, dispatch_serializer
9
- from iop._utils import _Utils
7
+ from . import _iris
8
+ from ._dispatch import dispatch_deserializer, dispatch_serializer
9
+ from ._utils import _Utils
10
+
11
+ @dataclass
12
+ class SigintHandler():
13
+
14
+ sigint: bool = False
15
+ sigint_log: bool = False
16
+ log_only: bool = False
17
+
18
+ def signal_handler(self, signal, frame):
19
+ if self.sigint or self.log_only:
20
+ self.sigint_log = True
21
+ self.sigint = True
10
22
 
11
23
  class _Director():
12
24
  """ The Directorclass is used for nonpolling business services, that is, business services which are not automatically
@@ -89,7 +101,7 @@ class _Director():
89
101
  loop.close()
90
102
 
91
103
  @staticmethod
92
- async def _start_production_async(production_name=None, handler=None):
104
+ async def _start_production_async(production_name:str, handler: SigintHandler):
93
105
  _Director.start_production(production_name)
94
106
  while True:
95
107
  if handler.sigint:
@@ -286,15 +298,3 @@ class _Director():
286
298
  deserialized_response = f'{response.classname} : {_Utils.stream_to_string(response.jstr)}'
287
299
  return deserialized_response
288
300
 
289
-
290
- @dataclass
291
- class SigintHandler():
292
-
293
- sigint: bool = False
294
- sigint_log: bool = False
295
- log_only: bool = False
296
-
297
- def signal_handler(self, signal, frame):
298
- if self.sigint or self.log_only:
299
- self.sigint_log = True
300
- self.sigint = True
@@ -1,8 +1,8 @@
1
- from inspect import signature
2
- from typing import Any
1
+ from inspect import signature, Parameter
2
+ from typing import Any, List, Tuple, Callable
3
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
4
+ from ._serialization import serialize_message, serialize_pickle_message, deserialize_message, deserialize_pickle_message
5
+ from ._message_validator import is_message_instance, is_pickle_message_instance, is_iris_object_instance
6
6
 
7
7
  def dispatch_serializer(message: Any) -> Any:
8
8
  """Serializes the message based on its type.
@@ -59,7 +59,7 @@ def dispatch_deserializer(serial: Any) -> Any:
59
59
  else:
60
60
  return serial
61
61
 
62
- def dispach_message(host, request: Any) -> Any:
62
+ def dispach_message(host: Any, request: Any) -> Any:
63
63
  """Dispatches the message to the appropriate method.
64
64
 
65
65
  Args:
@@ -79,23 +79,43 @@ def dispach_message(host, request: Any) -> Any:
79
79
 
80
80
  return getattr(host, call)(request)
81
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.
82
+ def create_dispatch(host: Any) -> None:
83
+ """Creates a dispatch table mapping class names to their handler methods.
84
+ The dispatch table consists of tuples of (fully_qualified_class_name, method_name).
85
+ Only methods that take a single typed parameter are considered as handlers.
85
86
  """
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
87
+ if len(host.DISPATCH) > 0:
88
+ return
89
+
90
+ for method_name in get_callable_methods(host):
91
+ handler_info = get_handler_info(host, method_name)
92
+ if handler_info:
93
+ host.DISPATCH.append(handler_info)
94
+
95
+ def get_callable_methods(host: Any) -> List[str]:
96
+ """Returns a list of callable method names that don't start with underscore."""
97
+ return [
98
+ func for func in dir(host)
99
+ if callable(getattr(host, func)) and not func.startswith("_")
100
+ ]
101
+
102
+ def get_handler_info(host: Any, method_name: str) -> Tuple[str, str] | None:
103
+ """Analyzes a method to determine if it's a valid message handler.
104
+ Returns a tuple of (fully_qualified_class_name, method_name) if valid,
105
+ None otherwise.
106
+ """
107
+ try:
108
+ params = signature(getattr(host, method_name)).parameters
109
+ if len(params) != 1:
110
+ return None
111
+
112
+ param: Parameter = next(iter(params.values()))
113
+ annotation = param.annotation
114
+
115
+ if annotation == Parameter.empty or not isinstance(annotation, type):
116
+ return None
117
+
118
+ return f"{annotation.__module__}.{annotation.__name__}", method_name
119
+
120
+ except ValueError:
121
+ return None
@@ -1,4 +1,4 @@
1
- from iop._common import _Common
1
+ from ._common import _Common
2
2
 
3
3
  class _InboundAdapter(_Common):
4
4
  """ Responsible for receiving the data from the external system, validating the data,
@@ -0,0 +1,8 @@
1
+ import os
2
+ from typing import Optional
3
+
4
+ def get_iris(namespace: Optional[str]=None)->'iris': # type: ignore
5
+ if namespace:
6
+ os.environ['IRISNAMESPACE'] = namespace
7
+ import iris
8
+ return iris
@@ -1,7 +1,6 @@
1
- import traceback
2
- from . import _iris
3
1
  import logging
4
- from typing import Optional, Tuple
2
+
3
+ from . import _iris
5
4
 
6
5
  class LogManager:
7
6
  """Manages logging integration between Python's logging module and IRIS."""
@@ -73,11 +72,29 @@ class IRISLogHandler(logging.Handler):
73
72
  Args:
74
73
  record: The logging record to emit
75
74
  """
76
- class_name = record.class_name if hasattr(record, "class_name") else record.name
77
- method_name = record.method_name if hasattr(record, "method_name") else record.funcName
78
- if self.to_console or (hasattr(record, "to_console") and record.to_console):
79
- _iris.get_iris().cls("%SYS.System").WriteToConsoleLog(self.format(record),
80
- 0,self.level_map_console.get(record.levelno, 0),class_name+"."+method_name)
75
+ # Extract class and method names with fallbacks
76
+ class_name = getattr(record, "class_name", record.name)
77
+ method_name = getattr(record, "method_name", record.funcName)
78
+
79
+ # Format message and get full method path
80
+ message = self.format(record)
81
+ method_path = f"{class_name}.{method_name}"
82
+
83
+ # Determine if console logging should be used
84
+ use_console = self.to_console or getattr(record, "to_console", False)
85
+
86
+ if use_console:
87
+ _iris.get_iris().cls("%SYS.System").WriteToConsoleLog(
88
+ message,
89
+ 0,
90
+ self.level_map_console.get(record.levelno, 0),
91
+ method_path
92
+ )
81
93
  else:
82
- log_lvl = self.level_map.get(record.levelno, 4)
83
- _iris.get_iris().cls("Ens.Util.Log").Log(log_lvl,class_name, method_name, self.format(record))
94
+ log_level = self.level_map.get(record.levelno, 4)
95
+ _iris.get_iris().cls("Ens.Util.Log").Log(
96
+ log_level,
97
+ class_name,
98
+ method_name,
99
+ message
100
+ )
@@ -1,4 +1,5 @@
1
1
  from typing import Any
2
+
2
3
  from pydantic import BaseModel
3
4
 
4
5
  class _Message:
@@ -1,6 +1,7 @@
1
1
  import dataclasses
2
2
  from typing import Any, Type
3
- from iop._message import _Message, _PickleMessage, _PydanticPickleMessage, BaseModel
3
+
4
+ from ._message import _Message, _PickleMessage, _PydanticPickleMessage, BaseModel
4
5
 
5
6
 
6
7
  def is_message_instance(obj: Any) -> bool:
@@ -1,4 +1,4 @@
1
- from iop._common import _Common
1
+ from ._common import _Common
2
2
 
3
3
  class _OutboundAdapter(_Common):
4
4
  """ Responsible for sending the data to the external system."""
@@ -1,6 +1,8 @@
1
1
  import importlib
2
- from iop._business_host import _BusinessHost
3
- from iop._decorators import input_deserializer, input_serializer_param, output_serializer, input_serializer, output_deserializer
2
+
3
+ from ._business_host import _BusinessHost
4
+ from ._decorators import input_deserializer, input_serializer_param, output_serializer, input_serializer, output_deserializer
5
+ from ._dispatch import create_dispatch, dispach_message
4
6
 
5
7
  class _PrivateSessionDuplex(_BusinessHost):
6
8
 
@@ -26,7 +28,7 @@ class _PrivateSessionDuplex(_BusinessHost):
26
28
  @output_serializer
27
29
  def _dispatch_on_message(self, request):
28
30
  """ For internal use only. """
29
- return self._dispach_message(request)
31
+ return dispach_message(self,request)
30
32
 
31
33
  def _set_iris_handles(self, handle_current, handle_partner):
32
34
  """ For internal use only. """
@@ -1,5 +1,5 @@
1
- from iop._business_process import _BusinessProcess
2
- from iop._decorators import input_deserializer, output_serializer, input_serializer, output_deserializer
1
+ from ._business_process import _BusinessProcess
2
+ from ._decorators import input_deserializer, output_serializer, input_serializer, output_deserializer
3
3
 
4
4
  class _PrivateSessionProcess(_BusinessProcess):
5
5
 
@@ -12,7 +12,7 @@ class _PrivateSessionProcess(_BusinessProcess):
12
12
  self._save_persistent_properties(host_object)
13
13
  return return_object
14
14
 
15
- def on_document(source_config_name,request):
15
+ def on_document(self,source_config_name,request):
16
16
  pass
17
17
 
18
18
 
@@ -7,11 +7,11 @@ import json
7
7
  from dataclasses import is_dataclass
8
8
  from typing import Any, Dict, Type
9
9
 
10
- from . import _iris
11
10
  from pydantic import BaseModel, TypeAdapter, ValidationError
12
11
 
13
- from iop._message import _PydanticPickleMessage, _Message
14
- from iop._utils import _Utils
12
+ from . import _iris
13
+ from ._message import _PydanticPickleMessage, _Message
14
+ from ._utils import _Utils
15
15
 
16
16
  class SerializationError(Exception):
17
17
  """Exception raised for serialization errors."""
@@ -107,7 +107,7 @@ class MessageSerializer:
107
107
  raise SerializationError(f"Classname must include a module: {classname}")
108
108
  return classname[:j], classname[j+1:]
109
109
 
110
- def dataclass_from_dict(klass: Type, dikt: Dict) -> Any:
110
+ def dataclass_from_dict(klass: Type | Any, dikt: Dict) -> Any:
111
111
  """Converts a dictionary to a dataclass instance.
112
112
  Handles non attended fields and nested dataclasses."""
113
113
 
@@ -1,16 +1,19 @@
1
1
  import os
2
2
  import sys
3
3
  import ast
4
- from . import _iris
5
4
  import inspect
6
- import xmltodict
7
5
  import importlib
8
6
  import importlib.util
9
7
  import importlib.resources
10
8
  import json
11
- from iop._message import _Message, _PydanticMessage
9
+ from typing import Any, Dict, Optional, Union
10
+
11
+ import xmltodict
12
12
  from pydantic import TypeAdapter
13
13
 
14
+ from . import _iris
15
+ from ._message import _Message, _PydanticMessage
16
+
14
17
  class _Utils():
15
18
  @staticmethod
16
19
  def raise_on_error(sc):
@@ -23,13 +26,12 @@ class _Utils():
23
26
  raise RuntimeError(_iris.get_iris().system.Status.GetOneStatusText(sc))
24
27
 
25
28
  @staticmethod
26
- def setup(path:str = None):
29
+ def setup(path:Optional[str] = None):
27
30
 
28
31
  if path is None:
29
32
  # get the path of the data folder with importlib.resources
30
33
  try:
31
- path = importlib.resources.files('iop').joinpath('cls')
32
- path = str(path)
34
+ path = str(importlib.resources.files('iop').joinpath('cls'))
33
35
  except ModuleNotFoundError:
34
36
  path = None
35
37
 
@@ -38,8 +40,7 @@ class _Utils():
38
40
 
39
41
  # for retrocompatibility load grongier.pex
40
42
  try:
41
- path = importlib.resources.files('grongier').joinpath('cls')
42
- path = str(path)
43
+ path = str(importlib.resources.files('grongier').joinpath('cls'))
43
44
  except ModuleNotFoundError:
44
45
  path = None
45
46
 
@@ -47,20 +48,20 @@ class _Utils():
47
48
  _Utils.raise_on_error(_iris.get_iris().cls('%SYSTEM.OBJ').LoadDir(path,'cubk',"*.cls",1))
48
49
 
49
50
  @staticmethod
50
- def register_message_schema(cls):
51
+ def register_message_schema(msg_cls: type):
51
52
  """
52
53
  It takes a class and registers the schema
53
54
 
54
55
  :param cls: The class to register
55
56
  """
56
- if issubclass(cls,_PydanticMessage):
57
- schema = cls.model_json_schema()
58
- elif issubclass(cls,_Message):
59
- type_adapter = TypeAdapter(cls)
57
+ if issubclass(msg_cls,_PydanticMessage):
58
+ schema = msg_cls.model_json_schema()
59
+ elif issubclass(msg_cls,_Message):
60
+ type_adapter = TypeAdapter(msg_cls)
60
61
  schema = type_adapter.json_schema()
61
62
  else:
62
63
  raise ValueError("The class must be a subclass of _Message or _PydanticMessage")
63
- schema_name = cls.__module__ + '.' + cls.__name__
64
+ schema_name = msg_cls.__module__ + '.' + msg_cls.__name__
64
65
  schema_str = json.dumps(schema)
65
66
  categories = schema_name
66
67
  _Utils.register_schema(schema_name,schema_str,categories)
@@ -170,10 +171,11 @@ class _Utils():
170
171
  for klass in classes:
171
172
  extend = ''
172
173
  if len(klass.bases) == 1:
173
- if hasattr(klass.bases[0],'id'):
174
- extend = klass.bases[0].id
175
- else:
176
- extend = klass.bases[0].attr
174
+ base = klass.bases[0]
175
+ if isinstance(base, ast.Name):
176
+ extend = base.id
177
+ elif isinstance(base, ast.Attribute):
178
+ extend = base.attr
177
179
  if extend in ('BusinessOperation','BusinessProcess','BusinessService','DuplexService','DuplexProcess','DuplexOperation','InboundAdapter','OutboundAdapter'):
178
180
  module = _Utils.filename_to_module(filename)
179
181
  iris_class_name = f"{iris_package_name}.{module}.{klass.name}"
@@ -281,7 +283,7 @@ class _Utils():
281
283
  raise ValueError("The file path must be absolute")
282
284
 
283
285
  spec = importlib.util.spec_from_file_location(module_name, file_path)
284
- if spec is None:
286
+ if spec is None or spec.loader is None:
285
287
  raise ImportError(f"Cannot find module named {module_name} at {file_path}")
286
288
 
287
289
  module = importlib.util.module_from_spec(spec)
@@ -171,6 +171,7 @@ Method OnTearDown() As %Status
171
171
 
172
172
  Method SetPropertyValues()
173
173
  {
174
+ // First process the %settings property
174
175
  set remoteSettings = $tr(..%settings,$c(13))
175
176
  for i=1:1:$l(remoteSettings,$c(10)) {
176
177
  set oneLine = $p(remoteSettings,$c(10),i)
@@ -182,6 +183,7 @@ Method SetPropertyValues()
182
183
  $$$LOGWARNING(ex.DisplayString())
183
184
  }
184
185
  }
186
+
185
187
  // Now process the Python Attributes Settings
186
188
  // First list all the properties of the current class
187
189
  set class = $CLASSNAME()
@@ -300,6 +300,10 @@ ClassMethod GenerateProxyClass(
300
300
  Set tDefault = tPropInfo."__getitem__"(2)
301
301
  If ""'=tDefault {
302
302
  Set tCustomProp.InitialExpression = $$$quote(tDefault)
303
+ if $LENGTH(tDefault)>255 {
304
+ Set tSC = tCustomProp.Parameters.SetAt("","MAXLEN")
305
+ Quit:$$$ISERR(tSC)
306
+ }
303
307
  }
304
308
  Set tCustomProp.Required = tPropInfo."__getitem__"(3)
305
309
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iris_pex_embedded_python
3
- Version: 3.4.4b3
3
+ Version: 3.4.4b5
4
4
  Summary: Iris Interoperability based on Embedded Python
5
5
  Author-email: grongier <guillaume.rongier@intersystems.com>
6
6
  License: MIT License
@@ -1,7 +0,0 @@
1
- import os
2
-
3
- def get_iris(namespace:str=None)->'iris':
4
- if namespace:
5
- os.environ['IRISNAMESPACE'] = namespace
6
- import iris
7
- return iris