CheeseAPI 0.4.3__tar.gz → 0.4.6__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.3 → cheeseapi-0.4.6}/CheeseAPI/handle.py +3 -3
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/protocol.py +7 -5
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/text.py +1 -1
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/workspace.py +3 -3
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/PKG-INFO +1 -1
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/pyproject.toml +1 -1
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/.gitignore +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/__init__.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/app.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/cors.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/exception.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/file.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/request.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/response.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/route.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/server.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/signal.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/CheeseAPI/websocket.py +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/LICENSE +0 -0
- {cheeseapi-0.4.3 → cheeseapi-0.4.6}/README.md +0 -0
|
@@ -140,8 +140,7 @@ class Handle:
|
|
|
140
140
|
if self._app.signal.server_afterStopping.receivers:
|
|
141
141
|
self._app.signal.server_afterStopping.send()
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
time.sleep(self._app.server.intervalTime)
|
|
143
|
+
logger.destroy()
|
|
145
144
|
|
|
146
145
|
os.kill(os.getpid(), signal.SIGKILL)
|
|
147
146
|
|
|
@@ -658,7 +657,8 @@ class Handle:
|
|
|
658
657
|
})
|
|
659
658
|
|
|
660
659
|
await protocol.server.message(**{
|
|
661
|
-
'message': message
|
|
660
|
+
'message': message,
|
|
661
|
+
**protocol.kwargs
|
|
662
662
|
})
|
|
663
663
|
|
|
664
664
|
await self.websocket_afterMessage(protocol, message)
|
|
@@ -29,11 +29,6 @@ class HttpProtocol(asyncio.Protocol):
|
|
|
29
29
|
|
|
30
30
|
try:
|
|
31
31
|
self.parser.feed_data(data)
|
|
32
|
-
|
|
33
|
-
if self.request.body:
|
|
34
|
-
self.request._parseBody()
|
|
35
|
-
|
|
36
|
-
asyncio.get_event_loop().create_task(app._handle.http(self))
|
|
37
32
|
except httptools.HttpParserUpgrade:
|
|
38
33
|
self.request._upgrade()
|
|
39
34
|
|
|
@@ -53,11 +48,18 @@ class HttpProtocol(asyncio.Protocol):
|
|
|
53
48
|
self.request.origin = self.request.headers.get('Origin', f'{self.transport.get_extra_info("socket").getsockname()[0]}:{self.transport.get_extra_info("socket").getsockname()[1]}')
|
|
54
49
|
self.request.scheme = self.request.headers.get('X-Forwarded-Proto', 'https' if self.transport.get_extra_info('sslcontext') else 'http')
|
|
55
50
|
|
|
51
|
+
if not self.parser.should_upgrade() and not int(self.request.headers.get('Content-Length', 0)):
|
|
52
|
+
asyncio.get_event_loop().create_task(app._handle.http(self))
|
|
53
|
+
|
|
56
54
|
def on_body(self, body: bytes):
|
|
57
55
|
if self.request.body is None:
|
|
58
56
|
self.request.body = b''
|
|
59
57
|
self.request.body += body
|
|
60
58
|
|
|
59
|
+
if len(self.request.body) == int(self.request.headers.get('Content-Length', 0)):
|
|
60
|
+
self.request._parseBody()
|
|
61
|
+
asyncio.get_event_loop().create_task(app._handle.http(self))
|
|
62
|
+
|
|
61
63
|
def connection_lost(self, exc: Exception | None):
|
|
62
64
|
self.transport.close()
|
|
63
65
|
|
|
@@ -16,7 +16,7 @@ class Text:
|
|
|
16
16
|
self.response_server: str = 'CheeseAPI'
|
|
17
17
|
self._process_title: str = 'CheeseAPI'
|
|
18
18
|
self.workerProcess_title: str = 'CheeseAPI:Process'
|
|
19
|
-
self.logger: str = '%Y_%m_%d
|
|
19
|
+
self.logger: str = '%Y_%m_%d.log'
|
|
20
20
|
|
|
21
21
|
setproctitle.setproctitle(self._process_title)
|
|
22
22
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import os,
|
|
1
|
+
import os, sys
|
|
2
2
|
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
|
|
@@ -46,11 +46,11 @@ class Workspace:
|
|
|
46
46
|
@logger.setter
|
|
47
47
|
def logger(self, value: str | bool):
|
|
48
48
|
if value is True:
|
|
49
|
-
self._logger =
|
|
49
|
+
self._logger = self._app._text.logger
|
|
50
50
|
elif value is False:
|
|
51
51
|
self._logger = ''
|
|
52
52
|
else:
|
|
53
|
-
self._logger =
|
|
53
|
+
self._logger = value
|
|
54
54
|
|
|
55
55
|
if self.log and self.logger:
|
|
56
56
|
logger.filePath = os.path.join(self.log, self.logger)
|
|
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
|