iris-pex-embedded-python 3.1.4b2__py3-none-any.whl → 3.1.5__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.

@@ -36,7 +36,7 @@ class _BusinessOperation(_BusinessHost):
36
36
  """ For internal use only. """
37
37
  self.iris_handle = handle_current
38
38
  if type(handle_partner).__module__.find('iris') == 0:
39
- if handle_partner._IsA("Grongier.PEX.OutboundAdapter"):
39
+ if handle_partner._IsA("Grongier.PEX.OutboundAdapter") or handle_partner._IsA("IOP.OutboundAdapter"):
40
40
  module = importlib.import_module(handle_partner.GetModule())
41
41
  handle_partner = getattr(module, handle_partner.GetClassname())()
42
42
  self.Adapter = self.adapter = handle_partner
iop/_business_service.py CHANGED
@@ -30,7 +30,7 @@ class _BusinessService(_BusinessHost):
30
30
  """ For internal use only. """
31
31
  self.iris_handle = handle_current
32
32
  if type(handle_partner).__module__.find('iris') == 0:
33
- if handle_partner._IsA("Grongier.PEX.InboundAdapter"):
33
+ if handle_partner._IsA("Grongier.PEX.InboundAdapter") or handle_partner._IsA("IOP.InboundAdapter"):
34
34
  module = importlib.import_module(handle_partner.GetModule())
35
35
  handle_partner = getattr(module, handle_partner.GetClassname())()
36
36
  self.Adapter = self.adapter = handle_partner
iop/_director.py CHANGED
@@ -15,6 +15,21 @@ class _Director():
15
15
  Instead these business services are created by a custom application by calling the Director.CreateBusinessService() method.
16
16
  """
17
17
 
18
+ _bs = {}
19
+
20
+ def get_business_service(self,target,force_session_id=False):
21
+ """ get the business service
22
+ Parameters:
23
+ target: the name of the business service
24
+ force_session_id: if True, force the session id to be a new one
25
+ """
26
+ if target not in self._bs or self._bs[target] is None:
27
+ self._bs[target] = _Director.create_python_business_service(target)
28
+ if force_session_id:
29
+ self._bs[target].iris_handle._SessionId = ""
30
+ self._bs[target].iris_handle.ForceSessionId()
31
+ return self._bs[target]
32
+
18
33
  @staticmethod
19
34
  def CreateBusinessService(target):
20
35
  """ DEPRECATED : use create_business_service
@@ -40,7 +55,7 @@ class _Director():
40
55
  Returns:
41
56
  an object that contains an instance of IRISBusinessService
42
57
  """
43
- iris_object = iris.cls("Grongier.PEX.Director").dispatchCreateBusinessService(target)
58
+ iris_object = iris.cls("IOP.Director").dispatchCreateBusinessService(target)
44
59
  return iris_object
45
60
 
46
61
  @staticmethod
@@ -54,7 +69,7 @@ class _Director():
54
69
  Returns:
55
70
  an object that contains an instance of IRISBusinessService
56
71
  """
57
- iris_object = iris.cls("Grongier.PEX.Director").dispatchCreateBusinessService(target)
72
+ iris_object = iris.cls("IOP.Director").dispatchCreateBusinessService(target)
58
73
  return iris_object.GetClass()
59
74
 
60
75
  ### List of function to manage the production
@@ -112,12 +127,12 @@ class _Director():
112
127
  ### list production
113
128
  @staticmethod
114
129
  def list_productions():
115
- return iris.cls('Grongier.PEX.Director').dispatchListProductions()
130
+ return iris.cls('IOP.Director').dispatchListProductions()
116
131
 
117
132
  ### status production
118
133
  @staticmethod
119
134
  def status_production():
120
- dikt = iris.cls('Grongier.PEX.Director').StatusProduction()
135
+ dikt = iris.cls('IOP.Director').StatusProduction()
121
136
  if dikt['Production'] is None or dikt['Production'] == '':
122
137
  dikt['Production'] = _Director.get_default_production()
123
138
  return dikt
