iris-pex-embedded-python 3.2.0__py3-none-any.whl → 3.2.0b1__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/cls/IOP/Message/JSONSchema.cls +0 -25
- iop/cls/IOP/Message.cls +13 -87
- {iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/METADATA +2 -3
- {iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/RECORD +8 -8
- {iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/WHEEL +1 -1
- {iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/LICENSE +0 -0
- {iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/entry_points.txt +0 -0
- {iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/top_level.txt +0 -0
|
@@ -9,31 +9,6 @@ Property JSONSchema As %String(MAXLEN = "");
|
|
|
9
9
|
|
|
10
10
|
Index NameIndex On Name [ IdKey, Unique ];
|
|
11
11
|
|
|
12
|
-
/// Import a JSON Schema from file
|
|
13
|
-
ClassMethod ImportFromFile(
|
|
14
|
-
pFileName As %String,
|
|
15
|
-
pCategory As %String = "",
|
|
16
|
-
pName As %String) As %Status
|
|
17
|
-
{
|
|
18
|
-
Set pStatus = $$$OK
|
|
19
|
-
Try {
|
|
20
|
-
If '##class(%File).Exists(pFileName) {
|
|
21
|
-
Set pStatus = $$$ERROR($$$GeneralError, "File not found")
|
|
22
|
-
Return pStatus
|
|
23
|
-
}
|
|
24
|
-
Set tFile = ##class(%File).%New(pFileName)
|
|
25
|
-
$$$ThrowOnError(tFile.Open("R"))
|
|
26
|
-
Set tSchema = ""
|
|
27
|
-
While 'tFile.AtEnd {
|
|
28
|
-
Set tSchema = tSchema _ tFile.ReadLine()
|
|
29
|
-
}
|
|
30
|
-
Set pStatus = ..Import(tSchema, pCategory, pName)
|
|
31
|
-
} Catch ex {
|
|
32
|
-
Set pStatus = ex.AsStatus()
|
|
33
|
-
}
|
|
34
|
-
Return pStatus
|
|
35
|
-
}
|
|
36
|
-
|
|
37
12
|
/// Store the JSON Schema in this object
|
|
38
13
|
ClassMethod Import(
|
|
39
14
|
pSchema As %String,
|
iop/cls/IOP/Message.cls
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Class IOP.Message Extends (Ens.MessageBody, %CSP.Page, Ens.VDoc.Interface)
|
|
1
|
+
Class IOP.Message Extends (Ens.MessageBody, %CSP.Page, %XML.Adaptor, Ens.VDoc.Interface)
|
|
2
2
|
{
|
|
3
3
|
|
|
4
4
|
Parameter DOCCLASSNAME = "JSON Document";
|
|
@@ -27,20 +27,6 @@ Property jstr As %Stream.GlobalCharacter [ Internal, Private ];
|
|
|
27
27
|
|
|
28
28
|
Property type As %String(MAXLEN = 6) [ ReadOnly ];
|
|
29
29
|
|
|
30
|
-
/// Gets the next index in an array
|
|
31
|
-
Method GetNextIndex(
|
|
32
|
-
pPath As %String,
|
|
33
|
-
pIndex As %String,
|
|
34
|
-
ByRef pStatus As %Status = {$$$OK}) As %String
|
|
35
|
-
{
|
|
36
|
-
Set f=$F(pPath,"()") If 'f Set pStatus=$$$ERROR($$$EnsErrGeneral,"Can't iterate on no-array type '"_pPath_"'") Quit ""
|
|
37
|
-
if pIndex="" Set pIndex=0
|
|
38
|
-
Set tValue = ..GetValueAt($EXTRACT(pPath, 1, $LENGTH(pPath)-2))
|
|
39
|
-
Set builtins = ##class(%SYS.Python).Builtins()
|
|
40
|
-
if pIndex>=builtins.len(tValue) Quit ""
|
|
41
|
-
Quit pIndex+1
|
|
42
|
-
}
|
|
43
|
-
|
|
44
30
|
Method GetValueAt(
|
|
45
31
|
pPropertyPath As %String = "",
|
|
46
32
|
pFormat As %String,
|
|
@@ -157,12 +143,6 @@ Method CopyValues(
|
|
|
157
143
|
Return tSC
|
|
158
144
|
}
|
|
159
145
|
|
|
160
|
-
/// Sets a value at the specified property path in the JSON document
|
|
161
|
-
/// @param pValue Value to set
|
|
162
|
-
/// @param pPropertyPath Path to the property (e.g. "property1.property2" or "array()")
|
|
163
|
-
/// @param pAction Action to perform ("set", "append", "remove", "insert")
|
|
164
|
-
/// @param pKey Optional key for specialized operations, required for insert
|
|
165
|
-
/// @returns %Status
|
|
166
146
|
Method SetValueAt(
|
|
167
147
|
pValue As %String = "",
|
|
168
148
|
pPropertyPath As %String = "",
|
|
@@ -170,86 +150,32 @@ Method SetValueAt(
|
|
|
170
150
|
pKey As %String = "") As %Status
|
|
171
151
|
{
|
|
172
152
|
Set tSC = $$$OK
|
|
153
|
+
// if pAction is set, use jsonpath to set the value
|
|
173
154
|
Try {
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
If '$LISTFIND($LISTBUILD("set","append","remove","insert"), pAction) Return $$$ERROR($$$GeneralError, "Invalid action: "_pAction)
|
|
177
|
-
If (pAction = "insert") && (pKey = "") Return $$$ERROR($$$GeneralError, "Key is required for insert action")
|
|
155
|
+
// Convert pPropertyPath to a a jsonpath
|
|
156
|
+
Set tPath = ..ConvertPath(pPropertyPath)
|
|
178
157
|
|
|
179
|
-
// Initialize Python objects
|
|
180
158
|
Set pyjson = ##class(%SYS.Python).Import("json")
|
|
181
159
|
Set jp = ##class(%SYS.Python).Import("jsonpath_ng")
|
|
182
160
|
Set builtins = ##class(%SYS.Python).Builtins()
|
|
183
161
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
If tAppend, $EXTRACT(pPropertyPath, *-1, *) = "()" {
|
|
187
|
-
Set pPropertyPath = $EXTRACT(pPropertyPath, 1, *-2)
|
|
162
|
+
if ..json = "" {
|
|
163
|
+
Set ..json = "{}"
|
|
188
164
|
}
|
|
189
|
-
|
|
190
|
-
// Initialize empty JSON if needed
|
|
191
|
-
Set:..json="" ..json = "{}"
|
|
192
|
-
|
|
193
|
-
// Parse JSON and prepare path
|
|
194
165
|
Set tJSON = pyjson.loads(..json)
|
|
195
|
-
Set tPath = ..ConvertPath(pPropertyPath)
|
|
196
|
-
Set parser = jp.parse(tPath)
|
|
197
166
|
|
|
198
|
-
|
|
199
|
-
|
|
167
|
+
Set parser = jp.parse(tPath)
|
|
168
|
+
if pAction = "set" {
|
|
200
169
|
Set tJSON = parser."update_or_create"(tJSON, pValue)
|
|
201
170
|
}
|
|
202
|
-
ElseIf pAction = "remove" {
|
|
203
|
-
// Remove operation
|
|
204
|
-
Set matches = parser.find(tJSON)
|
|
205
|
-
If matches."__len__"() > 0 {
|
|
206
|
-
// Not yet implemented
|
|
207
|
-
Set tSC = $$$ERROR($$$GeneralError, "Remove operation not yet implemented")
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
ElseIf pAction = "insert" {
|
|
211
|
-
// Handle dictionary insert/update
|
|
212
|
-
Set matches = parser.find(tJSON)
|
|
213
|
-
If matches."__len__"() = 0 {
|
|
214
|
-
// Create new dictionary if path doesn't exist
|
|
215
|
-
Set tDict = builtins.dict()
|
|
216
|
-
Do tDict."__setitem__"(pKey, pValue)
|
|
217
|
-
Set tJSON = parser."update_or_create"(tJSON, tDict)
|
|
218
|
-
}
|
|
219
|
-
Else {
|
|
220
|
-
// Update existing dictionary
|
|
221
|
-
Set tDict = matches."__getitem__"(0)."value"
|
|
222
|
-
Do tDict."__setitem__"(pKey, pValue)
|
|
223
|
-
Set tJSON = parser."update"(tJSON, tDict)
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
ElseIf tAppend {
|
|
227
|
-
// Handle append operation
|
|
228
|
-
Set tFindValue = parser."find"(tJSON)
|
|
229
|
-
If tFindValue."__len__"() = 0 {
|
|
230
|
-
// Create new array if path doesn't exist
|
|
231
|
-
Set:(tAppend) tValue = builtins.list()
|
|
232
|
-
Do:tAppend tValue.append(pValue)
|
|
233
|
-
Set tJSON = parser."update_or_create"(tJSON, $Select(tAppend: tValue, 1: pValue))
|
|
234
|
-
}
|
|
235
|
-
Else {
|
|
236
|
-
// Append to existing array
|
|
237
|
-
Do tFindValue."__getitem__"(0)."value".append(pValue)
|
|
238
|
-
Set tJSON = parser."update"(tJSON, tFindValue."__getitem__"(0)."value")
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
171
|
|
|
242
|
-
|
|
243
|
-
Set ..json =
|
|
172
|
+
Set tResult = pyjson.dumps(tJSON)
|
|
173
|
+
Set ..json = tResult
|
|
244
174
|
Set ..classname = ..DocType
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
Catch ex {
|
|
175
|
+
|
|
176
|
+
} Catch ex {
|
|
248
177
|
Set tSC = ex.AsStatus()
|
|
249
|
-
// Log error details
|
|
250
|
-
$$$LOGWARNING("Error in SetValueAt: "_$System.Status.GetErrorText(tSC))
|
|
251
178
|
}
|
|
252
|
-
|
|
253
179
|
Return tSC
|
|
254
180
|
}
|
|
255
181
|
|
|
@@ -401,7 +327,7 @@ ClassMethod GetContentArray(
|
|
|
401
327
|
If $$$ISERR(tSC) Return tSC
|
|
402
328
|
set schema = {}.%FromJSON(json)
|
|
403
329
|
|
|
404
|
-
$$$ThrowOnError(##class(IOP.Message).SchemaToContents(schema, .tContents))
|
|
330
|
+
$$$ThrowOnError(##class(IOP.Message.Document).SchemaToContents(schema, .tContents))
|
|
405
331
|
|
|
406
332
|
Merge @pContents = tContents
|
|
407
333
|
}
|
{iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: iris_pex_embedded_python
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.0b1
|
|
4
4
|
Summary: Iris Interoperability based on Embedded Python
|
|
5
5
|
Author-email: grongier <guillaume.rongier@intersystems.com>
|
|
6
6
|
License: MIT License
|
|
@@ -49,7 +49,6 @@ Requires-Dist: xmltodict>=0.12.0
|
|
|
49
49
|
Requires-Dist: iris-embedded-python-wrapper>=0.0.6
|
|
50
50
|
Requires-Dist: setuptools>=40.8.0
|
|
51
51
|
Requires-Dist: dc-schema>=0.0.8
|
|
52
|
-
Requires-Dist: jsonpath-ng>=1.7.0
|
|
53
52
|
|
|
54
53
|
# IoP (Interoperability On Python)
|
|
55
54
|
|
{iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/RECORD
RENAMED
|
@@ -112,7 +112,7 @@ iop/cls/IOP/BusinessService.cls,sha256=7ebn32J9PiZXUgXuh5Xxm_7X6zHBiqkJr9c_dWxbP
|
|
|
112
112
|
iop/cls/IOP/Common.cls,sha256=4f4ZpLj8fsj8IKJDNb9pKoCokzo522JHWX0OqpAaC5g,11192
|
|
113
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=
|
|
115
|
+
iop/cls/IOP/Message.cls,sha256=er1TcG1UDKIpiStyXT0-zKHWxIrikmV6yzUTvFGYSB0,21932
|
|
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
|
|
@@ -120,7 +120,7 @@ iop/cls/IOP/Utils.cls,sha256=ZTBr02spm4ppxVBfhnUwb08BmhTjG5-ZbItRshYHs1I,13746
|
|
|
120
120
|
iop/cls/IOP/Duplex/Operation.cls,sha256=K_fmgeLjPZQbHgNrc0kd6DUQoW0fDn1VHQjJxHo95Zk,525
|
|
121
121
|
iop/cls/IOP/Duplex/Process.cls,sha256=xbefZ4z84a_IUhavWN6P_gZBzqkdJ5XRTXxro6iDvAg,6986
|
|
122
122
|
iop/cls/IOP/Duplex/Service.cls,sha256=sTMOQUCMBgVitmQkM8bbsrmrRtCdj91VlctJ3I7b8WU,161
|
|
123
|
-
iop/cls/IOP/Message/JSONSchema.cls,sha256=
|
|
123
|
+
iop/cls/IOP/Message/JSONSchema.cls,sha256=KLx7qYbfRehuvof1j3bBYiaVtqKPxuddrmDaKl5S_rE,2570
|
|
124
124
|
iop/cls/IOP/PrivateSession/Duplex.cls,sha256=8a_dO7E2RTzuxzoufryjlS41l-99NmTtOcmFXOnSwA8,7957
|
|
125
125
|
iop/cls/IOP/PrivateSession/Message/Ack.cls,sha256=y6-5uSVod36bxeQuT2ytPN4TUAfM1mvGGJuTbWbpNv4,941
|
|
126
126
|
iop/cls/IOP/PrivateSession/Message/Poll.cls,sha256=z3ALYmGYQasTcyYNyBeoHzJdNXI4nBO_N8Cqo9l4sQY,942
|
|
@@ -130,9 +130,9 @@ iop/cls/IOP/Service/WSGI.cls,sha256=VLNCXEwmHW9dBnE51uGE1nvGX6T4HjhqePT3LVhsjAE,
|
|
|
130
130
|
iop/wsgi/handlers.py,sha256=NrFLo_YbAh-x_PlWhAiWkQnUUN2Ss9HoEm63dDWCBpQ,2947
|
|
131
131
|
irisnative/_IRISNative.py,sha256=HQ4nBhc8t8_5OtxdMG-kx1aa-T1znf2I8obZOPLOPzg,665
|
|
132
132
|
irisnative/__init__.py,sha256=6YmvBLQSURsCPKaNg7LK-xpo4ipDjrlhKuwdfdNb3Kg,341
|
|
133
|
-
iris_pex_embedded_python-3.2.
|
|
134
|
-
iris_pex_embedded_python-3.2.
|
|
135
|
-
iris_pex_embedded_python-3.2.
|
|
136
|
-
iris_pex_embedded_python-3.2.
|
|
137
|
-
iris_pex_embedded_python-3.2.
|
|
138
|
-
iris_pex_embedded_python-3.2.
|
|
133
|
+
iris_pex_embedded_python-3.2.0b1.dist-info/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
|
|
134
|
+
iris_pex_embedded_python-3.2.0b1.dist-info/METADATA,sha256=EfLIlTJcv2YZAgp8jrL4hGJXyGPmcHAvrZqdjfqKS8Y,4393
|
|
135
|
+
iris_pex_embedded_python-3.2.0b1.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
|
136
|
+
iris_pex_embedded_python-3.2.0b1.dist-info/entry_points.txt,sha256=pj-i4LSDyiSP6xpHlVjMCbg1Pik7dC3_sdGY3Yp9Vhk,38
|
|
137
|
+
iris_pex_embedded_python-3.2.0b1.dist-info/top_level.txt,sha256=VWDlX4YF4qFVRGrG3-Gs0kgREol02i8gIpsHNbhfFPw,42
|
|
138
|
+
iris_pex_embedded_python-3.2.0b1.dist-info/RECORD,,
|
{iris_pex_embedded_python-3.2.0.dist-info → iris_pex_embedded_python-3.2.0b1.dist-info}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|