iris-pex-embedded-python 2.3.23b1__py3-none-any.whl → 2.3.23b3__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.
- grongier/cls/Grongier/Service/WSGI.cls +274 -72
- grongier/pex/wsgi/handlers.py +91 -38
- {iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/METADATA +1 -1
- {iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/RECORD +8 -8
- {iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/LICENSE +0 -0
- {iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/WHEEL +0 -0
- {iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/entry_points.txt +0 -0
- {iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Class Grongier.Service.WSGI Extends
|
|
1
|
+
Class Grongier.Service.WSGI Extends %CSP.REST [ ServerOnly = 1 ]
|
|
2
2
|
{
|
|
3
3
|
|
|
4
4
|
Parameter CLASSPATHS;
|
|
@@ -7,99 +7,301 @@ Parameter MODULENAME;
|
|
|
7
7
|
|
|
8
8
|
Parameter APPNAME;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
ClassMethod write(data)
|
|
12
|
-
{
|
|
13
|
-
w data
|
|
14
|
-
}
|
|
10
|
+
Parameter DEVMODE = 1;
|
|
15
11
|
|
|
16
|
-
///
|
|
17
|
-
ClassMethod
|
|
12
|
+
/// This method matches the request and method and calls the dispatcher
|
|
13
|
+
ClassMethod Page(skipheader As %Boolean = 0) As %Status [ ProcedureBlock = 1 ]
|
|
18
14
|
{
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
#dim tSC As %Status = $$$OK
|
|
16
|
+
#dim e As %Exception.AbstractException
|
|
17
|
+
|
|
18
|
+
#dim tAuthorized,tRedirected As %Boolean
|
|
19
|
+
#dim tRedirectRoutine,tURL As %String = ""
|
|
20
|
+
#dim %response As %CSP.Response
|
|
21
|
+
|
|
22
|
+
Try {
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
#; Ensure that we honor the requested charset
|
|
25
|
+
Set %response.CharSet=..#CHARSET
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
#; Ensure that we honor the requested CONTENTTYPE
|
|
28
|
+
If ..#CONTENTTYPE'="" Set %response.ContentType=..#CONTENTTYPE
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
do dict."__setitem__"("CONTENT_TYPE", %request.ContentType)
|
|
35
|
-
do dict."__setitem__"("CHARSET", %request.CharSet)
|
|
36
|
-
Set app=$$getapp^%SYS.cspServer(%request.URL,.path,.match,.updatedurl)
|
|
37
|
-
do dict."__setitem__"("PATH_INFO", $extract(updatedurl,$length(path),*))
|
|
30
|
+
#; Ensure that we honor the requested HTTP_ACCEPT_LANGUAGE
|
|
31
|
+
Set %response.Domain = ..#DOMAIN
|
|
32
|
+
Do %response.MatchLanguage()
|
|
33
|
+
|
|
34
|
+
if ..#DEVMODE {
|
|
35
|
+
w %session.SessionId
|
|
36
|
+
}
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
#; Record if device re-direction is already active
|
|
39
|
+
Set tRedirected=##class(%Library.Device).ReDirectIO()
|
|
40
|
+
|
|
41
|
+
#; Record the redirect routine
|
|
42
|
+
Set tRedirectRoutine=$System.Device.GetMnemonicRoutine()
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
#; Now switch to using THIS routine for device redirection
|
|
45
|
+
Use $io::("^%SYS.cspServer2")
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if onePath'="" do sys.path.append(onePath)
|
|
47
|
+
#; Switch device redirection on (may already be on but thats ok)
|
|
48
|
+
Do ##class(%Library.Device).ReDirectIO(1)
|
|
49
|
+
|
|
50
|
+
#; Ensure that the application is defined (security check)
|
|
51
|
+
If $$$GetSecurityApplicationsDispatchClass(%request.AppData)="" {
|
|
52
|
+
|
|
53
|
+
#; Report not authorized
|
|
54
|
+
Set tSC=..Http403()
|
|
55
|
+
|
|
56
|
+
#; Done
|
|
57
|
+
Quit
|
|
56
58
|
}
|
|
57
|
-
|
|
59
|
+
|
|
60
|
+
#; GgiEnvs are not defined in the CSP shell
|
|
61
|
+
Set tURL=$Get(%request.CgiEnvs("CSPLIB"))
|
|
62
|
+
If tURL="" Set tURL=%request.URL
|
|
63
|
+
|
|
64
|
+
#; Do an access check
|
|
65
|
+
Set tSC=..AccessCheck(.tAuthorized)
|
|
66
|
+
If $$$ISERR(tSC) Quit
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
If tAuthorized=0 {
|
|
69
|
+
|
|
70
|
+
#; Don't want the session token
|
|
71
|
+
Set %response.OutputSessionToken=0
|
|
72
|
+
|
|
73
|
+
#; Set the Http Status
|
|
74
|
+
Set %response.Status=..#HTTP403FORBIDDEN
|
|
75
|
+
|
|
76
|
+
#; Done
|
|
77
|
+
Quit
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#; Extract the match url from the application name
|
|
81
|
+
Set tMatchUrl = "/"_$Extract(tURL,$Length(%request.Application)+1,*)
|
|
82
|
+
|
|
83
|
+
#; Dispatch the request
|
|
84
|
+
Set tSC=..DispatchRequest(tMatchUrl,%request.Method)
|
|
85
|
+
|
|
86
|
+
} Catch (e) {
|
|
87
|
+
Set tSC=e.AsStatus()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
If $$$ISERR(tSC) {
|
|
91
|
+
|
|
92
|
+
#; Don't want the session token
|
|
93
|
+
Set %response.OutputSessionToken=0
|
|
94
|
+
|
|
95
|
+
Do ..Http500(##class(%Exception.StatusException).CreateFromStatus(tSC))
|
|
96
|
+
}
|
|
61
97
|
|
|
62
|
-
|
|
63
|
-
|
|
98
|
+
#; Ensure that at least something is written out as the body
|
|
99
|
+
#; This will trigger the device redirect capture and force headers to be written
|
|
100
|
+
#; (if not already done)
|
|
101
|
+
Write ""
|
|
102
|
+
|
|
103
|
+
#; Reset redirect device if necessary
|
|
104
|
+
If tRedirected {
|
|
105
|
+
|
|
106
|
+
#; Use the original redirected routine
|
|
107
|
+
Use $io::("^"_tRedirectRoutine)
|
|
108
|
+
|
|
109
|
+
#; Switch device redirection on
|
|
110
|
+
Do ##class(%Library.Device).ReDirectIO(1)
|
|
111
|
+
}
|
|
64
112
|
|
|
65
|
-
|
|
66
|
-
|
|
113
|
+
Quit $$$OK
|
|
114
|
+
}
|
|
67
115
|
|
|
68
|
-
|
|
116
|
+
ClassMethod OnPreDispatch(
|
|
117
|
+
pUrl As %String,
|
|
118
|
+
pMethod As %String,
|
|
119
|
+
ByRef pContinue As %Boolean) As %Status
|
|
120
|
+
{
|
|
121
|
+
Set path = ..#CLASSPATHS
|
|
122
|
+
Set appName = ..#APPNAME
|
|
123
|
+
Set module = ..#MODULENAME
|
|
124
|
+
Set devmode = ..#DEVMODE
|
|
125
|
+
Set pContinue = 1
|
|
126
|
+
Do ..DispatchREST(pUrl, path, appName, module, devmode)
|
|
127
|
+
Quit $$$OK
|
|
69
128
|
}
|
|
70
129
|
|
|
71
|
-
ClassMethod
|
|
130
|
+
ClassMethod DispatchREST(
|
|
131
|
+
PathInfo As %String,
|
|
132
|
+
appPath As %String,
|
|
133
|
+
appName As %String,
|
|
134
|
+
module As %String,
|
|
135
|
+
devmode As %Boolean = 1) As %Status
|
|
72
136
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
137
|
+
Set builtins = ##CLASS(%SYS.Python).Builtins()
|
|
138
|
+
Set interface = ##CLASS(%SYS.Python).Import("grongier.pex.wsgi.handlers")
|
|
139
|
+
Set rawformdata = ""
|
|
140
|
+
Set environ = builtins.dict()
|
|
141
|
+
Set key = %request.NextCgiEnv("")
|
|
77
142
|
|
|
78
|
-
|
|
79
|
-
|
|
143
|
+
// Let's check if the WSGI application has been loaded or not for this session.
|
|
144
|
+
|
|
145
|
+
If (($DATA(%session.Data("application")) && $ISOBJECT(%session.Data("application"))) && 'devmode) {
|
|
146
|
+
Set application = %session.Data("Application")
|
|
147
|
+
}
|
|
148
|
+
Else{
|
|
80
149
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
set handler = ##class(%SYS.Python).Import("grongier.pex.wsgi.handlers").IrisHandler(ba, sys.stdout, sys.stderr,environ)
|
|
150
|
+
Set application = ..GetPythonClass(appName, module, appPath)
|
|
151
|
+
If application = "" {
|
|
152
|
+
throw ##class(%Exception.General).%New("Error loading WSGI application: "_module_"."_appName_" from "_appPath)
|
|
153
|
+
}
|
|
154
|
+
Else {
|
|
155
|
+
Set %session.Data("Application") = application
|
|
156
|
+
}
|
|
157
|
+
}
|
|
90
158
|
|
|
91
|
-
|
|
92
|
-
|
|
159
|
+
// Editing some CGI variables that may be incorrect in %request
|
|
160
|
+
// Also filling in environ with as many CGI variables as possible from %request
|
|
161
|
+
// WSGI states that all CGI variables are valid and should be included if possible
|
|
162
|
+
While (key'="") {
|
|
163
|
+
Set value = %request.GetCgiEnv(key)
|
|
164
|
+
If key = "PATH_INFO" {
|
|
165
|
+
Set app=$$getapp^%SYS.cspServer(%request.URL,.path,.match,.updatedurl)
|
|
166
|
+
Set value = $EXTRACT(updatedurl,$LENGTH(path),*)
|
|
167
|
+
}
|
|
168
|
+
If key = "SCRIPT_NAME" {
|
|
169
|
+
//%request will sometimes have Script_name include Path_info
|
|
170
|
+
Set value = $PIECE(%request.Application, "/",1,*-1)
|
|
171
|
+
}
|
|
172
|
+
Do environ."__setitem__"(key,value)
|
|
173
|
+
Set key = %request.NextCgiEnv(key)
|
|
174
|
+
}
|
|
93
175
|
|
|
94
|
-
|
|
95
|
-
|
|
176
|
+
//Have to set up a correct wsgi.input stream from %request
|
|
177
|
+
Set stream = %request.Content
|
|
178
|
+
|
|
179
|
+
Set contentType = %request.ContentType
|
|
180
|
+
Set contentLength = 0
|
|
96
181
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
182
|
+
If contentType = "application/x-www-form-urlencoded" {
|
|
183
|
+
Set formdict = builtins.dict()
|
|
184
|
+
Set key = $ORDER(%request.Data(""))
|
|
185
|
+
While (key'="") {
|
|
186
|
+
Set value = $GET(%request.Data(key,1))
|
|
187
|
+
Do formdict."__setitem__"(key,value)
|
|
188
|
+
Set key = $ORDER(%request.Data(key))
|
|
189
|
+
}
|
|
190
|
+
Do environ."__setitem__"("formdata", formdict)
|
|
191
|
+
}
|
|
192
|
+
ElseIf contentType = "multipart/form-data" {
|
|
193
|
+
Set boundary = $PIECE(%request.GetCgiEnv("CONTENT_TYPE"), "=",2)
|
|
194
|
+
Set stream = ##CLASS(%CSP.BinaryStream).%New()
|
|
195
|
+
|
|
196
|
+
Do stream.Write($CHAR(13,10))
|
|
197
|
+
|
|
198
|
+
//Get the Form Data values
|
|
199
|
+
|
|
200
|
+
Set key = $ORDER(%request.Data(""))
|
|
201
|
+
While (key'="") {
|
|
202
|
+
Do stream.Write("--")
|
|
203
|
+
Do stream.Write(boundary)
|
|
204
|
+
Do stream.Write($CHAR(13,10))
|
|
205
|
+
Set value = $GET(%request.Data(key,1))
|
|
206
|
+
Do stream.Write("Content-Disposition: form-data; name=")
|
|
207
|
+
Do stream.Write(""""_key_"""")
|
|
208
|
+
Do stream.Write($CHAR(13,10,13,10))
|
|
209
|
+
Do stream.Write(value)
|
|
210
|
+
Do stream.Write($CHAR(13,10))
|
|
211
|
+
Set key = $ORDER(%request.Data(key))
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
//Now get the possible MIME data streams
|
|
215
|
+
Set key = %request.NextMimeData("")
|
|
216
|
+
While key'="" {
|
|
217
|
+
Set numMimeStreams = %request.CountMimeData(key)
|
|
218
|
+
Set index = %request.NextMimeDataIndex(key, "")
|
|
219
|
+
Do stream.Write("--")
|
|
220
|
+
Do stream.Write(boundary)
|
|
221
|
+
Do stream.Write($CHAR(13,10))
|
|
222
|
+
If numMimeStreams > 1 {
|
|
223
|
+
//I need to create a boundary for a nested multipart content type
|
|
224
|
+
Set internalboundary = "--"
|
|
225
|
+
For i = 1 : 1 : 7 {
|
|
226
|
+
Set internalboundary = internalboundary _ $RANDOM(10)
|
|
227
|
+
}
|
|
228
|
+
While index '= "" {
|
|
229
|
+
Set mimestream = %request.GetMimeData(key, index)
|
|
230
|
+
Set headers = mimestream.Headers
|
|
231
|
+
Do stream.Write("--")
|
|
232
|
+
Do stream.Write(internalboundary)
|
|
233
|
+
Do stream.Write($CHAR(13,10))
|
|
234
|
+
Do stream.Write(headers)
|
|
235
|
+
Do stream.Write($CHAR(13,10,13,10))
|
|
236
|
+
Set sc = stream.CopyFrom(mimestream)
|
|
237
|
+
//TODO error handling
|
|
238
|
+
Do stream.Write($CHAR(13,10))
|
|
239
|
+
Set index = %request.NextMimeDataIndex(key, index)
|
|
240
|
+
}
|
|
241
|
+
Do stream.Write("--")
|
|
242
|
+
Do stream.Write(internalboundary)
|
|
243
|
+
Do stream.Write("--")
|
|
244
|
+
}
|
|
245
|
+
Else {
|
|
246
|
+
Set mimestream = %request.GetMimeData(key, index)
|
|
247
|
+
Set headers = mimestream.Headers
|
|
248
|
+
Do stream.Write(headers)
|
|
249
|
+
Do stream.Write($CHAR(13,10,13,10))
|
|
250
|
+
Set sc = stream.CopyFrom(mimestream)
|
|
251
|
+
//TODO error handling
|
|
252
|
+
Do stream.Write($CHAR(13,10))
|
|
253
|
+
}
|
|
254
|
+
Set key = %request.NextMimeData(key)
|
|
255
|
+
}
|
|
256
|
+
Do stream.Write("--")
|
|
257
|
+
Do stream.Write(boundary)
|
|
258
|
+
Do stream.Write("--")
|
|
259
|
+
Do stream.Rewind()
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
Try {
|
|
264
|
+
Do interface."make_request"(environ, stream, application, appPath)
|
|
265
|
+
}
|
|
266
|
+
Catch exception {
|
|
267
|
+
throw exception
|
|
268
|
+
}
|
|
269
|
+
Quit $$$OK
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
ClassMethod GetPythonClass(
|
|
273
|
+
pClassname As %String,
|
|
274
|
+
pModule As %String,
|
|
275
|
+
pClasspath As %String) As %SYS.Python
|
|
276
|
+
{
|
|
277
|
+
Try {
|
|
278
|
+
If pClasspath '="" {
|
|
279
|
+
set sys = ##class(%SYS.Python).Import("sys")
|
|
280
|
+
|
|
281
|
+
for i=0:1:(sys.path."__len__"()-1) {
|
|
282
|
+
Try {
|
|
283
|
+
if sys.path."__getitem__"(i) = pClasspath {
|
|
284
|
+
do sys.path."__delitem__"(i)
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
Catch ex {
|
|
288
|
+
// do nothing
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
}
|
|
292
|
+
do sys.path.insert(0, pClasspath)
|
|
293
|
+
}
|
|
101
294
|
|
|
102
|
-
|
|
295
|
+
Set importlib = ##class(%SYS.Python).Import("importlib")
|
|
296
|
+
Set builtins = ##class(%SYS.Python).Import("builtins")
|
|
297
|
+
Set module = importlib."import_module"(pModule)
|
|
298
|
+
Set class = builtins.getattr(module, pClassname)
|
|
299
|
+
}
|
|
300
|
+
Catch ex {
|
|
301
|
+
throw ##class(%Exception.General).%New("Error loading WSGI application: "_pModule_"."_pClassname_" from "_pClasspath)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
Quit class
|
|
103
305
|
}
|
|
104
306
|
|
|
105
307
|
}
|
grongier/pex/wsgi/handlers.py
CHANGED
|
@@ -1,51 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import os, sys, importlib, urllib.parse
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
|
|
4
|
+
__ospath = os.getcwd()
|
|
5
|
+
|
|
3
6
|
import iris
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
os.chdir(__ospath)
|
|
9
|
+
|
|
10
|
+
enc, esc = sys.getfilesystemencoding(), 'surrogateescape'
|
|
11
|
+
|
|
12
|
+
rest_service = iris.cls('%REST.Impl')
|
|
13
|
+
|
|
14
|
+
def get_from_module(app_path, app_module, app_name):
|
|
15
|
+
|
|
16
|
+
# Add the path to the application
|
|
17
|
+
if (app_path not in sys.path) :
|
|
18
|
+
sys.path.append(app_path)
|
|
19
|
+
|
|
20
|
+
# retrieve the application
|
|
21
|
+
return getattr(importlib.import_module(app_module), app_name)
|
|
22
|
+
|
|
23
|
+
# Changes the current working directory to the manager directory of the instance.
|
|
24
|
+
def goto_manager_dir():
|
|
25
|
+
iris.system.Process.CurrentDirectory(iris.system.Util.ManagerDirectory())
|
|
26
|
+
|
|
27
|
+
def unicode_to_wsgi(u):
|
|
28
|
+
# Convert an environment variable to a WSGI "bytes-as-unicode" string
|
|
29
|
+
return u.encode(enc, esc).decode('iso-8859-1')
|
|
30
|
+
|
|
31
|
+
def wsgi_to_bytes(s):
|
|
32
|
+
return s.encode('iso-8859-1')
|
|
33
|
+
|
|
34
|
+
def write(chunk):
|
|
35
|
+
rest_service._WriteResponse(chunk)
|
|
36
|
+
|
|
37
|
+
def start_response(status, response_headers, exc_info=None):
|
|
38
|
+
'''WSGI start_response callable'''
|
|
39
|
+
if exc_info:
|
|
40
|
+
try:
|
|
41
|
+
raise exc_info[1].with_traceback(exc_info[2])
|
|
42
|
+
finally:
|
|
43
|
+
exc_info = None
|
|
7
44
|
|
|
8
|
-
|
|
9
|
-
|
|
45
|
+
rest_service._SetStatusCode(status)
|
|
46
|
+
for tuple in response_headers:
|
|
47
|
+
rest_service._SetHeader(tuple[0], tuple[1])
|
|
48
|
+
return write
|
|
10
49
|
|
|
11
|
-
Usage::
|
|
12
50
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
16
|
-
handler.run(app)"""
|
|
51
|
+
# Make request to application
|
|
52
|
+
def make_request(environ, stream, application, path):
|
|
17
53
|
|
|
18
|
-
|
|
19
|
-
|
|
54
|
+
# Change the working directory for logging purposes
|
|
55
|
+
goto_manager_dir()
|
|
20
56
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
self.stderr = stderr
|
|
27
|
-
self.base_env = environ
|
|
28
|
-
self.wsgi_multithread = multithread
|
|
29
|
-
self.wsgi_multiprocess = multiprocess
|
|
57
|
+
error_log_file = open('WSGI.log', 'a+')
|
|
58
|
+
|
|
59
|
+
# We want the working directory to be the app's directory
|
|
60
|
+
if (not path.endswith(os.path.sep)):
|
|
61
|
+
path = path + os.path.sep
|
|
30
62
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
#iris.system.Process.CurrentDirectory(path)
|
|
64
|
+
|
|
65
|
+
# Set up the body of the request
|
|
66
|
+
if stream != '':
|
|
67
|
+
bytestream = stream
|
|
68
|
+
elif (environ['CONTENT_TYPE'] == 'application/x-www-form-urlencoded'):
|
|
69
|
+
bytestream = BytesIO()
|
|
70
|
+
part = urllib.parse.urlencode(environ['formdata'])
|
|
71
|
+
bytestream.write(part.encode('utf-8'))
|
|
72
|
+
bytestream.seek(0)
|
|
73
|
+
else:
|
|
74
|
+
bytestream = BytesIO(b'')
|
|
38
75
|
|
|
76
|
+
#for k,v in os.environ.items():
|
|
77
|
+
#environ[k] = unicode_to_wsgi(v)
|
|
78
|
+
environ['wsgi.input'] = bytestream
|
|
79
|
+
environ['wsgi.errors'] = error_log_file
|
|
80
|
+
environ['wsgi.version'] = (1, 0)
|
|
81
|
+
environ['wsgi.multithread'] = False
|
|
82
|
+
environ['wsgi.multiprocess'] = True
|
|
83
|
+
environ['wsgi.run_once'] = True
|
|
39
84
|
|
|
40
|
-
def get_stderr(self):
|
|
41
|
-
return self.stderr
|
|
42
85
|
|
|
43
|
-
|
|
44
|
-
|
|
86
|
+
if environ.get('HTTPS', 'off') in ('on', '1'):
|
|
87
|
+
environ['wsgi.url_scheme'] = 'https'
|
|
88
|
+
else:
|
|
89
|
+
environ['wsgi.url_scheme'] = 'http'
|
|
90
|
+
|
|
91
|
+
# Calling WSGI application
|
|
92
|
+
response = application(environ, start_response)
|
|
45
93
|
|
|
46
|
-
|
|
47
|
-
iris.cls('Grongier.Service.WSGI').write(data)
|
|
94
|
+
error_log_file.close()
|
|
48
95
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
96
|
+
try:
|
|
97
|
+
for data in response:
|
|
98
|
+
if data:
|
|
99
|
+
# (REST.Impl).Write() needs a utf-8 string
|
|
100
|
+
write(data.decode('utf-8'))
|
|
101
|
+
write(b'')
|
|
102
|
+
finally:
|
|
103
|
+
if hasattr(response, 'close'):
|
|
104
|
+
response.close()
|
{iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/RECORD
RENAMED
|
@@ -18,7 +18,7 @@ grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls,sha256=WbBn7pWj5mzruVfL
|
|
|
18
18
|
grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls,sha256=2lj-e20AH7RR8UgGJaldrk-1kd8WjQJNPiH-duds_4A,987
|
|
19
19
|
grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls,sha256=DAtq4DyRqFq2_4Isa0cZjjwuAzdHjsQu8wMppK4myzs,994
|
|
20
20
|
grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls,sha256=ofVKjrN6UPFasalrjPFWYNwlJ5IBlAE62IH8_U07c0g,1435
|
|
21
|
-
grongier/cls/Grongier/Service/WSGI.cls,sha256=
|
|
21
|
+
grongier/cls/Grongier/Service/WSGI.cls,sha256=6nQq8Ddj-gXmnnVkQeQ9BPsn0I9i8hu9dbili742N1w,10391
|
|
22
22
|
grongier/pex/__init__.py,sha256=nvcmRCxLy-lpL5GzlCKrmsSK8LF8Q0aKddx6ib8U50E,1166
|
|
23
23
|
grongier/pex/__main__.py,sha256=ebEYPDOBKiXOlmdI4onpQLzfBKU4wyfijYyquA5dWV4,107
|
|
24
24
|
grongier/pex/_business_host.py,sha256=G4-eWlQzWMvjaHauISfSoogPsfQYJavmRi563ak6FS8,20858
|
|
@@ -35,7 +35,7 @@ grongier/pex/_pickle_message.py,sha256=noKfc2VkXufV3fqjKvNHN_oANQ1YN9ffCaSV0XSTA
|
|
|
35
35
|
grongier/pex/_private_session_duplex.py,sha256=Qj_xzwwFnFVwi_Sl7Q7nKk4zmL6UC8iqBAuwnz7mVX8,5033
|
|
36
36
|
grongier/pex/_private_session_process.py,sha256=_2r_csWcVRLmIUt4O0Y1Hg1FcX6A08lt9DvALQhwu8s,1722
|
|
37
37
|
grongier/pex/_utils.py,sha256=GjHT5WolQAoeYkhHP3a0uDBlRzPIkyGG_bi-TwrMdjI,15877
|
|
38
|
-
grongier/pex/wsgi/handlers.py,sha256=
|
|
38
|
+
grongier/pex/wsgi/handlers.py,sha256=NrFLo_YbAh-x_PlWhAiWkQnUUN2Ss9HoEm63dDWCBpQ,2947
|
|
39
39
|
intersystems_iris/_BufferReader.py,sha256=BXjHQs-sclAnvW9mvdlIrtku9m2Jf67Rc5rsZll7a5g,299
|
|
40
40
|
intersystems_iris/_BufferWriter.py,sha256=i2BKM99J8pB5fGn-Gjdo4vcwXPEZQymsLEQd69nJrhs,1337
|
|
41
41
|
intersystems_iris/_ConnectionInformation.py,sha256=Xr6sOPy3uKFyOG05hTmutDHTNjHDhCnCVwH0TTNEwBE,1896
|
|
@@ -105,9 +105,9 @@ iris/iris_ipm.py,sha256=Q0jcNItjywlqOPZr0hgdTFSeLPNEmB-tcICOI_cXnaY,790
|
|
|
105
105
|
iris/iris_ipm.pyi,sha256=j7CNUZcjeDu5sgeWUZJO_Qi4vQmHh6aD-jPWv8OdoUs,374
|
|
106
106
|
irisnative/_IRISNative.py,sha256=HQ4nBhc8t8_5OtxdMG-kx1aa-T1znf2I8obZOPLOPzg,665
|
|
107
107
|
irisnative/__init__.py,sha256=6YmvBLQSURsCPKaNg7LK-xpo4ipDjrlhKuwdfdNb3Kg,341
|
|
108
|
-
iris_pex_embedded_python-2.3.
|
|
109
|
-
iris_pex_embedded_python-2.3.
|
|
110
|
-
iris_pex_embedded_python-2.3.
|
|
111
|
-
iris_pex_embedded_python-2.3.
|
|
112
|
-
iris_pex_embedded_python-2.3.
|
|
113
|
-
iris_pex_embedded_python-2.3.
|
|
108
|
+
iris_pex_embedded_python-2.3.23b3.dist-info/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
|
|
109
|
+
iris_pex_embedded_python-2.3.23b3.dist-info/METADATA,sha256=4hV0DcHpmZqQuZIDLiK6qI3devsAFLvNA4NtMQ60hSo,49682
|
|
110
|
+
iris_pex_embedded_python-2.3.23b3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
111
|
+
iris_pex_embedded_python-2.3.23b3.dist-info/entry_points.txt,sha256=atkAtHoIuwXcZ0jl5gwof0l__ru_lt8WhVYk6HxYf70,47
|
|
112
|
+
iris_pex_embedded_python-2.3.23b3.dist-info/top_level.txt,sha256=Tl4ZHgeNefaZW2Oug30vSldhD-tWzixsIfzASBrZ9ps,43
|
|
113
|
+
iris_pex_embedded_python-2.3.23b3.dist-info/RECORD,,
|
{iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/LICENSE
RENAMED
|
File without changes
|
{iris_pex_embedded_python-2.3.23b1.dist-info → iris_pex_embedded_python-2.3.23b3.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|