dycw-utilities 0.129.3__py3-none-any.whl → 0.129.5__py3-none-any.whl

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,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.129.3
3
+ Version: 0.129.5
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=xvWWvcsivl7tOOnGKv9OKQ27M1f_gdDFBYwkYVERk-4,60
1
+ utilities/__init__.py,sha256=VYvwBtGYvSwQY0mv7POe3-AmpXnW7P3VB6J_-XdD9Vk,60
2
2
  utilities/altair.py,sha256=Gpja-flOo-Db0PIPJLJsgzAlXWoKUjPU1qY-DQ829ek,9156
3
3
  utilities/asyncio.py,sha256=3n5EIcSq2xtEF1i4oR0oY2JmBq3NyugeHKFK39Mt22s,37987
4
4
  utilities/atomicwrites.py,sha256=geFjn9Pwn-tTrtoGjDDxWli9NqbYfy3gGL6ZBctiqSo,5393
@@ -29,7 +29,7 @@ utilities/iterables.py,sha256=mDqw2_0MUVp-P8FklgcaVTi2TXduH0MxbhTDzzhSBho,44915
29
29
  utilities/jupyter.py,sha256=ft5JA7fBxXKzP-L9W8f2-wbF0QeYc_2uLQNFDVk4Z-M,2917
30
30
  utilities/libcst.py,sha256=Jto5ppzRzsxn4AD32IS8n0lbgLYXwsVJB6EY8giNZyY,4974
31
31
  utilities/lightweight_charts.py,sha256=0xNfcsrgFI0R9xL25LtSm-W5yhfBI93qQNT6HyaXAhg,2769
32
- utilities/logging.py,sha256=a99gX9oQUe_Oxs5rDtTwUVuOwhRyeO_GfoFNKVaEny0,25641
32
+ utilities/logging.py,sha256=hqV_KSX4itxwplxH8tTYx3IopF6M75SMnlQvTjfJBSM,24653
33
33
  utilities/loguru.py,sha256=MEMQVWrdECxk1e3FxGzmOf21vWT9j8CAir98SEXFKPA,3809
34
34
  utilities/luigi.py,sha256=fpH9MbxJDuo6-k9iCXRayFRtiVbUtibCJKugf7ygpv0,5988
35
35
  utilities/math.py,sha256=-mQgbah-dPJwOEWf3SonrFoVZ2AVxMgpeQ3dfVa-oJA,26764
@@ -89,7 +89,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
89
89
  utilities/whenever.py,sha256=jS31ZAY5OMxFxLja_Yo5Fidi87Pd-GoVZ7Vi_teqVDA,16743
90
90
  utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
91
91
  utilities/zoneinfo.py,sha256=-5j7IQ9nb7gR43rdgA7ms05im-XuqhAk9EJnQBXxCoQ,1874
92
- dycw_utilities-0.129.3.dist-info/METADATA,sha256=tSQGMjW1iN-3qoQebYNCtjnI6yzQARSXvw0ThdEKy2A,12803
93
- dycw_utilities-0.129.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
94
- dycw_utilities-0.129.3.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
95
- dycw_utilities-0.129.3.dist-info/RECORD,,
92
+ dycw_utilities-0.129.5.dist-info/METADATA,sha256=GBhDqoji8XSD0ML-I_7PBcUZMS3_zFhbIM3UXxUZ3CU,12803
93
+ dycw_utilities-0.129.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
94
+ dycw_utilities-0.129.5.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
95
+ dycw_utilities-0.129.5.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.129.3"
3
+ __version__ = "0.129.5"
utilities/logging.py CHANGED
@@ -23,7 +23,7 @@ from logging import (
23
23
  )
24
24
  from logging.handlers import BaseRotatingHandler, TimedRotatingFileHandler
25
25
  from pathlib import Path
26
- from re import Pattern, search
26
+ from re import Pattern
27
27
  from sys import stdout
28
28
  from time import time
29
29
  from typing import (
@@ -160,13 +160,11 @@ class SizeAndTimeRotatingFileHandler(BaseRotatingHandler):
160
160
  def _should_rollover(self, record: LogRecord, /) -> bool:
161
161
  if self._max_bytes is not None: # skipif-ci-and-windows
162
162
  try:
163
- current = self._filename.stat().st_size
163
+ size = self._filename.stat().st_size
164
164
  except FileNotFoundError:
165
165
  pass
166
166
  else:
167
- delta = len(f"{self.format(record)}\n")
168
- new = current + delta
169
- if new >= self._max_bytes:
167
+ if size >= self._max_bytes:
170
168
  return True
171
169
  return bool(self._time_handler.shouldRollover(record)) # skipif-ci-and-windows
172
170
 
@@ -751,29 +749,6 @@ class _AdvancedLogRecord(LogRecord):
751
749
  cls.time_zone = time_zone.key # skipif-ci-and-windows
752
750
  super().__init_subclass__(**kwargs) # skipif-ci-and-windows
753
751
 
754
- @override
755
- def getMessage(self) -> str:
756
- """Return the message for this LogRecord."""
757
- msg = str(self.msg) # pragma: no cover
758
- if self.args: # pragma: no cover
759
- try:
760
- return msg % self.args # compability for 3rd party code
761
- except ValueError as error:
762
- if len(error.args) == 0:
763
- raise
764
- first = error.args[0]
765
- if search("unsupported format character", first):
766
- return msg.format(*self.args)
767
- raise
768
- except TypeError as error:
769
- if len(error.args) == 0:
770
- raise
771
- first = error.args[0]
772
- if search("not all arguments converted", first):
773
- return msg.format(*self.args)
774
- raise
775
- return msg # pragma: no cover
776
-
777
752
  @classmethod
778
753
  def get_now(cls) -> Any:
779
754
  """Get the current zoned datetime."""