Jedutils 0.2.1__tar.gz → 0.2.2__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 (27) hide show
  1. {Jedutils-0.2.1 → Jedutils-0.2.2}/Jedutils.egg-info/PKG-INFO +1 -1
  2. {Jedutils-0.2.1 → Jedutils-0.2.2}/PKG-INFO +1 -1
  3. Jedutils-0.2.2/jedutils/__init__.py +3 -0
  4. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/asyncio/_async_redis_pipe.py +14 -0
  5. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/asyncio/network/_dl.py +1 -1
  6. Jedutils-0.2.1/jedutils/__init__.py +0 -3
  7. {Jedutils-0.2.1 → Jedutils-0.2.2}/Jedutils.egg-info/SOURCES.txt +0 -0
  8. {Jedutils-0.2.1 → Jedutils-0.2.2}/Jedutils.egg-info/dependency_links.txt +0 -0
  9. {Jedutils-0.2.1 → Jedutils-0.2.2}/Jedutils.egg-info/requires.txt +0 -0
  10. {Jedutils-0.2.1 → Jedutils-0.2.2}/Jedutils.egg-info/top_level.txt +0 -0
  11. {Jedutils-0.2.1 → Jedutils-0.2.2}/LICENSE +0 -0
  12. {Jedutils-0.2.1 → Jedutils-0.2.2}/MANIFEST.in +0 -0
  13. {Jedutils-0.2.1 → Jedutils-0.2.2}/README.md +0 -0
  14. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/asyncio/__init__.py +0 -0
  15. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/asyncio/_concurrency_manager.py +0 -0
  16. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/asyncio/_run_async.py +0 -0
  17. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/asyncio/_rwlock.py +0 -0
  18. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/asyncio/network/__init__.py +0 -0
  19. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/databases/__init__.py +0 -0
  20. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/databases/_in_memory.py +0 -0
  21. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/math/__init__.py +0 -0
  22. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/math/_number_formatter.py +0 -0
  23. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/strings/__init__.py +0 -0
  24. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/strings/_chunked_text.py +0 -0
  25. {Jedutils-0.2.1 → Jedutils-0.2.2}/jedutils/strings/_random_string.py +0 -0
  26. {Jedutils-0.2.1 → Jedutils-0.2.2}/setup.cfg +0 -0
  27. {Jedutils-0.2.1 → Jedutils-0.2.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Jedutils
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Jedutils is a Python utilities package that provides a collection of useful helper functions.
5
5
  Home-page: https://github.com/AYMENJD/jedutils
6
6
  Author: AYMEN Mohammed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Jedutils
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Jedutils is a Python utilities package that provides a collection of useful helper functions.
5
5
  Home-page: https://github.com/AYMENJD/jedutils
6
6
  Author: AYMEN Mohammed
@@ -0,0 +1,3 @@
1
+ __version__ = "0.2.2"
2
+ __copyright__ = "Copyright (c) 2023-2024 AYMEN Mohammed ~ https://github.com/AYMENJD"
3
+ __license__ = "MIT License"
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import logging
2
3
 
3
4
  try:
4
5
  from redis import Redis
@@ -28,6 +29,7 @@ class AsyncRedisPipe:
28
29
  pipe_max_size: int = 200,
29
30
  workers: int = 8,
30
31
  loop: asyncio.AbstractEventLoop = None,
32
+ debug: bool = False,
31
33
  ) -> None:
32
34
  """
33
35
  Args:
@@ -42,6 +44,9 @@ class AsyncRedisPipe:
42
44
 
43
45
  loop (:py:class:`asyncio.AbstractEventLoop`, *optional*):
44
46
  The event loop to use. Defaults to :py:class:`asyncio.get_event_loop()`.
47
+
48
+ debug (``bool``, *optional*):
49
+ Whether to enable debug logging. Defaults to ``False``.
45
50
  """
46
51
 
47
52
  if not Redis:
@@ -49,6 +54,9 @@ class AsyncRedisPipe:
49
54
 
50
55
  self.redis = redis
51
56
  self.pipe_max_size = pipe_max_size
57
+ self.debug = debug
58
+ self.logger = logging.getLogger(__name__)
59
+
52
60
  self.__queue = asyncio.Queue()
53
61
  self.__loop = (
54
62
  asyncio.get_event_loop()
@@ -83,6 +91,9 @@ class AsyncRedisPipe:
83
91
  except asyncio.QueueEmpty:
84
92
  break
85
93
  else:
94
+ if self.debug:
95
+ self.logger.debug(f"Executing command: {data[1]}")
96
+
86
97
  pipe.execute_command(*data[1])
87
98
  futures.append(data[0])
88
99
  count += 1
@@ -92,6 +103,9 @@ class AsyncRedisPipe:
92
103
  async def __handle_pipe_line(self, futures: list, pipe):
93
104
  results = await pipe.execute(False)
94
105
  for x, result in enumerate(results):
106
+ if self.debug:
107
+ self.logger.debug(f"Result: {result}")
108
+
95
109
  if isinstance(result, BaseException):
96
110
  futures[x].set_exception(result)
97
111
  else:
@@ -17,7 +17,7 @@ async def download_file(
17
17
  thread_pool=None,
18
18
  **kwargs,
19
19
  ) -> None:
20
- """
20
+ r"""
21
21
  Asynchronously download a file from the given URL and saves it to the specified filename using chunked downloading
22
22
 
23
23
  Example:
@@ -1,3 +0,0 @@
1
- __version__ = "0.2.1"
2
- __copyright__ = "Copyright (c) 2023 AYMEN Mohammed ~ https://github.com/AYMENJD"
3
- __license__ = "MIT License"
File without changes
File without changes
File without changes
File without changes
File without changes