kenenet 0.6.9__py3-none-any.whl → 0.7.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 CHANGED
@@ -75,9 +75,7 @@ class _VariableTracker:
75
75
  except:
76
76
  return f"<{type(value).__name__} object>"
77
77
 
78
- def _print_change(self, name, old, new, scope="Global"):
79
- frame = inspect.currentframe().f_back
80
- lineno = frame.f_lineno
78
+ def _print_change(self, name, old, new, lineno, scope="Global"):
81
79
  quick_print(f"{scope} '{name}' changed from {self._format_value(old)} -> {self._format_value(new)}", lineno)
82
80
 
83
81
  def _should_track(self, name):
@@ -114,28 +112,31 @@ def _track_frame(frame, event, arg):
114
112
  scope = "Global" if frame.f_code.co_name == '<module>' else f"Local in '{frame.f_code.co_name}'"
115
113
  current_vars = {name: value for name, value in (frame.f_locals if scope != "Global" else frame.f_globals).items() if tracker._should_track(name)}
116
114
 
115
+ line_number = frame.f_lineno # Capture the line number where the change occurred
116
+
117
117
  if scope == "Global":
118
118
  for name, value in current_vars.items():
119
119
  if name not in tracker.global_vars:
120
- tracker.print_change(name, None, value, scope)
120
+ tracker._print_change(name, None, value, scope, line_number)
121
121
  elif tracker.global_vars[name] != value:
122
- tracker.print_change(name, tracker.global_vars[name], value, scope)
122
+ tracker._print_change(name, tracker.global_vars[name], value, scope, line_number)
123
123
  tracker.global_vars.update(current_vars)
124
124
  else:
125
125
  frame_id = id(frame)
126
126
  if frame_id not in tracker.frame_locals:
127
127
  for name, value in current_vars.items():
128
- tracker.print_change(name, None, value, scope)
128
+ tracker._print_change(name, None, value, scope, line_number)
129
129
  else:
130
130
  for name, value in current_vars.items():
131
131
  if name not in tracker.frame_locals[frame_id]:
132
- tracker.print_change(name, None, value, scope)
132
+ tracker._print_change(name, None, value, scope, line_number)
133
133
  elif tracker.frame_locals[frame_id][name] != value:
134
- tracker.print_change(name, tracker.frame_locals[frame_id][name], value, scope)
134
+ tracker._print_change(name, tracker.frame_locals[frame_id][name], value, scope, line_number)
135
135
  tracker.frame_locals[frame_id] = current_vars
136
136
  if event == 'return' and scope != "Global": del tracker.frame_locals[id(frame)]
137
137
  return _track_frame
138
138
 
139
+
139
140
  def debug():
140
141
  global debug_mode
141
142
  if not debug_mode:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kenenet
3
- Version: 0.6.9
3
+ Version: 0.7.1
4
4
  Summary: dude what the fuck even is this package
5
5
  Home-page: https://www.youtube.com/@KiddyKene
6
6
  Author: kiddykene
@@ -0,0 +1,5 @@
1
+ kenenet/__init__.py,sha256=4sqjI1TSHA3b69C4t5tLHDRzhhIoHz8UhF4ry-G2060,8558
2
+ kenenet-0.7.1.dist-info/METADATA,sha256=-kS_EK-E11nOO5Jo4WcOnvvD4b7GJA1Yk6YNRaqAKME,633
3
+ kenenet-0.7.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
+ kenenet-0.7.1.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
5
+ kenenet-0.7.1.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- kenenet/__init__.py,sha256=cf4lc2OJTzPKdWcEBtmwBSRDEBlEttM3iUZ0jGTrapg,8469
2
- kenenet-0.6.9.dist-info/METADATA,sha256=ZoR7Cl2wwfFBXhtsKpkRX1Ek5jSvzddmSxfClql6rgE,633
3
- kenenet-0.6.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
- kenenet-0.6.9.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
5
- kenenet-0.6.9.dist-info/RECORD,,