@@ -31,7 +31,8 @@ class _PrivateSessionDuplex(_BusinessHost):
31
31
  """ For internal use only. """
32
32
  self.iris_handle = handle_current
33
33
  if type(handle_partner).__module__.find('iris') == 0:
34
- if handle_partner._IsA("Grongier.PEX.InboundAdapter") or handle_partner._IsA("Grongier.PEX.OutboundAdapter"):
34
+ if (handle_partner._IsA("Grongier.PEX.InboundAdapter") or handle_partner._IsA("Grongier.PEX.OutboundAdapter")
35
+ or handle_partner._IsA("IOP.InboundAdapter") or handle_partner._IsA("IOP.OutboundAdapter")):
35
36
  module = importlib.import_module(handle_partner.GetModule())
36
37
  handle_partner = getattr(module, handle_partner.GetClassname())()
37
38
  self.Adapter = self.adapter = handle_partner
iop/cls/IOP/Common.cls CHANGED
@@ -118,7 +118,13 @@ Method Connect() As %Status
118
118
  Method OnTearDown() As %Status
119
119
  {
120
120
  set tSC = $$$OK
121
- do ..%class."_dispatch_on_tear_down"()
121
+ if $isObject(..%class) {
122
+ try {
123
+ do ..%class."_dispatch_on_tear_down"()
124
+ } catch ex {
125
+ set tSC = ex.AsStatus()
126
+ }
127
+ }
122
128
  quit tSC
123
129
  }
124
130
 
iop/cls/IOP/Director.cls CHANGED
@@ -9,10 +9,13 @@ Class IOP.Director [ Inheritance = right, ProcedureBlock, System = 4 ]
9
9
 
10
10
  ClassMethod dispatchCreateBusinessService(pTargetDispatchName As %String) As Ens.BusinessService
11
11
  {
12
+ set tSC = ##class(Ens.Director).CreateBusinessService(pTargetDispatchName,.service)
13
+
12
14
  // Hack to prevent job to be registered in the production
13
15
  do ##class(Ens.Job).UnRegister(pTargetDispatchName,$JOB)
14
- set tSC = ##class(Ens.Director).CreateBusinessService(pTargetDispatchName,.service)
16
+
15
17
  if $$$ISERR(tSC) throw ##class(%Exception.StatusException).CreateFromStatus(tSC)
18
+
16
19
  quit service
17
20
  }
18
21
 
iop/cls/IOP/Message.cls CHANGED
@@ -1,7 +1,3 @@
1
- /* Copyright (c) 2021 by InterSystems Corporation.
2
- Cambridge, Massachusetts, U.S.A. All rights reserved.
3
- Confidential property of InterSystems Corporation. */
4
-
5
1
  Class IOP.Message Extends (Ens.MessageBody, %CSP.Page, %XML.Adaptor)
6
2
  {
7
3
 
@@ -79,11 +75,16 @@ Method jsonSet(pInput) As %Status
79
75
  , "Stream":..jsonStream
80
76
  , :$$$NULLOREF)
81
77
  Quit:tOldStream=pInput $$$OK
82
- Do:..type'="" Clear() Set i%type=""
78
+
79
+ If ..type'="" {
80
+ Set:(..type="String") i%jsonString=""
81
+ Set:(..type="Stream") i%jsonStream=$$$NULLOREF
82
+ Set i%type = ""
83
+ }
83
84
 
