iris-pex-embedded-python 3.4.0b14__py3-none-any.whl → 3.4.1b2__py3-none-any.whl
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.
- iop/_async_request.py +3 -1
- iop/_business_host.py +2 -1
- iop/_cli.py +9 -1
- iop/_common.py +2 -1
- iop/_director.py +40 -40
- iop/_iris.py +7 -0
- iop/_log_manager.py +8 -8
- iop/_serialization.py +9 -9
- iop/_utils.py +10 -10
- {iris_pex_embedded_python-3.4.0b14.dist-info → iris_pex_embedded_python-3.4.1b2.dist-info}/METADATA +1 -1
- iris_pex_embedded_python-3.4.1b2.dist-info/RECORD +79 -0
- {iris_pex_embedded_python-3.4.0b14.dist-info → iris_pex_embedded_python-3.4.1b2.dist-info}/WHEEL +1 -1
- iris_pex_embedded_python-3.4.1b2.dist-info/top_level.txt +2 -0
- intersystems_iris/_BufferReader.py +0 -10
- intersystems_iris/_BufferWriter.py +0 -32
- intersystems_iris/_ConnectionInformation.py +0 -56
- intersystems_iris/_ConnectionParameters.py +0 -18
- intersystems_iris/_Constant.py +0 -38
- intersystems_iris/_DBList.py +0 -506
- intersystems_iris/_Device.py +0 -69
- intersystems_iris/_GatewayContext.py +0 -25
- intersystems_iris/_GatewayException.py +0 -4
- intersystems_iris/_GatewayUtility.py +0 -74
- intersystems_iris/_IRIS.py +0 -1294
- intersystems_iris/_IRISConnection.py +0 -516
- intersystems_iris/_IRISEmbedded.py +0 -85
- intersystems_iris/_IRISGlobalNode.py +0 -273
- intersystems_iris/_IRISGlobalNodeView.py +0 -25
- intersystems_iris/_IRISIterator.py +0 -143
- intersystems_iris/_IRISList.py +0 -360
- intersystems_iris/_IRISNative.py +0 -208
- intersystems_iris/_IRISOREF.py +0 -9
- intersystems_iris/_IRISObject.py +0 -424
- intersystems_iris/_IRISReference.py +0 -133
- intersystems_iris/_InStream.py +0 -149
- intersystems_iris/_LegacyIterator.py +0 -135
- intersystems_iris/_ListItem.py +0 -15
- intersystems_iris/_ListReader.py +0 -84
- intersystems_iris/_ListWriter.py +0 -161
- intersystems_iris/_LogFileStream.py +0 -115
- intersystems_iris/_MessageHeader.py +0 -51
- intersystems_iris/_OutStream.py +0 -25
- intersystems_iris/_PrintStream.py +0 -65
- intersystems_iris/_PythonGateway.py +0 -850
- intersystems_iris/_SharedMemorySocket.py +0 -87
- intersystems_iris/__init__.py +0 -79
- intersystems_iris/__main__.py +0 -7
- intersystems_iris/dbapi/_Column.py +0 -56
- intersystems_iris/dbapi/_DBAPI.py +0 -2631
- intersystems_iris/dbapi/_Descriptor.py +0 -46
- intersystems_iris/dbapi/_IRISStream.py +0 -65
- intersystems_iris/dbapi/_Message.py +0 -158
- intersystems_iris/dbapi/_Parameter.py +0 -171
- intersystems_iris/dbapi/_ParameterCollection.py +0 -141
- intersystems_iris/dbapi/_ResultSetRow.py +0 -361
- intersystems_iris/dbapi/_SQLType.py +0 -32
- intersystems_iris/dbapi/__init__.py +0 -0
- intersystems_iris/dbapi/preparser/_PreParser.py +0 -1674
- intersystems_iris/dbapi/preparser/_Scanner.py +0 -391
- intersystems_iris/dbapi/preparser/_Token.py +0 -81
- intersystems_iris/dbapi/preparser/_TokenList.py +0 -251
- intersystems_iris/dbapi/preparser/__init__.py +0 -0
- intersystems_iris/pex/_BusinessHost.py +0 -101
- intersystems_iris/pex/_BusinessOperation.py +0 -105
- intersystems_iris/pex/_BusinessProcess.py +0 -214
- intersystems_iris/pex/_BusinessService.py +0 -95
- intersystems_iris/pex/_Common.py +0 -228
- intersystems_iris/pex/_Director.py +0 -24
- intersystems_iris/pex/_IRISBusinessOperation.py +0 -5
- intersystems_iris/pex/_IRISBusinessService.py +0 -18
- intersystems_iris/pex/_IRISInboundAdapter.py +0 -5
- intersystems_iris/pex/_IRISOutboundAdapter.py +0 -17
- intersystems_iris/pex/_InboundAdapter.py +0 -57
- intersystems_iris/pex/_Message.py +0 -6
- intersystems_iris/pex/_OutboundAdapter.py +0 -46
- intersystems_iris/pex/__init__.py +0 -25
- iris_pex_embedded_python-3.4.0b14.dist-info/RECORD +0 -143
- iris_pex_embedded_python-3.4.0b14.dist-info/top_level.txt +0 -4
- irisnative/_IRISNative.py +0 -9
- irisnative/__init__.py +0 -10
- {iris_pex_embedded_python-3.4.0b14.dist-info → iris_pex_embedded_python-3.4.1b2.dist-info}/entry_points.txt +0 -0
- {iris_pex_embedded_python-3.4.0b14.dist-info → iris_pex_embedded_python-3.4.1b2.dist-info}/licenses/LICENSE +0 -0
iop/_async_request.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import
|
|
2
|
+
from . import _iris
|
|
3
3
|
from typing import Any, Optional, Union
|
|
4
4
|
from iop._dispatch import dispatch_deserializer, dispatch_serializer
|
|
5
5
|
from iop._message import _Message as Message
|
|
@@ -24,6 +24,7 @@ class AsyncRequest(asyncio.Future):
|
|
|
24
24
|
|
|
25
25
|
async def send(self) -> None:
|
|
26
26
|
# init parameters
|
|
27
|
+
iris = _iris.get_iris()
|
|
27
28
|
message_header_id = iris.ref()
|
|
28
29
|
queue_name = iris.ref()
|
|
29
30
|
end_time = iris.ref()
|
|
@@ -46,6 +47,7 @@ class AsyncRequest(asyncio.Future):
|
|
|
46
47
|
self.set_result(self._response)
|
|
47
48
|
|
|
48
49
|
def is_done(self) -> None:
|
|
50
|
+
iris = _iris.get_iris()
|
|
49
51
|
response = iris.ref()
|
|
50
52
|
status = self._iris_handle.dispatchIsRequestDone(self.timeout, self._end_time,
|
|
51
53
|
self._queue_name, self._message_header_id,
|
iop/_business_host.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from inspect import getsource
|
|
2
2
|
from typing import Any,List, Optional, Tuple, Union
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
from . import _iris
|
|
5
5
|
|
|
6
6
|
from iop._common import _Common
|
|
7
7
|
from iop._message import _Message as Message
|
|
@@ -109,6 +109,7 @@ class _BusinessHost(_Common):
|
|
|
109
109
|
|
|
110
110
|
def _create_call_structure(self, target: str, request: Union[Message, Any]) -> Any:
|
|
111
111
|
"""Create an Ens.CallStructure object for the request."""
|
|
112
|
+
iris = _iris.get_iris()
|
|
112
113
|
call = iris.cls("Ens.CallStructure")._New()
|
|
113
114
|
call.TargetDispatchName = target
|
|
114
115
|
call.Request = dispatch_serializer(request)
|
iop/_cli.py
CHANGED
|
@@ -7,10 +7,10 @@ from enum import Enum, auto
|
|
|
7
7
|
import sys
|
|
8
8
|
from typing import Optional, Callable
|
|
9
9
|
from importlib.metadata import version
|
|
10
|
-
|
|
11
10
|
from iop._director import _Director
|
|
12
11
|
from iop._utils import _Utils
|
|
13
12
|
|
|
13
|
+
|
|
14
14
|
class CommandType(Enum):
|
|
15
15
|
DEFAULT = auto()
|
|
16
16
|
LIST = auto()
|
|
@@ -46,11 +46,16 @@ class CommandArgs:
|
|
|
46
46
|
test: Optional[str] = None
|
|
47
47
|
classname: Optional[str] = None
|
|
48
48
|
body: Optional[str] = None
|
|
49
|
+
namespace: Optional[str] = None
|
|
49
50
|
|
|
50
51
|
class Command:
|
|
51
52
|
def __init__(self, args: CommandArgs):
|
|
52
53
|
self.args = args
|
|
53
54
|
|
|
55
|
+
if self.args.namespace and self.args.namespace != 'not_set':
|
|
56
|
+
# set environment variable IRISNAMESPACE
|
|
57
|
+
os.environ['IRISNAMESPACE'] = self.args.namespace
|
|
58
|
+
|
|
54
59
|
def execute(self) -> None:
|
|
55
60
|
command_type = self._determine_command_type()
|
|
56
61
|
command_handlers = {
|
|
@@ -182,6 +187,9 @@ def create_parser() -> argparse.ArgumentParser:
|
|
|
182
187
|
test = main_parser.add_argument_group('test arguments')
|
|
183
188
|
test.add_argument('-C', '--classname', help='test classname', nargs='?', const='not_set')
|
|
184
189
|
test.add_argument('-B', '--body', help='test body', nargs='?', const='not_set')
|
|
190
|
+
|
|
191
|
+
namespace = main_parser.add_argument_group('namespace arguments')
|
|
192
|
+
namespace.add_argument('-n', '--namespace', help='set namespace', nargs='?', const='not_set')
|
|
185
193
|
|
|
186
194
|
return main_parser
|
|
187
195
|
|
iop/_common.py
CHANGED
|
@@ -3,7 +3,7 @@ import inspect
|
|
|
3
3
|
import traceback
|
|
4
4
|
from typing import Any, ClassVar, List, Optional, Tuple
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
from . import _iris
|
|
7
7
|
|
|
8
8
|
from iop._log_manager import LogManager, logging
|
|
9
9
|
|
|
@@ -285,6 +285,7 @@ class _Common(metaclass=abc.ABCMeta):
|
|
|
285
285
|
Parameters:
|
|
286
286
|
message: a string that is written to the log.
|
|
287
287
|
"""
|
|
288
|
+
iris = _iris.get_iris()
|
|
288
289
|
current_class, current_method = self._log()
|
|
289
290
|
iris.cls("Ens.Util.Log").LogAssert(current_class, current_method, message)
|
|
290
291
|
|
iop/_director.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import datetime
|
|
3
3
|
import functools
|
|
4
|
-
import
|
|
5
|
-
import intersystems_iris.dbapi._DBAPI as irisdbapi
|
|
4
|
+
from . import _iris
|
|
6
5
|
import signal
|
|
7
6
|
from dataclasses import dataclass
|
|
8
7
|
|
|
@@ -55,7 +54,7 @@ class _Director():
|
|
|
55
54
|
Returns:
|
|
56
55
|
an object that contains an instance of IRISBusinessService
|
|
57
56
|
"""
|
|
58
|
-
iris_object =
|
|
57
|
+
iris_object = _iris.get_iris().cls("IOP.Director").dispatchCreateBusinessService(target)
|
|
59
58
|
return iris_object
|
|
60
59
|
|
|
61
60
|
@staticmethod
|
|
@@ -69,7 +68,7 @@ class _Director():
|
|
|
69
68
|
Returns:
|
|
70
69
|
an object that contains an instance of IRISBusinessService
|
|
71
70
|
"""
|
|
72
|
-
iris_object =
|
|
71
|
+
iris_object = _iris.get_iris().cls("IOP.Director").dispatchCreateBusinessService(target)
|
|
73
72
|
return iris_object.GetClass()
|
|
74
73
|
|
|
75
74
|
### List of function to manage the production
|
|
@@ -102,37 +101,37 @@ class _Director():
|
|
|
102
101
|
def start_production(production_name=None):
|
|
103
102
|
if production_name is None or production_name == '':
|
|
104
103
|
production_name = _Director.get_default_production()
|
|
105
|
-
|
|
104
|
+
_iris.get_iris().cls('Ens.Director').StartProduction(production_name)
|
|
106
105
|
|
|
107
106
|
### stop production
|
|
108
107
|
@staticmethod
|
|
109
108
|
def stop_production():
|
|
110
|
-
|
|
109
|
+
_iris.get_iris().cls('Ens.Director').StopProduction()
|
|
111
110
|
|
|
112
111
|
### restart production
|
|
113
112
|
@staticmethod
|
|
114
113
|
def restart_production():
|
|
115
|
-
|
|
114
|
+
_iris.get_iris().cls('Ens.Director').RestartProduction()
|
|
116
115
|
|
|
117
116
|
### shutdown production
|
|
118
117
|
@staticmethod
|
|
119
118
|
def shutdown_production():
|
|
120
|
-
|
|
119
|
+
_iris.get_iris().cls('Ens.Director').StopProduction(10,1)
|
|
121
120
|
|
|
122
121
|
### update production
|
|
123
122
|
@staticmethod
|
|
124
123
|
def update_production():
|
|
125
|
-
|
|
124
|
+
_iris.get_iris().cls('Ens.Director').UpdateProduction()
|
|
126
125
|
|
|
127
126
|
### list production
|
|
128
127
|
@staticmethod
|
|
129
128
|
def list_productions():
|
|
130
|
-
return
|
|
129
|
+
return _iris.get_iris().cls('IOP.Director').dispatchListProductions()
|
|
131
130
|
|
|
132
131
|
### status production
|
|
133
132
|
@staticmethod
|
|
134
133
|
def status_production():
|
|
135
|
-
dikt =
|
|
134
|
+
dikt = _iris.get_iris().cls('IOP.Director').StatusProduction()
|
|
136
135
|
if dikt['Production'] is None or dikt['Production'] == '':
|
|
137
136
|
dikt['Production'] = _Director.get_default_production()
|
|
138
137
|
return dikt
|
|
@@ -141,13 +140,13 @@ class _Director():
|
|
|
141
140
|
@staticmethod
|
|
142
141
|
def set_default_production(production_name=''):
|
|
143
142
|
#set ^Ens.Configuration("SuperUser","LastProduction")
|
|
144
|
-
glb =
|
|
143
|
+
glb = _iris.get_iris().gref("^Ens.Configuration")
|
|
145
144
|
glb['csp', "LastProduction"] = production_name
|
|
146
145
|
|
|
147
146
|
### get default production
|
|
148
147
|
@staticmethod
|
|
149
148
|
def get_default_production():
|
|
150
|
-
glb =
|
|
149
|
+
glb = _iris.get_iris().gref("^Ens.Configuration")
|
|
151
150
|
default_production_name = glb['csp', "LastProduction"]
|
|
152
151
|
if default_production_name is None or default_production_name == '':
|
|
153
152
|
default_production_name = 'Not defined'
|
|
@@ -178,7 +177,7 @@ class _Director():
|
|
|
178
177
|
return str(row[9]) + ' ' + typ + ' ' + str(row[1]) + ' ' + str(row[2]) + ' ' + str(row[3]) + ' ' + str(row[4]) + ' ' + str(row[5]) + ' ' + str(row[6]) + ' ' + str(row[8])
|
|
179
178
|
|
|
180
179
|
@staticmethod
|
|
181
|
-
def read_top_log(
|
|
180
|
+
def read_top_log(top) -> list:
|
|
182
181
|
sql = """
|
|
183
182
|
SELECT top ?
|
|
184
183
|
ID, ConfigName, Job, MessageId, SessionId, SourceClass, SourceMethod, Stack, Text, TimeLogged, TraceCat, Type
|
|
@@ -186,13 +185,14 @@ class _Director():
|
|
|
186
185
|
order by id desc
|
|
187
186
|
"""
|
|
188
187
|
result = []
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
stmt = _iris.get_iris().sql.prepare(sql)
|
|
189
|
+
rs = stmt.execute(top)
|
|
190
|
+
for row in rs:
|
|
191
191
|
result.append(_Director.format_log(row))
|
|
192
192
|
return result
|
|
193
193
|
|
|
194
194
|
@staticmethod
|
|
195
|
-
def read_log(
|
|
195
|
+
def read_log() -> list:
|
|
196
196
|
sql = """
|
|
197
197
|
SELECT
|
|
198
198
|
ID, ConfigName, Job, MessageId, SessionId, SourceClass, SourceMethod, Stack, Text, TimeLogged, TraceCat, Type
|
|
@@ -201,8 +201,12 @@ class _Director():
|
|
|
201
201
|
order by id desc
|
|
202
202
|
"""
|
|
203
203
|
result = []
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
stmt = _iris.get_iris().sql.prepare(sql)
|
|
205
|
+
time = datetime.datetime.now() - datetime.timedelta(seconds=1)
|
|
206
|
+
# convert to utc time
|
|
207
|
+
time = time.astimezone(datetime.timezone.utc)
|
|
208
|
+
rs = stmt.execute(time.isoformat(sep=' '))
|
|
209
|
+
for row in rs:
|
|
206
210
|
result.append(_Director.format_log(row))
|
|
207
211
|
return result
|
|
208
212
|
|
|
@@ -211,14 +215,12 @@ class _Director():
|
|
|
211
215
|
""" Log production
|
|
212
216
|
if ctrl+c is pressed, the log is stopped
|
|
213
217
|
"""
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
break
|
|
221
|
-
await asyncio.sleep(1)
|
|
218
|
+
while True:
|
|
219
|
+
for row in reversed(_Director.read_log()):
|
|
220
|
+
print(row)
|
|
221
|
+
if handler.sigint_log:
|
|
222
|
+
break
|
|
223
|
+
await asyncio.sleep(1)
|
|
222
224
|
|
|
223
225
|
@staticmethod
|
|
224
226
|
def log_production_top(top=10):
|
|
@@ -227,10 +229,8 @@ class _Director():
|
|
|
227
229
|
Parameters:
|
|
228
230
|
top: the number of log to display
|
|
229
231
|
"""
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
for row in reversed(_Director.read_top_log(cursor, top)):
|
|
233
|
-
print(row)
|
|
232
|
+
for row in reversed(_Director.read_top_log(top)):
|
|
233
|
+
print(row)
|
|
234
234
|
|
|
235
235
|
@staticmethod
|
|
236
236
|
def log_production():
|
|
@@ -240,10 +240,10 @@ class _Director():
|
|
|
240
240
|
loop = asyncio.get_event_loop()
|
|
241
241
|
handler = SigintHandler(log_only=True)
|
|
242
242
|
loop.add_signal_handler(signal.SIGINT, functools.partial(handler.signal_handler, signal.SIGINT, loop))
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
|
|
244
|
+
for row in reversed(_Director.read_top_log( 10)):
|
|
245
|
+
print(row)
|
|
246
|
+
|
|
247
247
|
loop.run_until_complete(_Director._log_production_async(handler))
|
|
248
248
|
loop.close()
|
|
249
249
|
|
|
@@ -257,20 +257,20 @@ class _Director():
|
|
|
257
257
|
body: the body of the message
|
|
258
258
|
"""
|
|
259
259
|
if not message:
|
|
260
|
-
message =
|
|
260
|
+
message = _iris.get_iris().cls('Ens.Request')._New()
|
|
261
261
|
if classname:
|
|
262
262
|
# if classname start with 'iris.' then create an iris object
|
|
263
263
|
if classname.startswith('iris.'):
|
|
264
264
|
# strip the iris. prefix
|
|
265
265
|
classname = classname[5:]
|
|
266
266
|
if body:
|
|
267
|
-
message =
|
|
267
|
+
message = _iris.get_iris().cls(classname)._New(body)
|
|
268
268
|
else:
|
|
269
|
-
message =
|
|
269
|
+
message = _iris.get_iris().cls(classname)._New()
|
|
270
270
|
# else create a python object
|
|
271
271
|
else:
|
|
272
272
|
# python message are casted to Grongier.PEX.Message
|
|
273
|
-
message =
|
|
273
|
+
message = _iris.get_iris().cls("IOP.Message")._New()
|
|
274
274
|
message.classname = classname
|
|
275
275
|
if body:
|
|
276
276
|
message.json = body
|
|
@@ -278,7 +278,7 @@ class _Director():
|
|
|
278
278
|
message.json = _Utils.string_to_stream("{}")
|
|
279
279
|
# serialize the message
|
|
280
280
|
serial_message = dispatch_serializer(message)
|
|
281
|
-
response =
|
|
281
|
+
response = _iris.get_iris().cls('IOP.Utils').dispatchTestComponent(target,serial_message)
|
|
282
282
|
try:
|
|
283
283
|
deserialized_response = dispatch_deserializer(response)
|
|
284
284
|
except ImportError as e:
|
iop/_iris.py
ADDED
iop/_log_manager.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import traceback
|
|
2
|
-
import
|
|
2
|
+
from . import _iris
|
|
3
3
|
import logging
|
|
4
4
|
from typing import Optional, Tuple
|
|
5
5
|
|
|
@@ -41,11 +41,11 @@ class IRISLogHandler(logging.Handler):
|
|
|
41
41
|
|
|
42
42
|
# Map Python logging levels to IRIS logging methods
|
|
43
43
|
self.level_map = {
|
|
44
|
-
logging.DEBUG:
|
|
45
|
-
logging.INFO:
|
|
46
|
-
logging.WARNING:
|
|
47
|
-
logging.ERROR:
|
|
48
|
-
logging.CRITICAL:
|
|
44
|
+
logging.DEBUG: _iris.get_iris().cls("Ens.Util.Log").LogTrace,
|
|
45
|
+
logging.INFO: _iris.get_iris().cls("Ens.Util.Log").LogInfo,
|
|
46
|
+
logging.WARNING: _iris.get_iris().cls("Ens.Util.Log").LogWarning,
|
|
47
|
+
logging.ERROR: _iris.get_iris().cls("Ens.Util.Log").LogError,
|
|
48
|
+
logging.CRITICAL: _iris.get_iris().cls("Ens.Util.Log").LogAlert,
|
|
49
49
|
}
|
|
50
50
|
# Map Python logging levels to IRIS logging Console level
|
|
51
51
|
self.level_map_console = {
|
|
@@ -76,8 +76,8 @@ class IRISLogHandler(logging.Handler):
|
|
|
76
76
|
class_name = record.class_name if hasattr(record, "class_name") else record.name
|
|
77
77
|
method_name = record.method_name if hasattr(record, "method_name") else record.funcName
|
|
78
78
|
if self.to_console or (hasattr(record, "to_console") and record.to_console):
|
|
79
|
-
|
|
79
|
+
_iris.get_iris().cls("%SYS.System").WriteToConsoleLog(self.format(record),
|
|
80
80
|
0,self.level_map_console.get(record.levelno, 0),class_name+"."+method_name)
|
|
81
81
|
else:
|
|
82
|
-
log_func = self.level_map.get(record.levelno,
|
|
82
|
+
log_func = self.level_map.get(record.levelno, _iris.get_iris().cls("Ens.Util.Log").LogInfo)
|
|
83
83
|
log_func(class_name, method_name, self.format(record))
|
iop/_serialization.py
CHANGED
|
@@ -7,7 +7,7 @@ import json
|
|
|
7
7
|
from dataclasses import asdict, is_dataclass
|
|
8
8
|
from typing import Any, Dict, Type
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
from . import _iris
|
|
11
11
|
from pydantic import BaseModel, TypeAdapter, ValidationError
|
|
12
12
|
|
|
13
13
|
from iop._message import _PydanticPickleMessage
|
|
@@ -37,17 +37,17 @@ class MessageSerializer:
|
|
|
37
37
|
raise SerializationError(f"Object {obj} must be a Pydantic model or dataclass")
|
|
38
38
|
|
|
39
39
|
@staticmethod
|
|
40
|
-
def serialize(message: Any, use_pickle: bool = False) ->
|
|
40
|
+
def serialize(message: Any, use_pickle: bool = False) -> Any:
|
|
41
41
|
"""Serializes a message to IRIS format."""
|
|
42
42
|
if isinstance(message, _PydanticPickleMessage) or use_pickle:
|
|
43
43
|
return MessageSerializer._serialize_pickle(message)
|
|
44
44
|
return MessageSerializer._serialize_json(message)
|
|
45
45
|
|
|
46
46
|
@staticmethod
|
|
47
|
-
def _serialize_json(message: Any) ->
|
|
47
|
+
def _serialize_json(message: Any) -> Any:
|
|
48
48
|
json_string = MessageSerializer._convert_to_json_safe(message)
|
|
49
49
|
|
|
50
|
-
msg =
|
|
50
|
+
msg = _iris.get_iris().cls('IOP.Message')._New()
|
|
51
51
|
msg.classname = f"{message.__class__.__module__}.{message.__class__.__name__}"
|
|
52
52
|
|
|
53
53
|
if hasattr(msg, 'buffer') and len(json_string) > msg.buffer:
|
|
@@ -57,13 +57,13 @@ class MessageSerializer:
|
|
|
57
57
|
return msg
|
|
58
58
|
|
|
59
59
|
@staticmethod
|
|
60
|
-
def deserialize(serial:
|
|
60
|
+
def deserialize(serial: Any, use_pickle: bool = False) -> Any:
|
|
61
61
|
if use_pickle:
|
|
62
62
|
return MessageSerializer._deserialize_pickle(serial)
|
|
63
63
|
return MessageSerializer._deserialize_json(serial)
|
|
64
64
|
|
|
65
65
|
@staticmethod
|
|
66
|
-
def _deserialize_json(serial:
|
|
66
|
+
def _deserialize_json(serial: Any) -> Any:
|
|
67
67
|
if not serial.classname:
|
|
68
68
|
raise SerializationError("JSON message malformed, must include classname")
|
|
69
69
|
|
|
@@ -88,15 +88,15 @@ class MessageSerializer:
|
|
|
88
88
|
raise SerializationError(f"Failed to deserialize JSON: {str(e)}")
|
|
89
89
|
|
|
90
90
|
@staticmethod
|
|
91
|
-
def _serialize_pickle(message: Any) ->
|
|
91
|
+
def _serialize_pickle(message: Any) -> Any:
|
|
92
92
|
pickle_string = codecs.encode(pickle.dumps(message), "base64").decode()
|
|
93
|
-
msg =
|
|
93
|
+
msg = _iris.get_iris().cls('IOP.PickleMessage')._New()
|
|
94
94
|
msg.classname = f"{message.__class__.__module__}.{message.__class__.__name__}"
|
|
95
95
|
msg.jstr = _Utils.string_to_stream(pickle_string)
|
|
96
96
|
return msg
|
|
97
97
|
|
|
98
98
|
@staticmethod
|
|
99
|
-
def _deserialize_pickle(serial:
|
|
99
|
+
def _deserialize_pickle(serial: Any) -> Any:
|
|
100
100
|
string = _Utils.stream_to_string(serial.jstr)
|
|
101
101
|
return pickle.loads(codecs.decode(string.encode(), "base64"))
|
|
102
102
|
|
iop/_utils.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
3
|
import ast
|
|
4
|
-
import
|
|
4
|
+
from . import _iris
|
|
5
5
|
import inspect
|
|
6
6
|
import xmltodict
|
|
7
7
|
import pkg_resources
|
|
@@ -19,8 +19,8 @@ class _Utils():
|
|
|
19
19
|
|
|
20
20
|
:param sc: The status code returned by the Iris API
|
|
21
21
|
"""
|
|
22
|
-
if
|
|
23
|
-
raise RuntimeError(
|
|
22
|
+
if _iris.get_iris().system.Status.IsError(sc):
|
|
23
|
+
raise RuntimeError(_iris.get_iris().system.Status.GetOneStatusText(sc))
|
|
24
24
|
|
|
25
25
|
@staticmethod
|
|
26
26
|
def setup(path:str = None):
|
|
@@ -29,13 +29,13 @@ class _Utils():
|
|
|
29
29
|
# get the path of the data folder with pkg_resources
|
|
30
30
|
path = pkg_resources.resource_filename('iop', 'cls')
|
|
31
31
|
|
|
32
|
-
_Utils.raise_on_error(
|
|
32
|
+
_Utils.raise_on_error(_iris.get_iris().cls('%SYSTEM.OBJ').LoadDir(path,'cubk',"*.cls",1))
|
|
33
33
|
|
|
34
34
|
# for retrocompatibility load grongier.pex
|
|
35
35
|
path = pkg_resources.resource_filename('grongier', 'cls')
|
|
36
36
|
|
|
37
37
|
if path:
|
|
38
|
-
_Utils.raise_on_error(
|
|
38
|
+
_Utils.raise_on_error(_iris.get_iris().cls('%SYSTEM.OBJ').LoadDir(path,'cubk',"*.cls",1))
|
|
39
39
|
|
|
40
40
|
@staticmethod
|
|
41
41
|
def register_message_schema(cls):
|
|
@@ -68,7 +68,7 @@ class _Utils():
|
|
|
68
68
|
:param categories: The categories of the schema
|
|
69
69
|
:type categories: str
|
|
70
70
|
"""
|
|
71
|
-
_Utils.raise_on_error(
|
|
71
|
+
_Utils.raise_on_error(_iris.get_iris().cls('IOP.Message.JSONSchema').Import(schema_str,categories,schema_name))
|
|
72
72
|
|
|
73
73
|
@staticmethod
|
|
74
74
|
def register_component(module:str,classname:str,path:str,overwrite:int=1,iris_classname:str='Python'):
|
|
@@ -90,7 +90,7 @@ class _Utils():
|
|
|
90
90
|
path = os.path.abspath(os.path.normpath(path))
|
|
91
91
|
fullpath = _Utils.guess_path(module,path)
|
|
92
92
|
try:
|
|
93
|
-
|
|
93
|
+
_iris.get_iris().cls('IOP.Utils').dispatchRegisterComponent(module,classname,path,fullpath,overwrite,iris_classname)
|
|
94
94
|
except RuntimeError as e:
|
|
95
95
|
# New message error : Make sure the iop package is installed in iris
|
|
96
96
|
raise RuntimeError("Iris class : IOP.Utils not found. Make sure the iop package is installed in iris eg: iop --init.") from e
|
|
@@ -403,7 +403,7 @@ class _Utils():
|
|
|
403
403
|
production_name = production_name.split('.')[-1]
|
|
404
404
|
stream = _Utils.string_to_stream(xml)
|
|
405
405
|
# register the production
|
|
406
|
-
_Utils.raise_on_error(
|
|
406
|
+
_Utils.raise_on_error(_iris.get_iris().cls('IOP.Utils').CreateProduction(package,production_name,stream))
|
|
407
407
|
|
|
408
408
|
@staticmethod
|
|
409
409
|
def export_production(production_name):
|
|
@@ -418,7 +418,7 @@ class _Utils():
|
|
|
418
418
|
return key, ''
|
|
419
419
|
return key, value
|
|
420
420
|
# export the production
|
|
421
|
-
xdata =
|
|
421
|
+
xdata = _iris.get_iris().cls('IOP.Utils').ExportProduction(production_name)
|
|
422
422
|
# for each chunk of 1024 characters
|
|
423
423
|
string = _Utils.stream_to_string(xdata)
|
|
424
424
|
# convert the xml to a dictionary
|
|
@@ -436,7 +436,7 @@ class _Utils():
|
|
|
436
436
|
|
|
437
437
|
@staticmethod
|
|
438
438
|
def string_to_stream(string:str,buffer=1000000):
|
|
439
|
-
stream =
|
|
439
|
+
stream = _iris.get_iris().cls('%Stream.GlobalCharacter')._New()
|
|
440
440
|
n = buffer
|
|
441
441
|
chunks = [string[i:i+n] for i in range(0, len(string), n)]
|
|
442
442
|
for chunk in chunks:
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
grongier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
grongier/cls/Grongier/PEX/BusinessOperation.cls,sha256=FgLLHTU8yHKxZIoz__5rtHW89b-o_Tjjf5i09WIqcJs,291
|
|
3
|
+
grongier/cls/Grongier/PEX/BusinessProcess.cls,sha256=0S7RU0GYafviILGCwkOKk7mQtP1Bvmd01b1dqfLMjDk,341
|
|
4
|
+
grongier/cls/Grongier/PEX/BusinessService.cls,sha256=KEidVN2tnaJ-6QKmPj8--BqlxMOayPM7Z8A42caC5s8,287
|
|
5
|
+
grongier/cls/Grongier/PEX/Common.cls,sha256=_7K83DN_Krj5pSgPpfWmINSA0yAhZkhXLBDmKDgLeBs,292
|
|
6
|
+
grongier/cls/Grongier/PEX/Director.cls,sha256=CMmLEQRbK37zenYZOMkmRa9P6B9xLUdWgm7YLk1yKGg,306
|
|
7
|
+
grongier/cls/Grongier/PEX/InboundAdapter.cls,sha256=4S3gjicQ-yfClO4RgKgu7iJQgQaxfH_a-1NmAeZ6Uv0,285
|
|
8
|
+
grongier/cls/Grongier/PEX/Message.cls,sha256=KzWxhWjDKQMjc6fnUZSrxJ9y6u5i1jAsyj0zbeTCmto,273
|
|
9
|
+
grongier/cls/Grongier/PEX/OutboundAdapter.cls,sha256=6bRIZ2gzufF5uGzf3z0MY460Yl6gKP31yJm8kzttm8g,287
|
|
10
|
+
grongier/cls/Grongier/PEX/PickleMessage.cls,sha256=r4BTEML91d1YmvkL8L209ilSyCPunYE-zJbQIJK_kBw,285
|
|
11
|
+
grongier/cls/Grongier/PEX/Test.cls,sha256=lvCM0hUZEQuawyteeRjucJvDhkRUc2NfGC6n6vV4nrQ,116
|
|
12
|
+
grongier/cls/Grongier/PEX/Utils.cls,sha256=hJtkE_YMz0z7ufocwz98vl1ODHT-NU-Qpl5hyYVu8jo,233
|
|
13
|
+
grongier/cls/Grongier/PEX/Duplex/Operation.cls,sha256=0X9jHVkGqoh-aLTHmXdb9DuWFY6YxEBQ7dNYLCO7cdw,68
|
|
14
|
+
grongier/cls/Grongier/PEX/Duplex/Process.cls,sha256=AQiL_x5tG99tvauMwiPHsU3G6irb1HGSyBnqREXF4AQ,342
|
|
15
|
+
grongier/cls/Grongier/PEX/Duplex/Service.cls,sha256=OEYgYbxNtff_ACW2XGee9NtUht3u6nuC822cx7ng2cA,71
|
|
16
|
+
grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls,sha256=7RUXLw53Tjv_IL8KpWKm4iFlAeSqAELrawJ42iu-AH4,270
|
|
17
|
+
grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls,sha256=aKi3EhyQipGKMap19xW27CHEHRKCo9yf8Qk2LsEOwx4,429
|
|
18
|
+
grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls,sha256=pcUgHgxX1pMH-wQpE_ow8JGBCgiKmsSmsgNwYgP5eD8,431
|
|
19
|
+
grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls,sha256=T3jNoR8RjKr1InQ6SgqBYTgFwpSB0Q60WholjbvForg,433
|
|
20
|
+
grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls,sha256=zy30ZXXN4XcovPij-kOF3PuH1SkP1EUvlEJQRx2S9RU,431
|
|
21
|
+
grongier/cls/Grongier/Service/WSGI.cls,sha256=7u2SsFmnsubMfdazvaDchKCM3yesPRMfKBzMIkwQ9xc,77
|
|
22
|
+
grongier/pex/__init__.py,sha256=CPLDFa4dusvGX9VZYTUk-M0Xa_yR4e4Gqku1rIT75qo,1060
|
|
23
|
+
grongier/pex/__main__.py,sha256=pQzVtkDhAeI6dpNRC632dVk2SGZZIEDwDufdgZe8VWs,98
|
|
24
|
+
grongier/pex/_business_host.py,sha256=dlV8CWJad8Pr2TNfD9OjcVKaq5gEYQACZla1FK6-bDM,44
|
|
25
|
+
grongier/pex/_cli.py,sha256=hOHz3n-aHtULuhdCkqZ_SSb3sv7M6j2WhRxgCTvgR9I,64
|
|
26
|
+
grongier/pex/_common.py,sha256=HZwG2C2-yB8yNN8kXhI6vxg8h-rROuEx38YOVFWIk1s,31
|
|
27
|
+
grongier/pex/_director.py,sha256=pCmoiJ-sxe24yQaDz6ZFBsAnqU6fh57_dlew98B7rtE,35
|
|
28
|
+
grongier/pex/_utils.py,sha256=gvsdr8WhWrE6smlsCxhoF14VUZfitrwqr5J57HkJhi4,29
|
|
29
|
+
grongier/pex/wsgi/handlers.py,sha256=NrFLo_YbAh-x_PlWhAiWkQnUUN2Ss9HoEm63dDWCBpQ,2947
|
|
30
|
+
iop/__init__.py,sha256=1C589HojSVK0yJf1KuTPA39ZjrOYO0QFLv45rqbZpA4,1183
|
|
31
|
+
iop/__main__.py,sha256=pQzVtkDhAeI6dpNRC632dVk2SGZZIEDwDufdgZe8VWs,98
|
|
32
|
+
iop/_async_request.py,sha256=ae950UFSlOHjmXGifbjHV4SFiJAMefrTVLs6lGEkgXE,2242
|
|
33
|
+
iop/_business_host.py,sha256=x9wMNfs_IXBczEeGHsrnAo8mgFrlAhwtrWkSC-W9vqA,9699
|
|
34
|
+
iop/_business_operation.py,sha256=ml4BIn1BfrGx8AUGISFR71DZIUCP8vZ2yn9SQjaSzTM,3038
|
|
35
|
+
iop/_business_process.py,sha256=hj6nDIP5Mz5UYbm0vDjvs9lPSEYVQxGJl6tQRcDGTBk,8548
|
|
36
|
+
iop/_business_service.py,sha256=lPTp3_tcLTOWvHlE_YwrcImLGf1PJBUgIOrV-8ctFLw,3851
|
|
37
|
+
iop/_cli.py,sha256=fhaUpq3rTb4P2QPuuqoeatsphMLBPj9xtbvFPJv-2Mo,7941
|
|
38
|
+
iop/_common.py,sha256=NaNEeAt_A1JRLDRvMDAHPWoNgwIt3xyg5X4aL0KSXMM,13485
|
|
39
|
+
iop/_decorators.py,sha256=ZpgEETLdKWv58AoSMfXnm3_mA-6qPphIegjG-npDgwg,2324
|
|
40
|
+
iop/_director.py,sha256=d1XXJn8T8VF9rmT-joJdz_ElS2UR6myRaXaMFC_2brA,11498
|
|
41
|
+
iop/_dispatch.py,sha256=I3TAhvTuk8j4VcROI9vAitJ0a7Nk1BYAWKRrLeNsjr0,3203
|
|
42
|
+
iop/_inbound_adapter.py,sha256=PS5ToqhrYcXq9ZdLbCBqAfVp8kCeRACm_KF66pwBO9U,1652
|
|
43
|
+
iop/_iris.py,sha256=9LsPHk8g9_oBqMM8SzX2HPCeHZtxdnIJqG4TVzUeKBw,150
|
|
44
|
+
iop/_log_manager.py,sha256=ZBsMdY7OWn6BadvQ3UfoEKmDYQ9TxmcrXF3sNbqquAI,3332
|
|
45
|
+
iop/_message.py,sha256=pJQOjRIdw4wSDoJamvItGODMe-UjDU71XihgWdtCAqc,1120
|
|
46
|
+
iop/_message_validator.py,sha256=K6FxLe72gBHQXZTLVrFw87rABGM0F6CTaNtZ2MqJoss,1408
|
|
47
|
+
iop/_outbound_adapter.py,sha256=YTAhLrRf9chEAd53mV6KKbpaHOKNOKJHoGgj5wakRR0,726
|
|
48
|
+
iop/_private_session_duplex.py,sha256=mzlFABh-ly51X1uSWw9YwQbktfMvuNdp2ALlRvlDow4,5152
|
|
49
|
+
iop/_private_session_process.py,sha256=todprfYFSDr-h-BMvWL_IGC6wbQqkMy3mPHWEWCUSE0,1686
|
|
50
|
+
iop/_serialization.py,sha256=iMC51QMIcWwj1ntDbTgZbLZIFFQuBcC4wH9kfQNivic,6164
|
|
51
|
+
iop/_utils.py,sha256=zguWjvZQkzAScHXl4OomZr2ZtPljDqVAs1CFllQZn5g,20092
|
|
52
|
+
iop/cls/IOP/BusinessOperation.cls,sha256=lrymqZ8wHl5kJjXwdjbQVs5sScV__yIWGh-oGbiB_X0,914
|
|
53
|
+
iop/cls/IOP/BusinessProcess.cls,sha256=s3t38w1ykHqM26ETcbCYLt0ocjZyVVahm-_USZkuJ1E,2855
|
|
54
|
+
iop/cls/IOP/BusinessService.cls,sha256=7ebn32J9PiZXUgXuh5Xxm_7X6zHBiqkJr9c_dWxbPO8,1021
|
|
55
|
+
iop/cls/IOP/Common.cls,sha256=vrS9yo4aUgMiLwfhBFJvj7hG6zYQfcSIiu5o1hdppuU,11355
|
|
56
|
+
iop/cls/IOP/Director.cls,sha256=M43LoTb6lwSr0J81RFxi1YLW1mwda09wQ7Xqr3nBtxo,2008
|
|
57
|
+
iop/cls/IOP/InboundAdapter.cls,sha256=GeoCm6q5HcLJ5e4VxgqXiErJXqolBbpKwpunaNzpvjU,610
|
|
58
|
+
iop/cls/IOP/Message.cls,sha256=ZrYQHosgfTG9wv7i-WQ8j71YXZMmL4_mN16xtIDwcRg,25180
|
|
59
|
+
iop/cls/IOP/OutboundAdapter.cls,sha256=9eOwy5ojwcTzwrHs6LNrFQvUD8aqcoNCZrILN1ycdDM,958
|
|
60
|
+
iop/cls/IOP/PickleMessage.cls,sha256=S3y7AClQ8mAILjxPuHdCjGosBZYzGbUQ5WTv4mYPNMQ,1673
|
|
61
|
+
iop/cls/IOP/Test.cls,sha256=gAC9PEfMZsvAEWIa241-ug2FWAhITbN1SOispZzJPnI,2094
|
|
62
|
+
iop/cls/IOP/Utils.cls,sha256=gQBp0lC4F7FWkv1JEDe45qsaLcVlg995t2th46nDGx8,15745
|
|
63
|
+
iop/cls/IOP/Duplex/Operation.cls,sha256=K_fmgeLjPZQbHgNrc0kd6DUQoW0fDn1VHQjJxHo95Zk,525
|
|
64
|
+
iop/cls/IOP/Duplex/Process.cls,sha256=xbefZ4z84a_IUhavWN6P_gZBzqkdJ5XRTXxro6iDvAg,6986
|
|
65
|
+
iop/cls/IOP/Duplex/Service.cls,sha256=sTMOQUCMBgVitmQkM8bbsrmrRtCdj91VlctJ3I7b8WU,161
|
|
66
|
+
iop/cls/IOP/Message/JSONSchema.cls,sha256=SL26n8Z0D81SAGL2NthI10NFdT4Oe1x_GQiaTYPwkoo,3252
|
|
67
|
+
iop/cls/IOP/PrivateSession/Duplex.cls,sha256=8a_dO7E2RTzuxzoufryjlS41l-99NmTtOcmFXOnSwA8,7957
|
|
68
|
+
iop/cls/IOP/PrivateSession/Message/Ack.cls,sha256=y6-5uSVod36bxeQuT2ytPN4TUAfM1mvGGJuTbWbpNv4,941
|
|
69
|
+
iop/cls/IOP/PrivateSession/Message/Poll.cls,sha256=z3ALYmGYQasTcyYNyBeoHzJdNXI4nBO_N8Cqo9l4sQY,942
|
|
70
|
+
iop/cls/IOP/PrivateSession/Message/Start.cls,sha256=uk-WTe66GicCshgmVy3F5ugHiAyPs1m2ueS_3g0YubQ,949
|
|
71
|
+
iop/cls/IOP/PrivateSession/Message/Stop.cls,sha256=7g3gKFUjNg0WXBLuWnj-VnCs5G6hSE09YTzGEp0zbGc,1390
|
|
72
|
+
iop/cls/IOP/Service/WSGI.cls,sha256=VLNCXEwmHW9dBnE51uGE1nvGX6T4HjhqePT3LVhsjAE,10440
|
|
73
|
+
iop/wsgi/handlers.py,sha256=NrFLo_YbAh-x_PlWhAiWkQnUUN2Ss9HoEm63dDWCBpQ,2947
|
|
74
|
+
iris_pex_embedded_python-3.4.1b2.dist-info/licenses/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
|
|
75
|
+
iris_pex_embedded_python-3.4.1b2.dist-info/METADATA,sha256=WPpfFKQEbT_GmKc-JepDz_MoGgg3Fl7KAC4ftAGgQ00,4419
|
|
76
|
+
iris_pex_embedded_python-3.4.1b2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
77
|
+
iris_pex_embedded_python-3.4.1b2.dist-info/entry_points.txt,sha256=pj-i4LSDyiSP6xpHlVjMCbg1Pik7dC3_sdGY3Yp9Vhk,38
|
|
78
|
+
iris_pex_embedded_python-3.4.1b2.dist-info/top_level.txt,sha256=4p0q6hCATmYIVMVi3I8hOUcJE1kwzyBeHygWv_rGvrU,13
|
|
79
|
+
iris_pex_embedded_python-3.4.1b2.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import intersystems_iris._ListReader
|
|
2
|
-
|
|
3
|
-
class _BufferReader(intersystems_iris._ListReader._ListReader):
|
|
4
|
-
|
|
5
|
-
def __init__(self, header, buffer, locale):
|
|
6
|
-
self.header = header
|
|
7
|
-
super().__init__(buffer, locale)
|
|
8
|
-
|
|
9
|
-
def _get_header_count(self):
|
|
10
|
-
return self.header._get_count()
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import intersystems_iris._ListWriter
|
|
2
|
-
import intersystems_iris._MessageHeader
|
|
3
|
-
|
|
4
|
-
class _BufferWriter(intersystems_iris._ListWriter._ListWriter):
|
|
5
|
-
|
|
6
|
-
def __init__(self, locale, is_unicode, compact_double):
|
|
7
|
-
super().__init__(locale, is_unicode, compact_double)
|
|
8
|
-
self.offset = intersystems_iris._MessageHeader._MessageHeader.HEADER_SIZE
|
|
9
|
-
|
|
10
|
-
def _write_header(self, function_code):
|
|
11
|
-
self.buffer[12] = function_code[0]
|
|
12
|
-
self.buffer[13] = function_code[1]
|
|
13
|
-
self.offset = intersystems_iris._MessageHeader._MessageHeader.HEADER_SIZE
|
|
14
|
-
|
|
15
|
-
def _write_header_sysio(self, sysio_code):
|
|
16
|
-
code_int = sysio_code + 49728
|
|
17
|
-
code_bytes = code_int.to_bytes(2, 'little')
|
|
18
|
-
self.buffer[12] = code_bytes[0]
|
|
19
|
-
self.buffer[13] = code_bytes[1]
|
|
20
|
-
self.offset = intersystems_iris._MessageHeader._MessageHeader.HEADER_SIZE
|
|
21
|
-
|
|
22
|
-
def _set_connection_info(self, connection_info):
|
|
23
|
-
self._locale = connection_info._locale
|
|
24
|
-
self._is_unicode = connection_info._is_unicode
|
|
25
|
-
self._compact_double = connection_info._compact_double
|
|
26
|
-
|
|
27
|
-
def _get_header_buffer(self):
|
|
28
|
-
return self.buffer[0:intersystems_iris._MessageHeader._MessageHeader.HEADER_SIZE]
|
|
29
|
-
|
|
30
|
-
def _get_data_buffer(self):
|
|
31
|
-
return self.buffer[intersystems_iris._MessageHeader._MessageHeader.HEADER_SIZE:self.offset]
|
|
32
|
-
|