@@ -22,15 +22,18 @@ Parameter SimpleStringFull As Integer = 5;
22
22
23
23
Parameter SimpleString As Integer = 6 ;
24
24
25
- Parameter DLL As COSEXPRESSION = " $g(^isc.py.Callout, $g(^%SYS(" " bindir" " )) _ " " iscpython.dll" " )" ;
25
+ ClassMethod GetDLL () [ CodeMode = expression ]
26
+ {
27
+ $g (^isc .py .Callout , $g (^%SYS (" bindir" )) _ " iscpython." _ $select ($$$isWINDOWS:" dll" , 1 :" so" ))
28
+ }
26
29
27
30
/// Should be executed once per system start. Idempotent.
28
31
/// Add to ZSTART or production start.
29
32
/// write ##class(isc.py.Callout).Setup()
30
33
ClassMethod Setup ()
31
34
{
32
35
set sc = $ZF (-4 ,6 ,..#PyLibId)
33
- set sc = $ZF (-4 ,5 ,..#PyLibId, ..#DLL )
36
+ set sc = $ZF (-4 ,5 ,..#PyLibId, ..GetDLL () )
34
37
quit sc
35
38
}
36
39
@@ -41,7 +44,7 @@ ClassMethod Initialize(debug As %Boolean = {$$$NO}) As %Integer
41
44
if debug {
42
45
set sc = $ZF (-4 ,4 ,..#PyLibId) // unload current copy of inputlib
43
46
set sc = $ZF (-4 ,8 ) // delete existing process index, if any
44
- set sc = $ZF (-4 ,7 ,..#PyLibId, ..#DLL ) // override system index
47
+ set sc = $ZF (-4 ,7 ,..#PyLibId, ..GetDLL () ) // override system index
45
48
}
46
49
do $ZF (-6 , ..#PyLibId, ..#Initialize)
47
50
}
@@ -71,7 +74,6 @@ ClassMethod SimpleStringFull(code = {"import random;" _ $$$NL _ "x=random.random
71
74
set code = $zcvt (code , " O" , " UTF8" )
72
75
set converted = $$$YES
73
76
}
74
- set path = ..#DLL
75
77
set result = $ZF (-6 , ..#PyLibId, ..#SimpleStringFull, code )
76
78
set :converted result = $zcvt (result , " I" , " UTF8" )
77
79
quit result
@@ -87,7 +89,6 @@ ClassMethod SimpleString(code As %String = {"import random;" _ $$$NL _ "x=random
87
89
set code = $zcvt (code , " O" , " UTF8" )
88
90
set converted = $$$YES
89
91
}
90
- set path = ..#DLL
91
92
set result = $ZF (-6 , ..#PyLibId, ..#SimpleString, code , variable )
92
93
93
94
set :converted result = $zcvt (result , " I" , " UTF8" )
@@ -98,7 +99,6 @@ ClassMethod SimpleString(code As %String = {"import random;" _ $$$NL _ "x=random
98
99
/// do ##class(isc.py.Callout).Finalize()
99
100
ClassMethod Finalize () As %Integer
100
101
{
101
- set path = ..#DLL
102
102
do $ZF (-6 , ..#PyLibId, ..#Finalize)
103
103
}
104
104
0 commit comments