kenenet 0.3.2__py3-none-any.whl → 0.3.3__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 +26 -20
- {kenenet-0.3.2.dist-info → kenenet-0.3.3.dist-info}/METADATA +1 -1
- kenenet-0.3.3.dist-info/RECORD +5 -0
- kenenet-0.3.2.dist-info/RECORD +0 -5
- {kenenet-0.3.2.dist-info → kenenet-0.3.3.dist-info}/WHEEL +0 -0
- {kenenet-0.3.2.dist-info → kenenet-0.3.3.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -5,7 +5,7 @@ global timings, ospid
|
|
5
5
|
ospid = None
|
6
6
|
timings = {}
|
7
7
|
|
8
|
-
def
|
8
|
+
def quick_print(message, l=None):
|
9
9
|
if l: sys.stdout.write(f"\033[38;2;0;255;26m{l} || {message}\033[0m\n")
|
10
10
|
else: sys.stdout.write(f"\033[38;2;0;255;26m {message}\033[0m\n")
|
11
11
|
|
@@ -21,9 +21,9 @@ def get_pos(key='f10', kill=False):
|
|
21
21
|
rgb = screenshot.pixel(0, 0)
|
22
22
|
color = f"\033[38;2;{rgb[0]};{rgb[1]};{rgb[2]}m"
|
23
23
|
reset = "\033[0m"
|
24
|
-
|
24
|
+
quick_print(f"Coordinates: ({x}, {y}), RGB: {rgb} {color}████████{reset}", lineno)
|
25
25
|
if kill:
|
26
|
-
|
26
|
+
quick_print('killing process')
|
27
27
|
zhmiscellany.misc.die()
|
28
28
|
frame = inspect.currentframe().f_back
|
29
29
|
lineno = frame.f_lineno
|
@@ -34,8 +34,9 @@ def timer(clock=1):
|
|
34
34
|
elapsed = time.time() - timings[clock]
|
35
35
|
frame = inspect.currentframe().f_back
|
36
36
|
lineno = frame.f_lineno
|
37
|
-
|
37
|
+
quick_print(f'Timer {clock} took \033[97m{elapsed}\033[0m seconds', lineno)
|
38
38
|
del timings[clock]
|
39
|
+
return elapsed
|
39
40
|
else:
|
40
41
|
timings[clock] = time.time()
|
41
42
|
|
@@ -57,11 +58,11 @@ def make_trace_function(ignore_special_vars=True, ignore_functions=True, ignore_
|
|
57
58
|
return trace_lines
|
58
59
|
|
59
60
|
header = f"Executing line {lineno}:" if ignore_file_path else f"Executing {filename}:{lineno}:"
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
quick_print("=" * 60)
|
62
|
+
quick_print(header, lineno)
|
63
|
+
quick_print(f" {code_line}", lineno)
|
64
|
+
quick_print("-" * 60, lineno)
|
65
|
+
quick_print("Local Variables:", lineno)
|
65
66
|
|
66
67
|
for var, value in frame.f_locals.items():
|
67
68
|
if ignore_special_vars and var in special_vars:
|
@@ -73,11 +74,11 @@ def make_trace_function(ignore_special_vars=True, ignore_functions=True, ignore_
|
|
73
74
|
if ignore_classes and isinstance(value, type):
|
74
75
|
continue
|
75
76
|
try:
|
76
|
-
|
77
|
+
quick_print(f" {var} = {repr(value)}", lineno)
|
77
78
|
except (AttributeError, TypeError, Exception):
|
78
|
-
|
79
|
+
quick_print(f" {var} = [unreadable]", lineno)
|
79
80
|
|
80
|
-
|
81
|
+
quick_print("=" * 60, lineno)
|
81
82
|
|
82
83
|
return trace_lines
|
83
84
|
|
@@ -94,12 +95,12 @@ def activate_tracing(ignore_special_vars=True, ignore_functions=True, ignore_cla
|
|
94
95
|
)
|
95
96
|
sys.settrace(trace_func)
|
96
97
|
sys._getframe().f_trace = trace_func
|
97
|
-
|
98
|
+
quick_print("Tracing activated.")
|
98
99
|
|
99
100
|
|
100
101
|
def deactivate_tracing():
|
101
102
|
sys.settrace(None)
|
102
|
-
|
103
|
+
quick_print("Tracing deactivated.")
|
103
104
|
|
104
105
|
def pp(msg='caca', subdir=None, pps=3):
|
105
106
|
import os, subprocess
|
@@ -119,14 +120,19 @@ def pp(msg='caca', subdir=None, pps=3):
|
|
119
120
|
result = int(result.stdout.strip()) + 1
|
120
121
|
for i in range(pps):
|
121
122
|
push_pull(msg)
|
122
|
-
|
123
|
+
quick_print('PP finished B======D')
|
123
124
|
os.chdir(os_current)
|
124
125
|
|
125
|
-
def save_img(img, name='', file='temp_screenshots'):
|
126
|
+
def save_img(img, name='', reset=True, file='temp_screenshots'):
|
126
127
|
global ospid
|
127
128
|
if ospid is None:
|
128
|
-
if os.path.exists(file):
|
129
|
-
|
129
|
+
if os.path.exists(file):
|
130
|
+
if reset:
|
131
|
+
zhmiscellany.fileio.empty_directory(file)
|
132
|
+
quick_print(f'Cleaned folder {file}')
|
133
|
+
else:
|
134
|
+
quick_print(f'New folder created {file}')
|
135
|
+
zhmiscellany.fileio.create_folder(file)
|
130
136
|
ospid = True
|
131
137
|
frame = inspect.currentframe().f_back
|
132
138
|
lineno = frame.f_lineno
|
@@ -134,9 +140,9 @@ def save_img(img, name='', file='temp_screenshots'):
|
|
134
140
|
save_name = name + f'{time.time()}'
|
135
141
|
img = Image.fromarray(img)
|
136
142
|
img.save(f'{file}/{save_name}.png')
|
137
|
-
|
143
|
+
quick_print(f'Saved image as {save_name}', lineno)
|
138
144
|
else:
|
139
|
-
|
145
|
+
quick_print(f"Your img is not a fucking numpy array you twat, couldn't save {name}", lineno)
|
140
146
|
|
141
147
|
class k:
|
142
148
|
pass
|
@@ -0,0 +1,5 @@
|
|
1
|
+
kenenet/__init__.py,sha256=mh1DTHPUVh0xeqNA5W7-1jp84afONMmtT861ND8vna4,5897
|
2
|
+
kenenet-0.3.3.dist-info/METADATA,sha256=dQS4Hcqff-vLrAUu7Ql_FMjWETliqn_jH3nEKO-C4xU,513
|
3
|
+
kenenet-0.3.3.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
4
|
+
kenenet-0.3.3.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
+
kenenet-0.3.3.dist-info/RECORD,,
|
kenenet-0.3.2.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=AdvYkPtf7zKAmh_6qs_sXsanUCmV_RFaLtvzlJ6ddQ8,5715
|
2
|
-
kenenet-0.3.2.dist-info/METADATA,sha256=OGQnX4dPx2hFFO9wCYAiwJnrrU-IhNIBpY0s3UioIe4,513
|
3
|
-
kenenet-0.3.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
4
|
-
kenenet-0.3.2.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-0.3.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|