84
85
  If $ISOBJECT(pInput) {
85
86
  if pInput.%Extends("%Stream.GlobalCharacter") {
86
- Set ..jsonStream=pInput, i%type="Stream"
87
+ Set r%jsonStream=pInput, i%type="Stream"
87
88
  }
88
89
  else {
89
90
  Throw ##class(%Exception.General).%New("Invalid input type, must be a %Stream.GlobalCharacter or a %String")
@@ -94,18 +95,15 @@ Method jsonSet(pInput) As %Status
94
95
  // write in a stream
95
96
  Set stream = ##class(%Stream.GlobalCharacter).%New()
96
97
  for i=1:..#BUFFER:$LENGTH(pInput) {
97
- Set sc = stream.Write($EXTRACT(pInput,i,(i+..#BUFFER)))
98
+ Set sc = stream.Write($EXTRACT(pInput,i,(i+..#BUFFER-1)))
98
99
  Quit:$$$ISERR(sc)
99
100
  }
100
- Set ..jsonStream=stream, i%type="Stream"
101
+ Set r%jsonStream=stream, i%type="Stream"
102
+ }
103
+ else {
104
+ Set i%jsonString=pInput, i%type="String"
101
105
  }
102
- Set i%jsonString=pInput, i%type="String"
103
106
  }
104
- Quit $$$OK
105
- Clear()
106
- If ..type="String" { Set r%jsonString="" }
107
- ElseIf ..type="Stream" { Set r%jsonStream=$$$NULLOREF }
108
- Quit
109
107
  }
110
108
 
111
109
  Method GetObjectJson(ByRef atEnd)
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.1
2
+ Name: iris_pex_embedded_python
3
+ Version: 3.1.5
4
+ Summary: Iris Interoperability based on Embedded Python
5
+ Author-email: grongier <guillaume.rongier@intersystems.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2019 InterSystems Developer Community
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: homepage, https://github.com/grongierisc/interoperability-embedded-python
29
+ Project-URL: documentation, https://github.com/grongierisc/interoperability-embedded-python/blob/master/README.md
30
+ Project-URL: repository, https://github.com/grongierisc/interoperability-embedded-python
31
+ Project-URL: issues, https://github.com/grongierisc/interoperability-embedded-python/issues
32
+ Keywords: iris,intersystems,python,embedded
33
+ Classifier: Development Status :: 5 - Production/Stable
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3.6
38
+ Classifier: Programming Language :: Python :: 3.7
39
+ Classifier: Programming Language :: Python :: 3.8
40
+ Classifier: Programming Language :: Python :: 3.9
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Topic :: Utilities
45
+ Description-Content-Type: text/markdown
46
+ License-File: LICENSE
47
+ Requires-Dist: dacite>=1.6.0
48
+ Requires-Dist: xmltodict>=0.12.0
49
+ Requires-Dist: iris-embedded-python-wrapper>=0.0.6
50
+ Requires-Dist: setuptools>=40.8.0
51
+
52
+ # IoP (Interoperability On Python)
53
+
54
+ [![PyPI - Status](https://img.shields.io/pypi/status/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
55
+ [![PyPI](https://img.shields.io/pypi/v/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
56
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
57
+ [![PyPI - License](https://img.shields.io/pypi/l/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
58
+ ![GitHub last commit](https://img.shields.io/github/last-commit/grongierisc/interoperability-embedded-python)
59
+
60
+ Welcome to the **Interoperability On Python (IoP)** proof of concept! This project demonstrates how the **IRIS Interoperability Framework** can be utilized with a **Python-first approach**.
61
+
62
+ Documentation can be found [here](https://grongierisc.github.io/interoperability-embedded-python/).
63
+
64
+ ## Example
65
+
66
+ Here's a simple example of how a Business Operation can be implemented in Python:
67
+
68
+ ```python
69
+ from iop import BusinessOperation
70
+
71
+ class MyBo(BusinessOperation):
72
+ def on_message(self, request):
73
+ self.log_info("Hello World")
74
+ ```
75
+
76
+ ## Installation
77
+
78
+ To start using this proof of concept, install it using pip:
79
+
80
+ ```bash
81
+ pip install iris-pex-embedded-python
82
+ ```
83
+
84
+ ## Getting Started
85
+
86
+ If you're new to this project, begin by reading the [installation guide](https://grongierisc.github.io/interoperability-embedded-python/getting-started/installation.md). Then, follow the [first steps](https://grongierisc.github.io/interoperability-embedded-python/getting-started/first-steps.md) to create your first Business Operation.
87
+
88
+ Happy coding!
@@ -93,26 +93,26 @@ intersystems_iris/pex/__init__.py,sha256=l_I1dpnluWawbFrGMDC0GLHpuHwjbpd-nho8otF
93
93
  iop/__init__.py,sha256=zHFF0Znipx1fwHYUEBZjNOYoZH1ro7z4IgYDU32kdn0,1067
94
94
  iop/__main__.py,sha256=pQzVtkDhAeI6dpNRC632dVk2SGZZIEDwDufdgZe8VWs,98
95
95
  iop/_business_host.py,sha256=_U7f2Fy-7_qzBz4OQTAieVvEhBaT1Z0E77QoYPU0i-U,28244
96
- iop/_business_operation.py,sha256=P824IzO89LCKnoNHZk64OZBDHcomHpjhKmMT89bS6TI,3500
96
+ iop/_business_operation.py,sha256=BX4CT6OW_i2jLZRTWQIDJsQSRxFWpKUf0pAXruy3Wsg,3546
97
97
  iop/_business_process.py,sha256=F4NIQcwQ5u8yiAPpaN14OAXxbKJsRAGm5S4lrbgA3oI,13296
98
- iop/_business_service.py,sha256=sX8J-2-0Go6uIuPYa0A5N9Nn9rY5lV6a05v4q78qDC8,3726
98
+ iop/_business_service.py,sha256=8dYTr4z3RE0WupT7_DeDvYjyhVqZtdDj0jA52ZSKCQ0,3771
99
99
  iop/_cli.py,sha256=yg4wv1FkhgjmoZuTMUr61Ff21PegJDH_cpZeHcF8hQE,6207
100
100
  iop/_common.py,sha256=uKJdfCSPOjVQOg8GVuUj4ywfAn_2sPB3C82HbWw_5bI,15384
101
- iop/_director.py,sha256=TFkhci40zgq271zB9SYGK24TZtOcYZCTNzWFkA4I2IM,11016
101
+ iop/_director.py,sha256=DqBG3zXN9QE1kcroLPnEZK4Q0YZn8l622OIrIzcqZCE,11585
102
102
  iop/_inbound_adapter.py,sha256=PS5ToqhrYcXq9ZdLbCBqAfVp8kCeRACm_KF66pwBO9U,1652
103
103
  iop/_message.py,sha256=BmwBXriykU66bwAgRbdkMpjfJRVWoNRX2eDc9TXfXzA,325
104
104
  iop/_outbound_adapter.py,sha256=YTAhLrRf9chEAd53mV6KKbpaHOKNOKJHoGgj5wakRR0,726
105
105
  iop/_pickle_message.py,sha256=noKfc2VkXufV3fqjKvNHN_oANQ1YN9ffCaSV0XSTAIE,331
106
- iop/_private_session_duplex.py,sha256=klzWKwRRBoKUSz85D3DNYuCpDcZe_kWLNCWq5JtR0yc,5044
106
+ iop/_private_session_duplex.py,sha256=36OwAGlasbPtfwq2KgMFcr3a33RsNSqohJx243XcDWI,5153
107
107
  iop/_private_session_process.py,sha256=pGjWFOQhWpQxUVpTtvNKTPvDxgzjfw0VC4Aqj3KUq8w,1704
108
108
  iop/_utils.py,sha256=b1vFnAXbcNV4uN9zojIeSeLgr0CuSt9bBgguZra0ve8,18105
109
109
  iop/cls/IOP/BusinessOperation.cls,sha256=lrymqZ8wHl5kJjXwdjbQVs5sScV__yIWGh-oGbiB_X0,914
110
110
  iop/cls/IOP/BusinessProcess.cls,sha256=s3t38w1ykHqM26ETcbCYLt0ocjZyVVahm-_USZkuJ1E,2855
111
111
  iop/cls/IOP/BusinessService.cls,sha256=7ebn32J9PiZXUgXuh5Xxm_7X6zHBiqkJr9c_dWxbPO8,1021
112
- iop/cls/IOP/Common.cls,sha256=vYTnsL-ch-vTjpigBtwOHgrnOQMmuTkqXT9F-vWE650,11068
113
- iop/cls/IOP/Director.cls,sha256=Wd5iwiRd9XSt7G18Ga3XAIPSuIrPYVumbCEjYrkZHBs,2002
112
+ iop/cls/IOP/Common.cls,sha256=4f4ZpLj8fsj8IKJDNb9pKoCokzo522JHWX0OqpAaC5g,11192
113
+ iop/cls/IOP/Director.cls,sha256=M43LoTb6lwSr0J81RFxi1YLW1mwda09wQ7Xqr3nBtxo,2008
114
114
  iop/cls/IOP/InboundAdapter.cls,sha256=GeoCm6q5HcLJ5e4VxgqXiErJXqolBbpKwpunaNzpvjU,610
115
- iop/cls/IOP/Message.cls,sha256=n0r0FslXdDfPcHIiAlW7n596DDsDSNlTX8UTPaMnSV8,9911
115
+ iop/cls/IOP/Message.cls,sha256=_-RZ4AxyZ97M8Guvm5eFg_-rH1VbNtnFE3x_G4eMZFg,9719
116
116
  iop/cls/IOP/OutboundAdapter.cls,sha256=9eOwy5ojwcTzwrHs6LNrFQvUD8aqcoNCZrILN1ycdDM,958
117
117
  iop/cls/IOP/PickleMessage.cls,sha256=S3y7AClQ8mAILjxPuHdCjGosBZYzGbUQ5WTv4mYPNMQ,1673
118
118
  iop/cls/IOP/Test.cls,sha256=gAC9PEfMZsvAEWIa241-ug2FWAhITbN1SOispZzJPnI,2094
@@ -129,9 +129,9 @@ iop/cls/IOP/Service/WSGI.cls,sha256=VLNCXEwmHW9dBnE51uGE1nvGX6T4HjhqePT3LVhsjAE,
129
129
  iop/wsgi/handlers.py,sha256=NrFLo_YbAh-x_PlWhAiWkQnUUN2Ss9HoEm63dDWCBpQ,2947
130
130
  irisnative/_IRISNative.py,sha256=HQ4nBhc8t8_5OtxdMG-kx1aa-T1znf2I8obZOPLOPzg,665
131
131
  irisnative/__init__.py,sha256=6YmvBLQSURsCPKaNg7LK-xpo4ipDjrlhKuwdfdNb3Kg,341
132
- iris_pex_embedded_python-3.1.4b2.dist-info/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
133
- iris_pex_embedded_python-3.1.4b2.dist-info/METADATA,sha256=_Tv7yyTkeKhi0VlDcr3LUxR-SghQKkuNnMETAvahYMo,50122
134
- iris_pex_embedded_python-3.1.4b2.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
135
- iris_pex_embedded_python-3.1.4b2.dist-info/entry_points.txt,sha256=pj-i4LSDyiSP6xpHlVjMCbg1Pik7dC3_sdGY3Yp9Vhk,38
136
- iris_pex_embedded_python-3.1.4b2.dist-info/top_level.txt,sha256=VWDlX4YF4qFVRGrG3-Gs0kgREol02i8gIpsHNbhfFPw,42
137
- iris_pex_embedded_python-3.1.4b2.dist-info/RECORD,,
132
+ iris_pex_embedded_python-3.1.5.dist-info/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
133
+ iris_pex_embedded_python-3.1.5.dist-info/METADATA,sha256=7_BYWV-e1Mk1oH2fs43GsXyCaa8OYxBsLHFTPNJDqnc,4365
134
+ iris_pex_embedded_python-3.1.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
135
+ iris_pex_embedded_python-3.1.5.dist-info/entry_points.txt,sha256=pj-i4LSDyiSP6xpHlVjMCbg1Pik7dC3_sdGY3Yp9Vhk,38
136
+ iris_pex_embedded_python-3.1.5.dist-info/top_level.txt,sha256=VWDlX4YF4qFVRGrG3-Gs0kgREol02i8gIpsHNbhfFPw,42
137
+ iris_pex_embedded_python-3.1.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5