wizlib 0.2.6__py3-none-any.whl → 0.3.0__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.
Potentially problematic release.
This version of wizlib might be problematic. Click here for more details.
wizlib/super_wrapper.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Provide a decorator to wrap a method so that it's called within the inherited
|
|
2
|
+
# version of that method.
|
|
3
|
+
#
|
|
4
|
+
# Example of use:
|
|
5
|
+
#
|
|
6
|
+
# class Parent(SuperWrapper):
|
|
7
|
+
# def execute(self, method, *args, **kwargs):
|
|
8
|
+
# print(f"Parent execute before")
|
|
9
|
+
# method(self, *args, **kwargs)
|
|
10
|
+
# print(f"Parent execute after")
|
|
11
|
+
#
|
|
12
|
+
# class InBetween(Parent):
|
|
13
|
+
# @Parent.wrap
|
|
14
|
+
# def execute(self, method, *args, **kwargs):
|
|
15
|
+
# print(f"IB execute before")
|
|
16
|
+
# method(self, *args, **kwargs)
|
|
17
|
+
# print(f"IB execute after")
|
|
18
|
+
#
|
|
19
|
+
# class NewChild(InBetween):
|
|
20
|
+
# @InBetween.wrap
|
|
21
|
+
# def execute(self, name):
|
|
22
|
+
# print(f"Hello {name}")
|
|
23
|
+
#
|
|
24
|
+
# c = NewChild()
|
|
25
|
+
# c.execute("Jane")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SuperWrapper:
|
|
29
|
+
@classmethod
|
|
30
|
+
def wrap(parent_class, method):
|
|
31
|
+
def wrapper(self, *args, **kwargs):
|
|
32
|
+
parent_method = getattr(parent_class, method.__name__)
|
|
33
|
+
return parent_method(self, method, *args, **kwargs)
|
|
34
|
+
return wrapper
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
wizlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
wizlib/rlinput.py,sha256=rKe91RPuRjQhfu9NEziik7EHre-RNjeoZcAgiInfDJ0,1626
|
|
3
|
+
wizlib/super_wrapper.py,sha256=qWR94tCUXRrdTmoxWwMPSx3BWM1sTPq0lENftFm6bf4,973
|
|
4
|
+
wizlib-0.3.0.dist-info/METADATA,sha256=iVYYn1v4NP3V3lukuFzRUjGh1dSww8m-6IsDtt6bMJY,1886
|
|
5
|
+
wizlib-0.3.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
6
|
+
wizlib-0.3.0.dist-info/top_level.txt,sha256=PhxyT43KqCsarAe-YroORUZRMTLA-zwTAaADXKjNcB4,7
|
|
7
|
+
wizlib-0.3.0.dist-info/RECORD,,
|
wizlib-0.2.6.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
wizlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
wizlib/rlinput.py,sha256=rKe91RPuRjQhfu9NEziik7EHre-RNjeoZcAgiInfDJ0,1626
|
|
3
|
-
wizlib-0.2.6.dist-info/METADATA,sha256=ZRbsvigt0pBeuQjKUsDfg56HiTAkIIsXtfBZjn99URE,1886
|
|
4
|
-
wizlib-0.2.6.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
5
|
-
wizlib-0.2.6.dist-info/top_level.txt,sha256=PhxyT43KqCsarAe-YroORUZRMTLA-zwTAaADXKjNcB4,7
|
|
6
|
-
wizlib-0.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|