hmr 0.4.3__py3-none-any.whl → 0.5.1__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.
- {hmr-0.4.3.dist-info → hmr-0.5.1.dist-info}/METADATA +1 -1
- hmr-0.5.1.dist-info/RECORD +14 -0
- reactivity/functional.py +1 -1
- reactivity/helpers.py +2 -2
- reactivity/hmr/core.py +11 -11
- reactivity/hmr/utils.py +4 -0
- reactivity/primitives.py +2 -0
- hmr-0.4.3.dist-info/RECORD +0 -14
- {hmr-0.4.3.dist-info → hmr-0.5.1.dist-info}/WHEEL +0 -0
- {hmr-0.4.3.dist-info → hmr-0.5.1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
hmr-0.5.1.dist-info/METADATA,sha256=ad1Eq5-t1QdaHg5SI1N_CIvz_ADraD8FCvPtj5Xvek8,258
|
2
|
+
hmr-0.5.1.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
hmr-0.5.1.dist-info/entry_points.txt,sha256=g_T0uJ43WgsdG14kkkdaBQuIL0HO-m1qvtjXMP6d060,59
|
4
|
+
reactivity/__init__.py,sha256=pX-RUzkezCC1x4eOWGxNhXbwrbvBLP_3pQuZr9eZz1Y,300
|
5
|
+
reactivity/functional.py,sha256=jJLEq88w5ag2cXuD1T118uEjnEg37_mqvWmFkb47KVY,1300
|
6
|
+
reactivity/helpers.py,sha256=rcrCXy1mmlei-if_BN4nSgS2IG9kBj-jq1YRwEfcITo,5329
|
7
|
+
reactivity/hmr/__init__.py,sha256=S5ZIHqCRpevdzWuhS0aCua_S8F0LkK0YNg6IgeTScFQ,177
|
8
|
+
reactivity/hmr/__main__.py,sha256=uIcyjR5gMFIXH_3hS0B3SD00RirVf7GIct-uItx675o,64
|
9
|
+
reactivity/hmr/api.py,sha256=Esb1fYiBW0SLxQ0MPXby25ZgIIZhIp-M3b2KiqpffmU,2094
|
10
|
+
reactivity/hmr/core.py,sha256=BHtkX5b3MAu-dxiMMuAn-8F6JnTkKZSNbEew7Wk59bc,11571
|
11
|
+
reactivity/hmr/hooks.py,sha256=jIFpe4CNxfaS9RcR4OIodx_sOZlnJ_IA1T1RtHPXhwU,945
|
12
|
+
reactivity/hmr/utils.py,sha256=h9m7iRXlvsLTrHoXV9gEVbhz3XsPK4KgnStYoCAWE5I,1616
|
13
|
+
reactivity/primitives.py,sha256=QkiUF8bqLZtyXguWwNJi34HJIc-SzUKqi1M9UgTNuvI,5952
|
14
|
+
hmr-0.5.1.dist-info/RECORD,,
|
reactivity/functional.py
CHANGED
reactivity/helpers.py
CHANGED
@@ -99,8 +99,8 @@ class Reactive[K, V](Subscribable, MutableMapping[K, V]):
|
|
99
99
|
|
100
100
|
def __setitem__(self, key: K, value: V):
|
101
101
|
with Batch(force_flush=False):
|
102
|
-
self._signals[key].set(value)
|
103
|
-
|
102
|
+
if self._signals[key].set(value):
|
103
|
+
self.notify()
|
104
104
|
|
105
105
|
def __delitem__(self, key: K):
|
106
106
|
state = self._signals[key]
|
reactivity/hmr/core.py
CHANGED
@@ -19,17 +19,17 @@ from ..primitives import BaseDerived, Derived, Signal
|
|
19
19
|
from .hooks import call_post_reload_hooks, call_pre_reload_hooks
|
20
20
|
|
21
21
|
|
22
|
-
def
|
23
|
-
|
24
|
-
assert frame is not None
|
22
|
+
def is_called_internally(*, extra_depth=0) -> bool:
|
23
|
+
"""Protect private methods from being called from outside this package."""
|
25
24
|
|
26
|
-
frame =
|
25
|
+
frame = currentframe() # this function
|
27
26
|
assert frame is not None
|
28
27
|
|
29
|
-
|
30
|
-
|
28
|
+
for _ in range(extra_depth + 2):
|
29
|
+
frame = frame.f_back
|
30
|
+
assert frame is not None
|
31
31
|
|
32
|
-
return frame.f_globals.get("
|
32
|
+
return frame.f_globals.get("__package__") == __package__
|
33
33
|
|
34
34
|
|
35
35
|
class Name(Signal, BaseDerived):
|
@@ -83,7 +83,7 @@ class ReactiveModule(ModuleType):
|
|
83
83
|
|
84
84
|
@property
|
85
85
|
def file(self):
|
86
|
-
if
|
86
|
+
if is_called_internally(extra_depth=1): # + 1 for `__getattribute__`
|
87
87
|
return self.__file
|
88
88
|
raise AttributeError("file")
|
89
89
|
|
@@ -106,7 +106,7 @@ class ReactiveModule(ModuleType):
|
|
106
106
|
|
107
107
|
@property
|
108
108
|
def load(self):
|
109
|
-
if
|
109
|
+
if is_called_internally(extra_depth=1): # + 1 for `__getattribute__`
|
110
110
|
return self.__load
|
111
111
|
raise AttributeError("load")
|
112
112
|
|
@@ -127,7 +127,7 @@ class ReactiveModule(ModuleType):
|
|
127
127
|
raise AttributeError(*e.args) from e
|
128
128
|
|
129
129
|
def __setattr__(self, name: str, value):
|
130
|
-
if
|
130
|
+
if is_called_internally():
|
131
131
|
return super().__setattr__(name, value)
|
132
132
|
self.__namespace_proxy[name] = value
|
133
133
|
|
@@ -338,4 +338,4 @@ def cli():
|
|
338
338
|
SyncReloader(entry).keep_watching_until_interrupt()
|
339
339
|
|
340
340
|
|
341
|
-
__version__ = "0.
|
341
|
+
__version__ = "0.5.1"
|
reactivity/hmr/utils.py
CHANGED
reactivity/primitives.py
CHANGED
hmr-0.4.3.dist-info/RECORD
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
hmr-0.4.3.dist-info/METADATA,sha256=gJvXslME9Vjx3o-BtCThGvA0a77QQ9ozUehjgosaY0I,258
|
2
|
-
hmr-0.4.3.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
-
hmr-0.4.3.dist-info/entry_points.txt,sha256=g_T0uJ43WgsdG14kkkdaBQuIL0HO-m1qvtjXMP6d060,59
|
4
|
-
reactivity/__init__.py,sha256=pX-RUzkezCC1x4eOWGxNhXbwrbvBLP_3pQuZr9eZz1Y,300
|
5
|
-
reactivity/functional.py,sha256=U06vshcVhZ0sb218gcmHtEhfgTNAGtQ7zyvPz2w5qKM,1292
|
6
|
-
reactivity/helpers.py,sha256=DVwhsEEs9aRcsyMqTdF5eRG-Z0zVhS7AbmR-Y-PXCkg,5321
|
7
|
-
reactivity/hmr/__init__.py,sha256=S5ZIHqCRpevdzWuhS0aCua_S8F0LkK0YNg6IgeTScFQ,177
|
8
|
-
reactivity/hmr/__main__.py,sha256=uIcyjR5gMFIXH_3hS0B3SD00RirVf7GIct-uItx675o,64
|
9
|
-
reactivity/hmr/api.py,sha256=Esb1fYiBW0SLxQ0MPXby25ZgIIZhIp-M3b2KiqpffmU,2094
|
10
|
-
reactivity/hmr/core.py,sha256=97pqCf5wt0YOb5vAi4I1z9qagKXMEy_xQvL6LW9DHmI,11498
|
11
|
-
reactivity/hmr/hooks.py,sha256=jIFpe4CNxfaS9RcR4OIodx_sOZlnJ_IA1T1RtHPXhwU,945
|
12
|
-
reactivity/hmr/utils.py,sha256=-PO-LMP4sc3IP-Bn_baq2w9IFWBZ3zGesgRn5wR6bS0,1555
|
13
|
-
reactivity/primitives.py,sha256=sPuIRi3pnAV7wV42rqD0j07HNkz4Bk4VxJWhdYToeZE,5907
|
14
|
-
hmr-0.4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|