zenx 0.6.6__tar.gz → 0.6.7__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.
Files changed (31) hide show
  1. {zenx-0.6.6 → zenx-0.6.7}/PKG-INFO +1 -1
  2. {zenx-0.6.6 → zenx-0.6.7}/pyproject.toml +1 -1
  3. {zenx-0.6.6 → zenx-0.6.7}/zenx/clients/http.py +12 -1
  4. {zenx-0.6.6 → zenx-0.6.7}/zenx/utils.py +0 -11
  5. {zenx-0.6.6 → zenx-0.6.7}/zenx.egg-info/PKG-INFO +1 -1
  6. {zenx-0.6.6 → zenx-0.6.7}/setup.cfg +0 -0
  7. {zenx-0.6.6 → zenx-0.6.7}/zenx/cli.py +0 -0
  8. {zenx-0.6.6 → zenx-0.6.7}/zenx/clients/__init__.py +0 -0
  9. {zenx-0.6.6 → zenx-0.6.7}/zenx/clients/database.py +0 -0
  10. {zenx-0.6.6 → zenx-0.6.7}/zenx/debug_runner.py +0 -0
  11. {zenx-0.6.6 → zenx-0.6.7}/zenx/discovery.py +0 -0
  12. {zenx-0.6.6 → zenx-0.6.7}/zenx/engine.py +0 -0
  13. {zenx-0.6.6 → zenx-0.6.7}/zenx/exceptions.py +0 -0
  14. {zenx-0.6.6 → zenx-0.6.7}/zenx/logger.py +0 -0
  15. {zenx-0.6.6 → zenx-0.6.7}/zenx/pipelines/__init__.py +0 -0
  16. {zenx-0.6.6 → zenx-0.6.7}/zenx/pipelines/base.py +0 -0
  17. {zenx-0.6.6 → zenx-0.6.7}/zenx/pipelines/google_rpc.py +0 -0
  18. {zenx-0.6.6 → zenx-0.6.7}/zenx/pipelines/manager.py +0 -0
  19. {zenx-0.6.6 → zenx-0.6.7}/zenx/pipelines/preprocess.py +0 -0
  20. {zenx-0.6.6 → zenx-0.6.7}/zenx/pipelines/websocket.py +0 -0
  21. {zenx-0.6.6 → zenx-0.6.7}/zenx/resources/proto/__init__.py +0 -0
  22. {zenx-0.6.6 → zenx-0.6.7}/zenx/resources/proto/feed_pb2.py +0 -0
  23. {zenx-0.6.6 → zenx-0.6.7}/zenx/resources/proto/feed_pb2_grpc.py +0 -0
  24. {zenx-0.6.6 → zenx-0.6.7}/zenx/settings.py +0 -0
  25. {zenx-0.6.6 → zenx-0.6.7}/zenx/spiders/__init__.py +0 -0
  26. {zenx-0.6.6 → zenx-0.6.7}/zenx/spiders/base.py +0 -0
  27. {zenx-0.6.6 → zenx-0.6.7}/zenx.egg-info/SOURCES.txt +0 -0
  28. {zenx-0.6.6 → zenx-0.6.7}/zenx.egg-info/dependency_links.txt +0 -0
  29. {zenx-0.6.6 → zenx-0.6.7}/zenx.egg-info/entry_points.txt +0 -0
  30. {zenx-0.6.6 → zenx-0.6.7}/zenx.egg-info/requires.txt +0 -0
  31. {zenx-0.6.6 → zenx-0.6.7}/zenx.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zenx
3
- Version: 0.6.6
3
+ Version: 0.6.7
4
4
  Summary: mini-framework
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: curl-cffi>=0.12.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "zenx"
3
- version = "0.6.6"
3
+ version = "0.6.7"
4
4
  description = "mini-framework"
5
5
  requires-python = ">=3.12"
6
6
  dependencies = [
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
  import time
3
+ import functools
3
4
  from collections import deque
4
5
  import parsel
5
6
  import random
@@ -13,7 +14,7 @@ import json
13
14
  from structlog import BoundLogger
14
15
 
15
16
  from zenx.settings import Settings
16
- from zenx.utils import get_time, record_request
17
+ from zenx.utils import get_time
17
18
 
18
19
 
19
20
  @dataclass
@@ -34,6 +35,16 @@ class Response:
34
35
  return sel
35
36
 
36
37
 
38
+ def record_request(func):
39
+ @functools.wraps(func)
40
+ async def wrapper(self: HttpClient, *args, **kwargs) -> Response:
41
+ result = await func(self, *args, **kwargs)
42
+ self._requests_timestamps.append(time.time())
43
+ self._total_requests +=1
44
+ return result
45
+ return wrapper
46
+
47
+
37
48
  class HttpClient(ABC):
38
49
  # central registry
39
50
  name: ClassVar[str]
@@ -2,8 +2,6 @@ import time
2
2
  from typing import Dict
3
3
  import functools
4
4
 
5
- from zenx.clients.http import HttpClient, Response
6
-
7
5
 
8
6
  def get_time() -> int:
9
7
  """ current unix time in milliseconds """
@@ -20,12 +18,3 @@ def log_processing_time(func):
20
18
  return result
21
19
  return wrapper
22
20
 
23
-
24
- def record_request(func):
25
- @functools.wraps(func)
26
- async def wrapper(self: HttpClient, *args, **kwargs) -> Response:
27
- result = await func(self, *args, **kwargs)
28
- self._requests_timestamps.append(time.time())
29
- self._total_requests +=1
30
- return result
31
- return wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zenx
3
- Version: 0.6.6
3
+ Version: 0.6.7
4
4
  Summary: mini-framework
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: curl-cffi>=0.12.0
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
File without changes
File without changes
File without changes
File without changes
File without changes