iris-pex-embedded-python 2.3.16__py3-none-any.whl → 2.3.18__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.

Files changed (120) hide show
  1. grongier/iris/Grongier/PEX/BusinessOperation.cls +33 -0
  2. grongier/iris/Grongier/PEX/BusinessProcess.cls +100 -0
  3. grongier/iris/Grongier/PEX/BusinessService.cls +33 -0
  4. grongier/iris/Grongier/PEX/Common.cls +133 -0
  5. grongier/iris/Grongier/PEX/Director.cls +15 -0
  6. grongier/iris/Grongier/PEX/Duplex/Operation.cls +27 -0
  7. grongier/iris/Grongier/PEX/Duplex/Process.cls +211 -0
  8. grongier/iris/Grongier/PEX/Duplex/Service.cls +9 -0
  9. grongier/iris/Grongier/PEX/InboundAdapter.cls +22 -0
  10. grongier/iris/Grongier/PEX/Message.cls +126 -0
  11. grongier/iris/Grongier/PEX/OutboundAdapter.cls +34 -0
  12. grongier/iris/Grongier/PEX/PickleMessage.cls +58 -0
  13. grongier/iris/Grongier/PEX/PrivateSession/Duplex.cls +247 -0
  14. grongier/iris/Grongier/PEX/PrivateSession/Message/Ack.cls +32 -0
  15. grongier/iris/Grongier/PEX/PrivateSession/Message/Poll.cls +32 -0
  16. grongier/iris/Grongier/PEX/PrivateSession/Message/Start.cls +32 -0
  17. grongier/iris/Grongier/PEX/PrivateSession/Message/Stop.cls +48 -0
  18. grongier/iris/Grongier/PEX/Python.cls +27 -0
  19. grongier/iris/Grongier/PEX/Test.cls +62 -0
  20. grongier/iris/Grongier/PEX/Utils.cls +312 -0
  21. grongier/iris/__init__.py +0 -0
  22. grongier/pex/_business_host.py +9 -1
  23. grongier/pex/_cli.py +8 -2
  24. grongier/pex/data/PEX/BusinessOperation.cls +35 -0
  25. grongier/pex/data/PEX/BusinessProcess.cls +113 -0
  26. grongier/pex/data/PEX/BusinessService.cls +35 -0
  27. grongier/pex/data/PEX/Common.cls +146 -0
  28. grongier/pex/data/PEX/Director.cls +57 -0
  29. grongier/pex/data/PEX/Duplex/Operation.cls +29 -0
  30. grongier/pex/data/PEX/Duplex/Process.cls +229 -0
  31. grongier/pex/data/PEX/Duplex/Service.cls +9 -0
  32. grongier/pex/data/PEX/InboundAdapter.cls +22 -0
  33. grongier/pex/data/PEX/Message.cls +128 -0
  34. grongier/pex/data/PEX/OutboundAdapter.cls +36 -0
  35. grongier/pex/data/PEX/PickleMessage.cls +58 -0
  36. grongier/pex/data/PEX/PrivateSession/Duplex.cls +260 -0
  37. grongier/pex/data/PEX/PrivateSession/Message/Ack.cls +32 -0
  38. grongier/pex/data/PEX/PrivateSession/Message/Poll.cls +32 -0
  39. grongier/pex/data/PEX/PrivateSession/Message/Start.cls +32 -0
  40. grongier/pex/data/PEX/PrivateSession/Message/Stop.cls +48 -0
  41. grongier/pex/data/PEX/Test.cls +62 -0
  42. grongier/pex/data/PEX/Utils.cls +413 -0
  43. intersystems_iris/_BufferReader.py +10 -0
  44. intersystems_iris/_BufferWriter.py +32 -0
  45. intersystems_iris/_ConnectionInformation.py +54 -0
  46. intersystems_iris/_ConnectionParameters.py +18 -0
  47. intersystems_iris/_Constant.py +38 -0
  48. intersystems_iris/_DBList.py +500 -0
  49. intersystems_iris/_Device.py +69 -0
  50. intersystems_iris/_GatewayContext.py +25 -0
  51. intersystems_iris/_GatewayException.py +4 -0
  52. intersystems_iris/_GatewayUtility.py +74 -0
  53. intersystems_iris/_IRIS.py +1294 -0
  54. intersystems_iris/_IRISConnection.py +516 -0
  55. intersystems_iris/_IRISEmbedded.py +85 -0
  56. intersystems_iris/_IRISGlobalNode.py +273 -0
  57. intersystems_iris/_IRISGlobalNodeView.py +25 -0
  58. intersystems_iris/_IRISIterator.py +143 -0
  59. intersystems_iris/_IRISList.py +360 -0
  60. intersystems_iris/_IRISNative.py +208 -0
  61. intersystems_iris/_IRISOREF.py +4 -0
  62. intersystems_iris/_IRISObject.py +424 -0
  63. intersystems_iris/_IRISReference.py +133 -0
  64. intersystems_iris/_InStream.py +149 -0
  65. intersystems_iris/_LegacyIterator.py +135 -0
  66. intersystems_iris/_ListItem.py +15 -0
  67. intersystems_iris/_ListReader.py +84 -0
  68. intersystems_iris/_ListWriter.py +157 -0
  69. intersystems_iris/_LogFileStream.py +115 -0
  70. intersystems_iris/_MessageHeader.py +51 -0
  71. intersystems_iris/_OutStream.py +25 -0
  72. intersystems_iris/_PrintStream.py +65 -0
  73. intersystems_iris/_PythonGateway.py +850 -0
  74. intersystems_iris/_SharedMemorySocket.py +87 -0
  75. intersystems_iris/__init__.py +79 -0
  76. intersystems_iris/__main__.py +7 -0
  77. intersystems_iris/dbapi/_Column.py +56 -0
  78. intersystems_iris/dbapi/_DBAPI.py +2587 -0
  79. intersystems_iris/dbapi/_Descriptor.py +46 -0
  80. intersystems_iris/dbapi/_IRISStream.py +65 -0
  81. intersystems_iris/dbapi/_Message.py +158 -0
  82. intersystems_iris/dbapi/_Parameter.py +169 -0
  83. intersystems_iris/dbapi/_ParameterCollection.py +141 -0
  84. intersystems_iris/dbapi/_ResultSetRow.py +338 -0
  85. intersystems_iris/dbapi/_SQLType.py +32 -0
  86. intersystems_iris/dbapi/__init__.py +0 -0
  87. intersystems_iris/dbapi/preparser/_PreParser.py +1671 -0
  88. intersystems_iris/dbapi/preparser/_Scanner.py +391 -0
  89. intersystems_iris/dbapi/preparser/_Token.py +81 -0
  90. intersystems_iris/dbapi/preparser/_TokenList.py +251 -0
  91. intersystems_iris/dbapi/preparser/__init__.py +0 -0
  92. intersystems_iris/pex/_BusinessHost.py +101 -0
  93. intersystems_iris/pex/_BusinessOperation.py +105 -0
  94. intersystems_iris/pex/_BusinessProcess.py +214 -0
  95. intersystems_iris/pex/_BusinessService.py +95 -0
  96. intersystems_iris/pex/_Common.py +228 -0
  97. intersystems_iris/pex/_Director.py +24 -0
  98. intersystems_iris/pex/_IRISBusinessOperation.py +5 -0
  99. intersystems_iris/pex/_IRISBusinessService.py +18 -0
  100. intersystems_iris/pex/_IRISInboundAdapter.py +5 -0
  101. intersystems_iris/pex/_IRISOutboundAdapter.py +17 -0
  102. intersystems_iris/pex/_InboundAdapter.py +57 -0
  103. intersystems_iris/pex/_Message.py +6 -0
  104. intersystems_iris/pex/_OutboundAdapter.py +46 -0
  105. intersystems_iris/pex/__init__.py +25 -0
  106. iris/__init__.py +33 -0
  107. iris/iris_ipm.py +40 -0
  108. iris/iris_site.py +13 -0
  109. iris/irisbuiltins.py +97 -0
  110. iris/irisloader.py +199 -0
  111. {iris_pex_embedded_python-2.3.16.dist-info → iris_pex_embedded_python-2.3.18.dist-info}/METADATA +3 -4
  112. iris_pex_embedded_python-2.3.18.dist-info/RECORD +153 -0
  113. {iris_pex_embedded_python-2.3.16.dist-info → iris_pex_embedded_python-2.3.18.dist-info}/WHEEL +1 -1
  114. iris_pex_embedded_python-2.3.18.dist-info/top_level.txt +4 -0
  115. irisnative/_IRISNative.py +9 -0
  116. irisnative/__init__.py +10 -0
  117. iris_pex_embedded_python-2.3.16.dist-info/RECORD +0 -43
  118. iris_pex_embedded_python-2.3.16.dist-info/top_level.txt +0 -1
  119. {iris_pex_embedded_python-2.3.16.dist-info → iris_pex_embedded_python-2.3.18.dist-info}/LICENSE +0 -0
  120. {iris_pex_embedded_python-2.3.16.dist-info → iris_pex_embedded_python-2.3.18.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,413 @@
1
+ /* Copyright (c) 2021 by InterSystems Corporation.
2
+ Cambridge, Massachusetts, U.S.A. All rights reserved.
3
+ Confidential property of InterSystems Corporation. */
4
+
5
+ Include Ensemble
6
+
7
+ Class Grongier.PEX.Utils Extends %RegisteredObject
8
+ {
9
+
10
+ ClassMethod dispatchRegisterComponent(
11
+ pModule As %String,
12
+ pRemoteClassname As %String,
13
+ pCLASSPATHS As %String = "",
14
+ pOverwrite As %Boolean = 0,
15
+ pProxyClassname As %String = "") As %Status
16
+ {
17
+ set tSc = $$$OK
18
+ $$$ThrowOnError(##class(Grongier.PEX.Utils).RegisterComponent(pModule, pRemoteClassname, pCLASSPATHS, pOverwrite , pProxyClassname))
19
+ return tSc
20
+ }
21
+
22
+ /// "bo","Duplex","/irisdev/app/src/python/demo/duplex/",1,"Duplex.Duplex"
23
+ ClassMethod RegisterComponent(
24
+ pModule As %String,
25
+ pRemoteClassname As %String,
26
+ pCLASSPATHS As %String = "",
27
+ pOverwrite As %Boolean = 0,
28
+ pProxyClassname As %String = "") As %Status
29
+ {
30
+ #dim tSC As %Status = $$$OK
31
+ #dim ex As %Exception.AbstractException
32
+ #dim tLanguage,tExtraClasspaths,tDelimiter,tOnePath As %String = ""
33
+ #dim tClassDetails,tRemoteSettings As %String = ""
34
+ #dim tClasspaths As %ListOfDataTypes
35
+
36
+ Quit:(""=pRemoteClassname) $$$ERROR($$$EnsErrGeneral,"Remote Classname must be specified in order to register a Production EXtensions component")
37
+ Quit:(""=pModule) $$$ERROR($$$EnsErrGeneral,"Must specify the module of the remote code.")
38
+
39
+ Try {
40
+
41
+ $$$ThrowOnError(..GetRemoteClassInfo(pRemoteClassname,pModule,pCLASSPATHS,.tClassDetails,.tRemoteSettings))
42
+
43
+ Set tConnectionSettings("Classpaths") = pCLASSPATHS
44
+ Set tConnectionSettings("Module") = pModule
45
+ Set tConnectionSettings("Classname") = pRemoteClassname
46
+ Set:(""=pProxyClassname) pProxyClassname = "User."_pRemoteClassname
47
+
48
+ $$$ThrowOnError(..GenerateProxyClass(pProxyClassname,.tConnectionSettings,tClassDetails,tRemoteSettings,pOverwrite))
49
+
50
+ } Catch ex {
51
+ set msg = $System.Status.GetOneStatusText(ex.AsStatus(),1)
52
+ set tSC = $$$ERROR($$$EnsErrGeneral,msg)
53
+ }
54
+
55
+ Quit tSC
56
+ }
57
+
58
+ ClassMethod DeleteComponentProxy(pClassname As %String = "") As %Status
59
+ {
60
+ #dim tSC As %Status = $$$OK
61
+ #dim ex As %Exception.AbstractException
62
+ #dim tIsPEX As %Boolean = 0
63
+ #dim tClass As %Dictionary.CompiledClass
64
+
65
+ Quit:(""=pClassname) $$$ERROR($$$EnsErrGeneral,"Remote class name must be specified.")
66
+
67
+ Try {
68
+
69
+ If '##class(%Dictionary.ClassDefinition).%ExistsId(pClassname) {
70
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("No proxy class defined for remote class '%1'.",pClassname))
71
+ Quit
72
+ }
73
+ If $classmethod(pClassname,"%Extends","Grongier.PEX.Common") {
74
+ Set tClass = ##class(%Dictionary.CompiledClass).%OpenId(pClassname,,.tSC)
75
+ Quit:$$$ISERR(tSC)
76
+ If '$IsObject(tClass) {
77
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Proxy class for remote class '%1' could not be opened.",pClassname))
78
+ Quit
79
+ }
80
+ Set tIsPEX = ("Grongier.PEX.Utils" = tClass.GeneratedBy)
81
+ }
82
+ If tIsPEX {
83
+ Set tSC = ##class(%Dictionary.ClassDefinition).%DeleteId(pClassname)
84
+ If $$$ISERR(tSC) {
85
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Unable to delete proxy class for remote class '%1' : '%2'.",pClassname,$System.Status.GetErrorText(tSC)))
86
+ Quit
87
+ }
88
+ } Else {
89
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Cannot delete class '%1' because it is not a PEX proxy class.",pClassname))
90
+ Quit
91
+ }
92
+
93
+ } Catch ex {
94
+ Set tSC = ex.AsStatus()
95
+ }
96
+
97
+ Quit tSC
98
+ }
99
+
100
+ // ..GetRemoteClassInfo(pRemoteClassname,pModule,pCLASSPATHS,.tClassDetails,.tRemoteSettings)
101
+
102
+ ClassMethod GetRemoteClassInfo(
103
+ pRemoteClassname As %String,
104
+ pModule As %String,
105
+ pClasspaths As %String,
106
+ ByRef pClassDetails,
107
+ ByRef pRemoteSettings) As %Status [ Internal, Private ]
108
+ {
109
+ #dim tSC As %Status = $$$OK
110
+ #dim ex As %Exception.AbstractException
111
+ #dim tGateway As %External.Gateway
112
+ #dim tGatewayProxy As %Net.Remote.Object
113
+
114
+ Try {
115
+ if pClasspaths '="" {
116
+ set sys = ##class(%SYS.Python).Import("sys")
117
+ set delimiter = $s($system.Version.GetOS()="Windows":";",1:":")
118
+ set extraClasspaths = $tr(pClasspaths,delimiter,"|")
119
+ for i=1:1:$l(extraClasspaths,"|") {
120
+ set onePath = $p(extraClasspaths,"|",i)
121
+ set onePath = ##class(%File).NormalizeDirectory(onePath)
122
+ if onePath?1"$$IRISHOME"1P.E set onePath = $e($system.Util.InstallDirectory(),1,*-1)_$e(onePath,11,*)
123
+ if onePath'="" do sys.path.append(onePath)
124
+ }
125
+ }
126
+ ;
127
+
128
+ set importlib = ##class(%SYS.Python).Import("importlib")
129
+ set builtins = ##class(%SYS.Python).Import("builtins")
130
+ set module = importlib."import_module"(pModule)
131
+ set class = builtins.getattr(module, pRemoteClassname)
132
+ set tClass = class."__new__"(class)
133
+
134
+
135
+ If $IsObject(tClass) {
136
+ #; List of information about the class as a whole - $lb(SuperClass, Description, InfoURL, IconURL, Adapter)
137
+ Set pClassDetails = tClass."_get_info"()
138
+ #; List of information about the various properties of the class
139
+ #; List of lists of form $lb(propName,dataType,defaultVal,required,category,description)
140
+ Set pRemoteSettings = tClass."_get_properties"()
141
+ } Else {
142
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Error opening gateway proxy for class '%1'"),pRemoteClassname)
143
+ }
144
+ } Catch ex {
145
+ set msg = $System.Status.GetOneStatusText(ex.AsStatus(),1)
146
+ set tSC = $$$ERROR($$$EnsErrGeneral,msg)
147
+ }
148
+
149
+ Quit tSC
150
+ }
151
+
152
+ /// Set tConnectionSettings("Classpaths") = pCLASSPATHS
153
+ /// Set tConnectionSettings("Module") = pModule
154
+ /// Set tConnectionSettings("Classname") = pRemoteClassname
155
+ /// Set:(""=pProxyClassname) pProxyClassname = pRemoteClassname
156
+ ///
157
+ /// Set tSC = ..GenerateProxyClass(pProxyClassname,.tConnectionSettings,tClassDetails,tRemoteSettings,pOverwrite)
158
+ /// "bo","Duplex","/irisdev/app/src/python/demo/duplex/",1,"Duplex.Duplex"
159
+ ClassMethod GenerateProxyClass(
160
+ pClassname As %String,
161
+ ByRef pConnectionSettings,
162
+ pClassDetails As %String = "",
163
+ pRemoteSettings As %String = "",
164
+ pOverwrite As %Boolean = 0) As %Status [ Internal, Private ]
165
+ {
166
+ #dim tSC As %Status = $$$OK
167
+ #dim ex As %Exception.AbstractException
168
+
169
+ Quit:(""=pClassname) $$$ERROR($$$EnsErrGeneral,"Class name must be specified in order to generate a proxy class for this Production EXtensions component")
170
+
171
+ Try {
172
+
173
+ If ##class(%Dictionary.ClassDefinition).%ExistsId(pClassname) {
174
+ If 'pOverwrite {
175
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Proxy class '%1' already exists.",pClassname))
176
+ Quit
177
+ } Else {
178
+ #dim tIsPEX As %Boolean = 0
179
+ If $classmethod(pClassname,"%Extends","Grongier.PEX.Common") {
180
+ #dim tClass As %Dictionary.CompiledClass = ##class(%Dictionary.CompiledClass).%OpenId(pClassname)
181
+ If '$IsObject(tClass) {
182
+ Set tSC = $$$ERROR($$$EnsErrGeneral,"Class not found")
183
+ Quit
184
+ }
185
+ Set tIsPEX = ("Grongier.PEX.Utils" = tClass.GeneratedBy)
186
+ }
187
+ If tIsPEX {
188
+ Set tSC = ##class(%Dictionary.ClassDefinition).%DeleteId(pClassname)
189
+ If $$$ISERR(tSC) {
190
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Unable to delete existing proxy class '%1' : '%2'.",pClassname,$System.Status.GetErrorText(tSC)))
191
+ Quit
192
+ }
193
+ } Else {
194
+ Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Cannot overwrite class '%1' because it is not a PEX proxy class.",pClassname))
195
+ Quit
196
+ }
197
+ }
198
+ }
199
+
200
+ #; create subclass of the ObjectScript Business Host
201
+ #dim tCOSClass As %Dictionary.ClassDefinition
202
+ Set tCOSClass = ##class(%Dictionary.ClassDefinition).%New()
203
+ Set tCOSClass.Name = pClassname
204
+
205
+ #dim tSuperClass As %String = pClassDetails."__getitem__"(0)
206
+ If (""=tSuperClass) {
207
+ Set tSC = $$$ERROR($$$EnsErrGeneral,"No PEX superclass found.")
208
+ Quit
209
+ }
210
+ If '$Case($P(tSuperClass,".",*),"DuplexProcess":1,"DuplexService":1,"DuplexOperation":1,"InboundAdapter":1,"OutboundAdapter":1,"BusinessService":1,"BusinessProcess":1,"BusinessOperation":1,:0) {
211
+ Set tSC = $$$ERROR($$$EnsErrGeneral,"Invalid superclass")
212
+ Quit
213
+ }
214
+ Set tSuperClass = "Grongier.PEX."_$P(tSuperClass,".",*)
215
+
216
+ Set tCOSClass.Super = tSuperClass
217
+ Set tCOSClass.GeneratedBy = $CLASSNAME()
218
+ Set tCOSClass.ClassVersion = $$$CLASSDEFINITIONVERSION
219
+ #dim tDescription As %String = pClassDetails."__getitem__"(1)
220
+ If (""'=tDescription) {
221
+ Set tCOSClass.Description = $Replace(tDescription,$C(10),$C(13,10))
222
+ }
223
+
224
+ #; Do not display any of the connection settings
225
+ #dim tSETTINGSParamValue As %String = "%classname:Python $type,%module:Python $type,%settings:Python $type,%classpaths:Python $type"
226
+
227
+ #; Create the %classname property
228
+ #dim tPropClassname As %Dictionary.PropertyDefinition = ##class(%Dictionary.PropertyDefinition).%New()
229
+ Set tPropClassname.Name = "%classname"
230
+ Set tPropClassname.Type = "%String"
231
+ Set tPropClassname.InitialExpression = $$$quote(pConnectionSettings("Classname"))
232
+ Set tPropClassname.Internal = 1
233
+ Set tSC = tCOSClass.Properties.Insert(tPropClassname)
234
+ Quit:$$$ISERR(tSC)
235
+
236
+ #; Create the %classpaths property
237
+ #dim tPropClasspaths As %Dictionary.PropertyDefinition = ##class(%Dictionary.PropertyDefinition).%New()
238
+ Set tPropClasspaths.Name = "%classpaths"
239
+ Set tPropClasspaths.Type = "%String"
240
+ Set tSC = tPropClasspaths.Parameters.SetAt("","MAXLEN")
241
+ Quit:$$$ISERR(tSC)
242
+ Set tPropClasspaths.InitialExpression = $$$quote(pConnectionSettings("Classpaths"))
243
+ Set tPropClasspaths.Description = "One or more Classpaths (separated by '|' character) needed in addition to the ones configured in the Remote Gateway"
244
+ Set tSC = tCOSClass.Properties.Insert(tPropClasspaths)
245
+ Quit:$$$ISERR(tSC)
246
+
247
+ #; Create the %module property
248
+ #dim tPropLanguage As %Dictionary.PropertyDefinition = ##class(%Dictionary.PropertyDefinition).%New()
249
+ Set tPropLanguage.Name = "%module"
250
+ Set tPropLanguage.Type = "%String"
251
+ Set tPropLanguage.Internal = 1
252
+ Set tPropLanguage.InitialExpression = $$$quote(pConnectionSettings("Module"))
253
+ Set tSC = tCOSClass.Properties.Insert(tPropLanguage)
254
+ Quit:$$$ISERR(tSC)
255
+
256
+ #; Create other properties
257
+ #dim tMethod As %Dictionary.MethodDefinition = ##class(%Dictionary.MethodDefinition).%New()
258
+ Set tMethod.Name = "SetPropertyValues"
259
+
260
+ #dim tCustomProp As %Dictionary.PropertyDefinition
261
+ #dim tPropInfo,tPropName,tDataType,tDefault,tDesc,tPropCat,tContext As %String
262
+ #; each remote setting is of form $lb(propName,dataType,defaultVal,required,category,description,editorContext)
263
+ For i=1:1:$ll(pRemoteSettings) {
264
+ Set tPropInfo = $lg(pRemoteSettings,i)
265
+ Continue:""=tPropInfo ; this shouldn't happen, but just in case
266
+ Set tPropName = $lg(tPropInfo,1)
267
+ Set tDataType = $lg(tPropInfo,2)
268
+ If (""=tPropName) || (""=tDataType) {
269
+ Set tSC = $$$ERROR($$$EnsErrGeneral,"All properties must have a name and datatype defined")
270
+ Quit
271
+ }
272
+ Set tCustomProp = ##class(%Dictionary.PropertyDefinition).%New()
273
+ Set tCustomProp.Name = tPropName
274
+ If $Case(tDataType,"String":1,"Integer":1,"Boolean":1,"Numeric":1,:0) {
275
+ Set tDataType = "%"_tDataType
276
+ } ElseIf '##class(%Dictionary.ClassDefinition).%ExistsId(tDataType) {
277
+ Set tDataType = "%String"
278
+ }
279
+ Set tCustomProp.Type = tDataType
280
+ Set tDefault = $lg(tPropInfo,3)
281
+ If ""'=tDefault {
282
+ Set tCustomProp.InitialExpression = $$$quote(tDefault)
283
+ }
284
+ Set tCustomProp.Required = $lg(tPropInfo,4,0)
285
+ Set tDesc = $lg(tPropInfo,6)
286
+ If ""'=tDesc {
287
+ Set tDesc = $zstrip($Replace(tDesc,$C(10),$C(13,10)),"<>W")
288
+ Set:$E(tDesc,*-1,*)=$C(13,10) tDesc = $E(tDesc,1,*-2)
289
+ Set tCustomProp.Description = tDesc
290
+ }
291
+
292
+ Set tSC = tCOSClass.Properties.Insert(tCustomProp)
293
+ Quit:$$$ISERR(tSC)
294
+
295
+ Set tPropCat = $lg(tPropInfo,5,"Additional")
296
+ Set tSETTINGSParamValue = tSETTINGSParamValue_","_tPropName_":"_tPropCat
297
+
298
+ Set tSC = tMethod.Implementation.WriteLine($char(9)_"try {") Quit:$$$ISERR(tSC)
299
+ Set tSC = tMethod.Implementation.WriteLine($char(9,9)_"set $property(..%gatewayProxy,"_$$$quote(tPropName)_") = .."_tPropName) Quit:$$$ISERR(tSC)
300
+ Set tSC = tMethod.Implementation.WriteLine($char(9)_"} catch ex {") Quit:$$$ISERR(tSC)
301
+ Set tSC = tMethod.Implementation.WriteLine($char(9,9)_"$$$LOGWARNING(ex.DisplayString())") Quit:$$$ISERR(tSC)
302
+ Set tSC = tMethod.Implementation.WriteLine($char(9)_"}") Quit:$$$ISERR(tSC)
303
+ }
304
+
305
+ If $Case(tSuperClass,"Grongier.PEX.BusinessService":1,"Grongier.PEX.BusinessOperation":1,"Grongier.PEX.DuplexService":1,"Grongier.PEX.DuplexOperation":1,:0) {
306
+ set builtins = ##class(%SYS.Python).Import("builtins")
307
+ If (builtins.len(pClassDetails)>4) { //Adaptor
308
+
309
+ #dim tAdapterClass = pClassDetails."__getitem__"(4)
310
+ #; May want to issue a warning in the UI if the Adapter class does not exist
311
+ #; but we don't check here because it does compile and may just be that the user is registering the Service/Operation before the Adapter
312
+ #dim tADAPTERParam As %Dictionary.ParameterDefinition = ##class(%Dictionary.ParameterDefinition).%New()
313
+ Set tADAPTERParam.Name = "ADAPTER"
314
+ Set tADAPTERParam.Default = tAdapterClass
315
+ Set tSC = tCOSClass.Parameters.Insert(tADAPTERParam)
316
+ Quit:$$$ISERR(tSC)
317
+ }
318
+ }
319
+
320
+ set type = ""
321
+ set:($Case(tSuperClass,"Grongier.PEX.InboundAdapter":1,"Grongier.PEX.OutboundAdapter":1,:0)) type = "Adapter"
322
+ set tSETTINGSParamValue = $REPLACE(tSETTINGSParamValue,"$type",type)
323
+
324
+ #dim tSETTINGSParam As %Dictionary.ParameterDefinition = ##class(%Dictionary.ParameterDefinition).%New()
325
+ Set tSETTINGSParam.Name = "SETTINGS"
326
+ Set tSETTINGSParam.Default = tSETTINGSParamValue
327
+ Set tSC = tCOSClass.Parameters.Insert(tSETTINGSParam)
328
+ Quit:$$$ISERR(tSC)
329
+
330
+ Set tSC = tCOSClass.%Save()
331
+ Quit:$$$ISERR(tSC)
332
+
333
+ Set tSC = $System.OBJ.Compile(pClassname,"-d")
334
+
335
+ } Catch ex {
336
+ Set tSC = ex.AsStatus()
337
+ }
338
+
339
+ Quit tSC
340
+ }
341
+
342
+ ClassMethod CreateProduction(
343
+ package As %String = "test",
344
+ name As %String = "AutoCreatedProduction",
345
+ xdata As %CharacterStream) As %Status
346
+ {
347
+ #Dim produtionClassName As %String = package _ "." _ name
348
+ If ('$ZName(produtionClassName, 4))
349
+ {
350
+ Return $System.Status.Error(5001, "Invalid Production package or name.")
351
+ }
352
+ #Dim productionDefinition As %Dictionary.ClassDefinition
353
+ // Check if the production already exists
354
+ If (##class(%Dictionary.ClassDefinition).%ExistsId(produtionClassName))
355
+ {
356
+ // Open the production
357
+ set productionDefinition = ##class(%Dictionary.ClassDefinition).%OpenId(produtionClassName)
358
+ }
359
+ Else
360
+ {
361
+ // Create the production definition
362
+ set productionDefinition = ##Class(%Dictionary.ClassDefinition).%New()
363
+ }
364
+ //
365
+ Set productionDefinition.Name = produtionClassName
366
+ Set productionDefinition.Super = "Ens.Production"
367
+ Set productionDefinition.ClassVersion = 25
368
+ //
369
+ // Check if the XData Definition already exists
370
+ If (##Class(%Dictionary.XDataDefinition).%ExistsId(produtionClassName_"||ProductionDefinition"))
371
+ {
372
+ // delete the XData Definition
373
+ $$$ThrowOnError(##Class(%Dictionary.XDataDefinition).%DeleteId(produtionClassName_"||ProductionDefinition"))
374
+ }
375
+ #Dim xdataDefinition As %Dictionary.XDataDefinition = ##Class(%Dictionary.XDataDefinition).%New()
376
+ //
377
+ Set xdataDefinition.Name = "ProductionDefinition"
378
+ //
379
+ Do xdataDefinition.Data.CopyFrom(xdata)
380
+ //
381
+ // Insert XData Definition into Production Definition
382
+ Do productionDefinition.XDatas.Insert(xdataDefinition)
383
+ //
384
+ #Dim statusCode As %Status = productionDefinition.%Save()
385
+ //
386
+ If ($System.Status.IsError(statusCode))
387
+ {
388
+ Return statusCode
389
+ }
390
+ // Compile the production class
391
+ return $System.OBJ.Compile(produtionClassName,"k-d")
392
+ }
393
+
394
+ /// Export a production to an XML string
395
+ ClassMethod ExportProduction(pProductionName As %String) As %String
396
+ {
397
+ Set sc = $$$OK
398
+ set xdata = ""
399
+ // Check if the XData Definition exists
400
+ If (##Class(%Dictionary.XDataDefinition).%ExistsId(pProductionName_"||ProductionDefinition"))
401
+ {
402
+ // Open the XData Definition
403
+ Set xdataDefinition = ##Class(%Dictionary.XDataDefinition).%OpenId(pProductionName_"||ProductionDefinition")
404
+ Set xdata = xdataDefinition.Data
405
+ }
406
+ Else
407
+ {
408
+ $$$ThrowOnError($System.Status.Error(5001, "Production does not exist."))
409
+ }
410
+ Return xdata
411
+ }
412
+
413
+ }
@@ -0,0 +1,10 @@
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()
@@ -0,0 +1,32 @@
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
+
@@ -0,0 +1,54 @@
1
+ import intersystems_iris._Constant
2
+
3
+ class _ConnectionInformation(object):
4
+
5
+ def __init__(self):
6
+ self.protocol_version = intersystems_iris._Constant._Constant.PROTOCOL_VERSION
7
+ self._is_unicode = True
8
+ self._compact_double = False
9
+ self._locale = "latin-1"
10
+ self._delimited_ids = 0
11
+ self._server_version = ""
12
+ self._server_version_major = 0
13
+ self._server_version_minor = 0
14
+ self._iris_install_dir = ""
15
+ self._server_job_number = -1
16
+
17
+ def _set_server_locale(self, locale):
18
+ self._locale = self._map_server_locale(locale)
19
+
20
+ def _parse_server_version(self, server_version):
21
+ split_1 = server_version.split("|")
22
+ self._server_version = split_1[0]
23
+ if len(split_1)>1: self._iris_install_dir = split_1[1]
24
+ if self._server_version.find("Version") > 0:
25
+ version = server_version[server_version.find("Version")+8:]
26
+ self._server_version_major = version.split(".")[0]
27
+ self._server_version_minor = version.split(".")[1]
28
+ return
29
+
30
+ @staticmethod
31
+ def _map_server_locale(locale):
32
+ # we need to map IRIS locale literals to Python locale literals
33
+ _locales = {
34
+ "LATIN1": "latin_1",
35
+ "LATIN2": "iso8859_2",
36
+ "LATINC": "iso8859_5",
37
+ "LATINA": "iso8859_6",
38
+ "LATING": "iso8859_7",
39
+ "LATINH": "iso8859_8",
40
+ "LATINT": "iso8859_11",
41
+ "LATIN9": "iso8859_15",
42
+ "CP1250": "cp1250",
43
+ "CP1251": "cp1251",
44
+ "CP1252": "cp1252",
45
+ "CP1253": "cp1253",
46
+ "CP1255": "cp1255",
47
+ "CP1256": "cp1256",
48
+ "CP1257": "cp1257",
49
+ "CP874": "cp874",
50
+ "UNICODE": "utf-8",
51
+ }
52
+ return _locales[locale.upper()] if locale.upper() in _locales else locale
53
+
54
+
@@ -0,0 +1,18 @@
1
+ class _ConnectionParameters(object):
2
+ """_ConnectionParameters represents the properties that are implicit to a URL."""
3
+ def __init__(self):
4
+ self.hostname = None
5
+ self.port = None
6
+ self.namespace = None
7
+ self.timeout = None
8
+ self.sharedmemory = False
9
+ self.logfile = None
10
+ self.sslcontext = None
11
+ self.isolationLevel = None
12
+ self.featureOptions = None
13
+
14
+ def _set_sharedmemory(self, sharedmemory):
15
+ self.sharedmemory = sharedmemory
16
+
17
+ def _get_sharedmemory(self):
18
+ return self.sharedmemory
@@ -0,0 +1,38 @@
1
+ class _Constant():
2
+
3
+ PROTOCOL_VERSION = 65
4
+
5
+ # Message function code
6
+ MESSAGE_CONNECT = b'Y0'
7
+ MESSAGE_DISCONNECT = b'Y4'
8
+ MESSAGE_SHUTDOWN = b'Y6'
9
+ MESSAGE_PING = b'YQ'
10
+ MESSAGE_BENCHMARK_ECHO = b'YY'
11
+ MESSAGE_LOAD_MODULES = b'YP'
12
+ MESSAGE_DYNAMIC_EXECUTE_CONSTRUCTOR = b'YA'
13
+ MESSAGE_DYNAMIC_EXECUTE_METHOD = b'YU'
14
+ MESSAGE_DYNAMIC_EXECUTE_GET = b'YV'
15
+ MESSAGE_DYNAMIC_EXECUTE_SET = b'YB'
16
+ MESSAGE_CREATE_OBJECT = b'Y9'
17
+ MESSAGE_EXCEPTION_RAISED = b'Y5'
18
+ MESSAGE_GET_LIST = b'YG'
19
+ MESSAGE_GET_STREAM = b'YH'
20
+
21
+ @staticmethod
22
+ def __convert(code):
23
+ return code[0]*256+code[1]-22832
24
+
25
+ ENUM_MESSAGE_PASSPHRASE = -48
26
+ ENUM_MESSAGE_CONNECT = __convert.__func__(MESSAGE_CONNECT)
27
+ ENUM_MESSAGE_DISCONNECT = __convert.__func__(MESSAGE_DISCONNECT)
28
+ ENUM_MESSAGE_SHUTDOWN = __convert.__func__(MESSAGE_SHUTDOWN)
29
+ ENUM_MESSAGE_PING = __convert.__func__(MESSAGE_PING)
30
+ ENUM_MESSAGE_BENCHMARK_ECHO = __convert.__func__(MESSAGE_BENCHMARK_ECHO)
31
+ ENUM_MESSAGE_LOAD_MODULES = __convert.__func__(MESSAGE_LOAD_MODULES)
32
+ ENUM_MESSAGE_DYNAMIC_EXECUTE_CONSTRUCTOR = __convert.__func__(MESSAGE_DYNAMIC_EXECUTE_CONSTRUCTOR)
33
+ ENUM_MESSAGE_DYNAMIC_EXECUTE_METHOD = __convert.__func__(MESSAGE_DYNAMIC_EXECUTE_METHOD)
34
+ ENUM_MESSAGE_DYNAMIC_EXECUTE_GET = __convert.__func__(MESSAGE_DYNAMIC_EXECUTE_GET)
35
+ ENUM_MESSAGE_DYNAMIC_EXECUTE_SET = __convert.__func__(MESSAGE_DYNAMIC_EXECUTE_SET)
36
+
37
+ # IRISNative messages
38
+