pyquoks 2.0.0__tar.gz → 2.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyquoks
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Пакет PyPI для часто используемых модулей в проектах diquoks
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.14
14
14
  Requires-Dist: blinker (==1.9.0)
15
15
  Requires-Dist: certifi (==2025.11.12)
16
16
  Requires-Dist: charset-normalizer (==3.4.4)
17
- Requires-Dist: click (==8.3.0)
17
+ Requires-Dist: click (==8.3.1)
18
18
  Requires-Dist: colorama (==0.4.6)
19
19
  Requires-Dist: flask (==3.1.2)
20
20
  Requires-Dist: idna (==3.11)
@@ -22,6 +22,7 @@ Requires-Dist: itsdangerous (==2.2.0)
22
22
  Requires-Dist: jinja2 (==3.1.6)
23
23
  Requires-Dist: markupsafe (==3.0.3)
24
24
  Requires-Dist: pillow (==12.0.0)
25
+ Requires-Dist: psutil (==7.1.3)
25
26
  Requires-Dist: requests (==2.32.5)
26
27
  Requires-Dist: urllib3 (==2.5.0)
27
28
  Requires-Dist: waitress (==3.0.2)
@@ -46,7 +47,6 @@ Description-Content-Type: text/markdown
46
47
 
47
48
  #### Связь с разработчиком
48
49
 
49
- - [План разработки pyquoks](https://www.icloud.com/notes/0e0C-Bm4IkqXuBYqJrq00yhog)
50
50
  - [Telegram для связи](https://t.me/diquoks)
51
51
  - [Почта для связи](mailto:diquoks@yandex.ru)
52
52
 
@@ -16,7 +16,6 @@
16
16
 
17
17
  #### Связь с разработчиком
18
18
 
19
- - [План разработки pyquoks](https://www.icloud.com/notes/0e0C-Bm4IkqXuBYqJrq00yhog)
20
19
  - [Telegram для связи](https://t.me/diquoks)
21
20
  - [Почта для связи](mailto:diquoks@yandex.ru)
22
21
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyquoks"
3
- version = "2.0.0"
3
+ version = "2.0.2"
4
4
  description = "Пакет PyPI для часто используемых модулей в проектах diquoks"
5
5
  authors = [
6
6
  { name = "Denis Titovets <den232titovets@yandex.ru>" }
@@ -12,7 +12,7 @@ dependencies = [
12
12
  "blinker (==1.9.0)",
13
13
  "certifi (==2025.11.12)",
14
14
  "charset-normalizer (==3.4.4)",
15
- "click (==8.3.0)",
15
+ "click (==8.3.1)",
16
16
  "colorama (==0.4.6)",
17
17
  "flask (==3.1.2)",
18
18
  "idna (==3.11)",
@@ -20,6 +20,7 @@ dependencies = [
20
20
  "jinja2 (==3.1.6)",
21
21
  "markupsafe (==3.0.3)",
22
22
  "pillow (==12.0.0)",
23
+ "psutil (==7.1.3)",
23
24
  "requests (==2.32.5)",
24
25
  "urllib3 (==2.5.0)",
25
26
  "waitress (==3.0.2)",
@@ -213,7 +213,8 @@ class StringsProvider(pyquoks.utils._HasRequiredAttributes):
213
213
  """
214
214
 
215
215
  # noinspection PyUnusedLocal
216
- def __init__(self, parent: StringsProvider) -> None: ... # TODO
216
+ def __init__(self, parent: StringsProvider) -> None:
217
+ ... # TODO
217
218
 
218
219
  _REQUIRED_ATTRIBUTES = {
219
220
  "_OBJECTS",
@@ -459,7 +460,7 @@ class DatabaseManager(pyquoks.utils._HasRequiredAttributes):
459
460
 
460
461
  _PATH: str = pyquoks.utils.get_path("db/")
461
462
 
462
- def __init__(self):
463
+ def __init__(self) -> None:
463
464
  self._check_attributes()
464
465
 
465
466
  os.makedirs(
@@ -1,5 +1,5 @@
1
1
  from __future__ import annotations
2
- import unittest, types
2
+ import unittest, typing, types
3
3
  import pyquoks.data, pyquoks.utils
4
4
 
5
5
 
@@ -60,6 +60,35 @@ class TestCase(unittest.TestCase, pyquoks.utils._HasRequiredAttributes):
60
60
  raise_again=True,
61
61
  )
62
62
 
63
+ def assert_raises(
64
+ self,
65
+ func_name: str,
66
+ test_func: typing.Callable,
67
+ test_exception: type[BaseException],
68
+ *args,
69
+ **kwargs,
70
+ ) -> None:
71
+ self._logger.info(
72
+ msg=(
73
+ f"{self._get_func_name(func_name)}:\n"
74
+ f"Function: {test_func.__name__}\n"
75
+ f"Exception: {test_exception.__name__}\n"
76
+ ),
77
+ )
78
+
79
+ try:
80
+ self.assertRaises(
81
+ test_exception,
82
+ test_func,
83
+ *args,
84
+ **kwargs,
85
+ )
86
+ except Exception as exception:
87
+ self._logger.log_error(
88
+ exception=exception,
89
+ raise_again=True,
90
+ )
91
+
63
92
  def assert_type(
64
93
  self,
65
94
  func_name: str,
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
- import sys, os
2
+ import datetime, sys, os
3
+ import psutil
3
4
 
4
5
 
5
6
  class _HasRequiredAttributes:
@@ -36,3 +37,15 @@ def get_path(relative_path: str, use_meipass: bool = False) -> str:
36
37
  base_path = os.path.abspath(".")
37
38
 
38
39
  return os.path.join(base_path, relative_path)
40
+
41
+
42
+ def get_started_datetime() -> datetime.datetime:
43
+ """
44
+ :return: Datetime when the current process was started
45
+ """
46
+
47
+ process = psutil.Process(os.getpid())
48
+
49
+ return datetime.datetime.fromtimestamp(
50
+ timestamp=process.create_time(),
51
+ )
File without changes
File without changes
File without changes