kenenet 0.5.9__py3-none-any.whl → 0.6.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.
- kenenet/__init__.py +10 -5
- {kenenet-0.5.9.dist-info → kenenet-0.6.1.dist-info}/METADATA +1 -1
- kenenet-0.6.1.dist-info/RECORD +5 -0
- kenenet-0.5.9.dist-info/RECORD +0 -5
- {kenenet-0.5.9.dist-info → kenenet-0.6.1.dist-info}/WHEEL +0 -0
- {kenenet-0.5.9.dist-info → kenenet-0.6.1.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -49,7 +49,7 @@ def timer(clock=1):
|
|
49
49
|
|
50
50
|
class _Config:
|
51
51
|
EXCLUDED_NAMES = {'Config', 'VariableTracker', 'track_variables', 'stop_tracking',
|
52
|
-
'track_frame', 'sys', 'inspect', 'types', 'datetime',
|
52
|
+
'track_frame', 'sys', 'inspect', 'types', 'datetime', 'quick_print',
|
53
53
|
'self', 'cls', 'args', 'kwargs', '__class__'}
|
54
54
|
EXCLUDED_FILES = {'<string>', '<frozen importlib', 'importlib', 'abc.py', 'typing.py', '_collections_abc.py'}
|
55
55
|
SHOW_TIMESTAMPS = True
|
@@ -76,8 +76,9 @@ class _VariableTracker:
|
|
76
76
|
return f"<{type(value).__name__} object>"
|
77
77
|
|
78
78
|
def _print_change(self, name, old, new, scope="Global"):
|
79
|
-
|
80
|
-
|
79
|
+
frame = inspect.currentframe().f_back.f_back
|
80
|
+
lineno = frame.f_lineno
|
81
|
+
quick_print(f"{scope} '{name}' changed from {self._format_value(old)} -> {self._format_value(new)}", lineno)
|
81
82
|
|
82
83
|
def _should_track(self, name):
|
83
84
|
return not (name.startswith('_') and name not in ('__name__', '__file__')) and name not in _Config.EXCLUDED_NAMES
|
@@ -88,7 +89,9 @@ class _VariableTracker:
|
|
88
89
|
self.global_vars = {name: value for name, value in module.__dict__.items() if self._should_track(name)}
|
89
90
|
sys.settrace(_track_frame)
|
90
91
|
self.active = True
|
91
|
-
|
92
|
+
frame = inspect.currentframe().f_back
|
93
|
+
lineno = frame.f_lineno.f_back
|
94
|
+
quick_print(f"Started debugging", lineno)
|
92
95
|
|
93
96
|
def _stop_tracking(self):
|
94
97
|
if not self.active: return
|
@@ -96,7 +99,9 @@ class _VariableTracker:
|
|
96
99
|
self.frame_locals.clear()
|
97
100
|
self.global_vars.clear()
|
98
101
|
self.active = False
|
99
|
-
|
102
|
+
frame = inspect.currentframe().f_back.f_back
|
103
|
+
lineno = frame.f_lineno
|
104
|
+
quick_print(f"Stopped debugging", lineno)
|
100
105
|
|
101
106
|
def _track_frame(frame, event, arg):
|
102
107
|
tracker = _VariableTracker._get_instance()
|
@@ -0,0 +1,5 @@
|
|
1
|
+
kenenet/__init__.py,sha256=gYN3D6fdTzr1huyeX9WljIOY_n538FhFA7aOrnkWPt4,8364
|
2
|
+
kenenet-0.6.1.dist-info/METADATA,sha256=jKBWLMpowcBEgWE90WkGkfJvM4qCHbzf2SV72dnoKws,633
|
3
|
+
kenenet-0.6.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
kenenet-0.6.1.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
+
kenenet-0.6.1.dist-info/RECORD,,
|
kenenet-0.5.9.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=6n3xWsFNz0VvjmrfTb-Jk477KCyN8ecla8f32gcUr2U,8306
|
2
|
-
kenenet-0.5.9.dist-info/METADATA,sha256=OK5Fwap_emuyXNCsD97-NHfqsLPQRR1okYo9v1P2YnY,633
|
3
|
-
kenenet-0.5.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
kenenet-0.5.9.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-0.5.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|