CheeseAPI 0.4.7__tar.gz → 0.4.9__tar.gz
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.
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/handle.py +26 -29
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/workspace.py +4 -1
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/PKG-INFO +1 -1
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/pyproject.toml +1 -1
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/.gitignore +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/__init__.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/app.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/cors.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/exception.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/file.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/protocol.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/request.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/response.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/route.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/server.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/signal.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/text.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/CheeseAPI/websocket.py +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/LICENSE +0 -0
- {cheeseapi-0.4.7 → cheeseapi-0.4.9}/README.md +0 -0
|
@@ -130,7 +130,7 @@ class Handle:
|
|
|
130
130
|
self.worker_start(sock, True)
|
|
131
131
|
|
|
132
132
|
for process in processes:
|
|
133
|
-
|
|
133
|
+
process.terminate()
|
|
134
134
|
process.join()
|
|
135
135
|
|
|
136
136
|
for text in self._app._text.server_stopping():
|
|
@@ -142,7 +142,7 @@ class Handle:
|
|
|
142
142
|
|
|
143
143
|
logger.destroy()
|
|
144
144
|
|
|
145
|
-
os.
|
|
145
|
+
os.killpg(os.getpid(), signal.SIGKILL)
|
|
146
146
|
|
|
147
147
|
def worker_beforeStarting(self):
|
|
148
148
|
for text in self._app._text.worker_starting():
|
|
@@ -275,7 +275,6 @@ class Handle:
|
|
|
275
275
|
return
|
|
276
276
|
|
|
277
277
|
if e.args[0] == 1:
|
|
278
|
-
await self.http_options(protocol)
|
|
279
278
|
if isinstance(protocol.response, BaseResponse):
|
|
280
279
|
if self._app.signal.http_options.receivers:
|
|
281
280
|
await self._app.signal.http_options.send_async(**{
|
|
@@ -350,10 +349,31 @@ class Handle:
|
|
|
350
349
|
async def http_404(self, protocol: 'HttpProtocol'):
|
|
351
350
|
protocol.response = Response(status = http.HTTPStatus.NOT_FOUND)
|
|
352
351
|
|
|
353
|
-
async def
|
|
352
|
+
async def http_405(self, protocol: 'HttpProtocol'):
|
|
353
|
+
protocol.response = Response(status = http.HTTPStatus.METHOD_NOT_ALLOWED)
|
|
354
|
+
|
|
355
|
+
async def http_500(self, protocol: 'HttpProtocol', e: BaseException, recycled: bool = False):
|
|
356
|
+
protocol.response = Response(status = http.HTTPStatus.INTERNAL_SERVER_ERROR)
|
|
357
|
+
|
|
358
|
+
if not recycled:
|
|
359
|
+
for text in self._app._text.http_500(protocol, e):
|
|
360
|
+
logger.danger(text[0], text[1])
|
|
361
|
+
|
|
362
|
+
async def http_response(self, protocol: 'HttpProtocol', recycled: bool = False):
|
|
363
|
+
if not isinstance(protocol.response, BaseResponse):
|
|
364
|
+
await self.noResponse(protocol)
|
|
365
|
+
|
|
366
|
+
if not recycled:
|
|
367
|
+
await self.http_beforeResponse(protocol)
|
|
368
|
+
if self._app.signal.http_beforeResponse.receivers:
|
|
369
|
+
await self._app.signal.http_beforeResponse.send_async(**{
|
|
370
|
+
'request': protocol.request,
|
|
371
|
+
'response': protocol.response,
|
|
372
|
+
**protocol.kwargs
|
|
373
|
+
})
|
|
374
|
+
|
|
354
375
|
if (
|
|
355
|
-
|
|
356
|
-
and (
|
|
376
|
+
(
|
|
357
377
|
protocol.request.origin not in self._app.cors.exclude_origin
|
|
358
378
|
and
|
|
359
379
|
(
|
|
@@ -380,29 +400,6 @@ class Handle:
|
|
|
380
400
|
elif self._app.cors.headers:
|
|
381
401
|
protocol.response.headers['Access-Control-Allow-Headers'] = ', '.join(self._app.cors.headers)
|
|
382
402
|
|
|
383
|
-
async def http_405(self, protocol: 'HttpProtocol'):
|
|
384
|
-
protocol.response = Response(status = http.HTTPStatus.METHOD_NOT_ALLOWED)
|
|
385
|
-
|
|
386
|
-
async def http_500(self, protocol: 'HttpProtocol', e: BaseException, recycled: bool = False):
|
|
387
|
-
protocol.response = Response(status = http.HTTPStatus.INTERNAL_SERVER_ERROR)
|
|
388
|
-
|
|
389
|
-
if not recycled:
|
|
390
|
-
for text in self._app._text.http_500(protocol, e):
|
|
391
|
-
logger.danger(text[0], text[1])
|
|
392
|
-
|
|
393
|
-
async def http_response(self, protocol: 'HttpProtocol', recycled: bool = False):
|
|
394
|
-
if not isinstance(protocol.response, BaseResponse):
|
|
395
|
-
await self.noResponse(protocol)
|
|
396
|
-
|
|
397
|
-
if not recycled:
|
|
398
|
-
await self.http_beforeResponse(protocol)
|
|
399
|
-
if self._app.signal.http_beforeResponse.receivers:
|
|
400
|
-
await self._app.signal.http_beforeResponse.send_async(**{
|
|
401
|
-
'request': protocol.request,
|
|
402
|
-
'response': protocol.response,
|
|
403
|
-
**protocol.kwargs
|
|
404
|
-
})
|
|
405
|
-
|
|
406
403
|
try:
|
|
407
404
|
content, streamed = await protocol.response()
|
|
408
405
|
protocol.transport.write(content)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|