setdoc 0.1.4__tar.gz → 1.1.0__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.
- setdoc-1.1.0/MANIFEST.in +1 -0
- {setdoc-0.1.4/src/setdoc.egg-info → setdoc-1.1.0}/PKG-INFO +2 -2
- {setdoc-0.1.4 → setdoc-1.1.0}/pyproject.toml +2 -2
- setdoc-1.1.0/src/setdoc/core/__init__.py +40 -0
- setdoc-1.1.0/src/setdoc/core/cfg.toml +41 -0
- {setdoc-0.1.4 → setdoc-1.1.0/src/setdoc.egg-info}/PKG-INFO +2 -2
- {setdoc-0.1.4 → setdoc-1.1.0}/src/setdoc.egg-info/SOURCES.txt +2 -1
- setdoc-0.1.4/MANIFEST.in +0 -0
- setdoc-0.1.4/src/setdoc/core.py +0 -19
- {setdoc-0.1.4 → setdoc-1.1.0}/LICENSE.txt +0 -0
- {setdoc-0.1.4 → setdoc-1.1.0}/README.rst +0 -0
- {setdoc-0.1.4 → setdoc-1.1.0}/setup.cfg +0 -0
- {setdoc-0.1.4 → setdoc-1.1.0}/src/setdoc/__init__.py +0 -0
- {setdoc-0.1.4 → setdoc-1.1.0}/src/setdoc/tests/__init__.py +0 -0
- {setdoc-0.1.4 → setdoc-1.1.0}/src/setdoc/tests/test_core.py +0 -0
- {setdoc-0.1.4 → setdoc-1.1.0}/src/setdoc.egg-info/dependency_links.txt +0 -0
- {setdoc-0.1.4 → setdoc-1.1.0}/src/setdoc.egg-info/top_level.txt +0 -0
setdoc-1.1.0/MANIFEST.in
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include src/setdoc *.toml
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: setdoc
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: This project helps to set the doc string.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/setdoc/#files
|
|
|
28
28
|
Project-URL: Index, https://pypi.org/project/setdoc/
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/setdoc/
|
|
30
30
|
Project-URL: Website, https://setdoc.johannes-programming.online/
|
|
31
|
-
Classifier: Development Status ::
|
|
31
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
32
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
33
|
Classifier: Natural Language :: English
|
|
34
34
|
Classifier: Operating System :: OS Independent
|
|
@@ -9,7 +9,7 @@ authors = [
|
|
|
9
9
|
{ email = "johannes.programming@gmail.com", name = "Johannes" },
|
|
10
10
|
]
|
|
11
11
|
classifiers = [
|
|
12
|
-
"Development Status ::
|
|
12
|
+
"Development Status :: 5 - Production/Stable",
|
|
13
13
|
"License :: OSI Approved :: MIT License",
|
|
14
14
|
"Natural Language :: English",
|
|
15
15
|
"Operating System :: OS Independent",
|
|
@@ -24,7 +24,7 @@ keywords = []
|
|
|
24
24
|
name = "setdoc"
|
|
25
25
|
readme = "README.rst"
|
|
26
26
|
requires-python = ">=3.11"
|
|
27
|
-
version = "
|
|
27
|
+
version = "1.1.0"
|
|
28
28
|
|
|
29
29
|
[project.license]
|
|
30
30
|
file = "LICENSE.txt"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import dataclasses
|
|
2
|
+
import enum
|
|
3
|
+
import functools
|
|
4
|
+
import tomllib
|
|
5
|
+
from importlib import resources
|
|
6
|
+
from typing import *
|
|
7
|
+
|
|
8
|
+
__all__ = ["SetDoc", "setdoc", "basic"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Util(enum.Enum):
|
|
12
|
+
util = None
|
|
13
|
+
|
|
14
|
+
@functools.cached_property
|
|
15
|
+
def data(self: Self) -> dict:
|
|
16
|
+
"This cached property holds the cfg data."
|
|
17
|
+
text: str = resources.read_text("setdoc.core", "cfg.toml")
|
|
18
|
+
ans: dict = tomllib.loads(text)
|
|
19
|
+
return ans
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclasses.dataclass
|
|
23
|
+
class SetDoc:
|
|
24
|
+
"This class helps to set doc strings."
|
|
25
|
+
|
|
26
|
+
doc: Any
|
|
27
|
+
|
|
28
|
+
def __call__(self: Self, target: Any) -> Any:
|
|
29
|
+
"This magic method implements calling the current instance. It sets the doc string of the passed target to the value stored in the doc field of the setdoc object."
|
|
30
|
+
target.__doc__ = self.doc
|
|
31
|
+
return target
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
setdoc = SetDoc # legacy
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def basic(value: Any) -> Any:
|
|
38
|
+
"This decorator sets the docstring of the given value to what is suggested by its name."
|
|
39
|
+
value.__doc__ = Util.util.data["basic"][value.__name__]
|
|
40
|
+
return value
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[basic]
|
|
2
|
+
__add__ = "This magic method implements self+other."
|
|
3
|
+
__and__ = "This magic method implements self&other."
|
|
4
|
+
__divmod__ = "This magic method implements divmod(self, other)."
|
|
5
|
+
__eq__ = "This magic method implements self==other."
|
|
6
|
+
__floordiv__ = "This magic method implements self//other."
|
|
7
|
+
__ge__ = "This magic method implements self>=other."
|
|
8
|
+
__gt__ = "This magic method implements self>other."
|
|
9
|
+
__int__ = "This magic method implements int(self)."
|
|
10
|
+
__le__ = "This magic method implements self<=other."
|
|
11
|
+
__len__ = "This magic method implements len(self)."
|
|
12
|
+
__lshift__ = "This magic method implements self<<other."
|
|
13
|
+
__lt__ = "This magic method implements self<other."
|
|
14
|
+
__matmul__ = "This magic method implements self@other."
|
|
15
|
+
__mod__ = "This magic method implements self%other."
|
|
16
|
+
__mul__ = "This magic method implements self*other."
|
|
17
|
+
__ne__ = "This magic method implements self!=other."
|
|
18
|
+
__neg__ = "This magic method implements -self."
|
|
19
|
+
__or__ = "This magic method implements self|other."
|
|
20
|
+
__pos__ = "This magic method implements +self."
|
|
21
|
+
__pow__ = "This magic method implements self**other."
|
|
22
|
+
__radd__ = "This magic method implements other+self."
|
|
23
|
+
__rand__ = "This magic method implements other&self."
|
|
24
|
+
__rdivmod__ = "This magic method implements divmod(other, self)."
|
|
25
|
+
__repr__ = "This magic method implements repr(self)."
|
|
26
|
+
__rfloordiv__ = "This magic method implements other//self."
|
|
27
|
+
__rlshift__ = "This magic method implements other<<self."
|
|
28
|
+
__rmatmul__ = "This magic method implements other@self."
|
|
29
|
+
__rmod__ = "This magic method implements other%self."
|
|
30
|
+
__rmul__ = "This magic method implements other*self."
|
|
31
|
+
__ror__ = "This magic method implements other|self."
|
|
32
|
+
__rpow__ = "This magic method implements other**self."
|
|
33
|
+
__rrshift__ = "This magic method implements other>>self."
|
|
34
|
+
__rshift__ = "This magic method implements self>>other."
|
|
35
|
+
__rsub__ = "This magic method implements other-self."
|
|
36
|
+
__rtruediv__ = "This magic method implements other/self."
|
|
37
|
+
__rxor__ = "This magic method implements other^self."
|
|
38
|
+
__str__ = "This magic method implements str(self)."
|
|
39
|
+
__sub__ = "This magic method implements self-other."
|
|
40
|
+
__truediv__ = "This magic method implements self/other."
|
|
41
|
+
__xor__ = "This magic method implements self^other."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: setdoc
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: This project helps to set the doc string.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/setdoc/#files
|
|
|
28
28
|
Project-URL: Index, https://pypi.org/project/setdoc/
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/setdoc/
|
|
30
30
|
Project-URL: Website, https://setdoc.johannes-programming.online/
|
|
31
|
-
Classifier: Development Status ::
|
|
31
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
32
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
33
|
Classifier: Natural Language :: English
|
|
34
34
|
Classifier: Operating System :: OS Independent
|
|
@@ -4,10 +4,11 @@ README.rst
|
|
|
4
4
|
pyproject.toml
|
|
5
5
|
setup.cfg
|
|
6
6
|
src/setdoc/__init__.py
|
|
7
|
-
src/setdoc/core.py
|
|
8
7
|
src/setdoc.egg-info/PKG-INFO
|
|
9
8
|
src/setdoc.egg-info/SOURCES.txt
|
|
10
9
|
src/setdoc.egg-info/dependency_links.txt
|
|
11
10
|
src/setdoc.egg-info/top_level.txt
|
|
11
|
+
src/setdoc/core/__init__.py
|
|
12
|
+
src/setdoc/core/cfg.toml
|
|
12
13
|
src/setdoc/tests/__init__.py
|
|
13
14
|
src/setdoc/tests/test_core.py
|
setdoc-0.1.4/MANIFEST.in
DELETED
|
File without changes
|
setdoc-0.1.4/src/setdoc/core.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import dataclasses
|
|
2
|
-
from typing import *
|
|
3
|
-
|
|
4
|
-
__all__ = ["SetDoc", "setdoc"]
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclasses.dataclass
|
|
8
|
-
class SetDoc:
|
|
9
|
-
"This class helps to set doc strings."
|
|
10
|
-
|
|
11
|
-
doc: Any
|
|
12
|
-
|
|
13
|
-
def __call__(self: Self, target: Any) -> Any:
|
|
14
|
-
"This magic method implements calling the current instance. It sets the doc string of the passed target to the value stored in the doc field of the setdoc object."
|
|
15
|
-
target.__doc__ = self.doc
|
|
16
|
-
return target
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
setdoc = SetDoc
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|