CheeseAPI 0.4.6__tar.gz → 0.4.8__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.
@@ -130,7 +130,7 @@ class Handle:
130
130
  self.worker_start(sock, True)
131
131
 
132
132
  for process in processes:
133
- os.kill(process.pid, signal.SIGKILL)
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.kill(os.getpid(), signal.SIGKILL)
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():
@@ -445,7 +445,7 @@ class Handle:
445
445
  })
446
446
 
447
447
  if e.args[0] == 0:
448
- self.websocket_404(protocol)
448
+ await self.websocket_404(protocol)
449
449
  if self._app.signal.websocket_404.receivers:
450
450
  await self._app.signal.websocket_404.send_async(**{
451
451
  'request': protocol.request,
@@ -455,7 +455,7 @@ class Handle:
455
455
  return await self.websocket_response(protocol)
456
456
 
457
457
  elif e.args[0] == 1:
458
- self.websocket_405(protocol)
458
+ await self.websocket_405(protocol)
459
459
  if self._app.signal.websocket_405.receivers:
460
460
  await self._app.signal.websocket_405.send_async(**{
461
461
  'request': protocol.request,
@@ -23,10 +23,6 @@ class HttpProtocol(asyncio.Protocol):
23
23
  self.transport = transport
24
24
 
25
25
  def data_received(self, data: bytes) -> None:
26
- self.request = None
27
- self.response = None
28
- self.kwargs = {}
29
-
30
26
  try:
31
27
  self.parser.feed_data(data)
32
28
  except httptools.HttpParserUpgrade:
@@ -39,6 +35,8 @@ class HttpProtocol(asyncio.Protocol):
39
35
 
40
36
  def on_url(self, url: bytes):
41
37
  self.request = Request(http.HTTPMethod(self.parser.get_method().decode()), url.decode())
38
+ self.response = None
39
+ self.kwargs = {}
42
40
 
43
41
  def on_header(self, key: bytes, value: bytes):
44
42
  self.request.headers['-'.join([t.capitalize() for t in key.decode().split('-')])] = value.decode()
@@ -22,7 +22,10 @@ class Workspace:
22
22
 
23
23
  @base.setter
24
24
  def base(self, value: str):
25
- sys.path.remove(self._base)
25
+ try:
26
+ sys.path.remove(self._base)
27
+ except:
28
+ ...
26
29
  self._base = value
27
30
  sys.path.append(self._base)
28
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: CheeseAPI
3
- Version: 0.4.6
3
+ Version: 0.4.8
4
4
  Summary: 一款web协程框架。
5
5
  Project-URL: Source, https://github.com/CheeseUnknown/CheeseAPI
6
6
  Author-email: Cheese Unknown <cheese@cheese.ren>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "CheeseAPI"
7
- version = "0.4.6"
7
+ version = "0.4.8"
8
8
  description = "一款web协程框架。"
9
9
  readme = "README.md"
10
10
  license-files = { paths = [ "LICENSE" ] }
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