CheeseAPI 2.0.3__tar.gz → 2.0.4__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.
@@ -1,6 +1,8 @@
1
1
  import re, uuid
2
2
  from typing import Literal, TypedDict, Callable, TYPE_CHECKING, AsyncIterable, Union
3
3
 
4
+ from urllib.parse import unquote
5
+
4
6
  from CheeseAPI.cors import CORS
5
7
 
6
8
  if TYPE_CHECKING:
@@ -252,7 +254,7 @@ class RouteProxy:
252
254
  i = 1
253
255
  for key, type in self.app.route._proxy.dynamic_routes[_path][method]['params'].items():
254
256
  value = match.group(i)
255
- _params[key] = type(value)
257
+ _params[key] = type(unquote(value))
256
258
  i += 1
257
259
  return self.app.route._proxy.dynamic_routes[_path][method], _params
258
260
  else:
@@ -158,6 +158,14 @@ class SchedulerProxy:
158
158
 
159
159
  self._tasks: dict[str, Task] = {}
160
160
 
161
+ def __getstate__(self):
162
+ return {
163
+ 'app': self.app
164
+ }
165
+
166
+ def __setstate__(self, state):
167
+ self.app = state['app']
168
+
161
169
  def add(self, fn: Callable | None = None, *, interval_time: float | None = None, first_run_timer: datetime.datetime | None = None, expected_run_num: int | None = None, key: str | None = None, run_type: Literal['THREAD', 'PROCESS'] = 'THREAD', args: tuple = (), kwargs: dict = {}, auto_remove: bool = False):
162
170
  if fn is not None:
163
171
  task = Task(fn, interval_time = interval_time, first_run_timer = first_run_timer, expected_run_num = expected_run_num, key = key, run_type = run_type, args = args, kwargs = kwargs, auto_remove = auto_remove)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CheeseAPI
3
- Version: 2.0.3
3
+ Version: 2.0.4
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 = "2.0.3"
7
+ version = "2.0.4"
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