kenenet 0.1.5__py3-none-any.whl → 0.1.7__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 +23 -8
- {kenenet-0.1.5.dist-info → kenenet-0.1.7.dist-info}/METADATA +1 -1
- kenenet-0.1.7.dist-info/RECORD +5 -0
- kenenet-0.1.5.dist-info/RECORD +0 -5
- {kenenet-0.1.5.dist-info → kenenet-0.1.7.dist-info}/WHEEL +0 -0
- {kenenet-0.1.5.dist-info → kenenet-0.1.7.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -1,26 +1,41 @@
|
|
1
|
-
import inspect, sys, zhmiscellany, keyboard, mss
|
1
|
+
import inspect, sys, zhmiscellany, keyboard, mss, time, sys
|
2
2
|
|
3
|
-
global
|
3
|
+
global timings
|
4
|
+
timings = {}
|
4
5
|
def adding(a, b):
|
5
6
|
return a + b
|
6
7
|
|
8
|
+
def quick_print(message):
|
9
|
+
sys.stdout.write(f"\033[94m{message}\033[0m\n")
|
10
|
+
|
11
|
+
|
7
12
|
def get_pos(key='f10', kill=False):
|
8
13
|
def _get_pos(key):
|
9
14
|
while True:
|
10
15
|
keyboard.wait(key)
|
16
|
+
x, y = zhmiscellany.misc.get_mouse_xy()
|
11
17
|
with mss.mss() as sct:
|
12
|
-
x, y
|
13
|
-
|
14
|
-
|
15
|
-
rgb = screenshot.pixel(x - monitor["left"], y - monitor["top"])
|
18
|
+
region = {"left": x, "top": y, "width": 1, "height": 1}
|
19
|
+
screenshot = sct.grab(region)
|
20
|
+
rgb = screenshot.pixel(0, 0)
|
16
21
|
color = f"\033[38;2;{rgb[0]};{rgb[1]};{rgb[2]}m"
|
17
22
|
reset = "\033[0m"
|
18
|
-
|
23
|
+
quick_print(f"Coordinates: ({x}, {y}), RGB: {rgb} {color}████████{reset}")
|
19
24
|
if kill:
|
20
|
-
|
25
|
+
quick_print('killing process')
|
21
26
|
zhmiscellany.misc.die()
|
22
27
|
zhmiscellany.processing.start_daemon(target=_get_pos, args=(key,))
|
23
28
|
|
29
|
+
def time_it(clock=1):
|
30
|
+
if clock in timings:
|
31
|
+
elapsed = timings[clock] - time.time()
|
32
|
+
print()
|
33
|
+
else:
|
34
|
+
timings[clock] = time.time()
|
35
|
+
frame = inspect.currentframe().f_back
|
36
|
+
filename = frame.f_code.co_filename
|
37
|
+
lineno = frame.f_lineno
|
38
|
+
|
24
39
|
|
25
40
|
class k:
|
26
41
|
pass
|
@@ -0,0 +1,5 @@
|
|
1
|
+
kenenet/__init__.py,sha256=rdgrig3zBIlWkNeUHFqTTj97mnA6cptkt5vuZasQmbg,1534
|
2
|
+
kenenet-0.1.7.dist-info/METADATA,sha256=prdl-U3PvfKh1FH3lRHjQX9vANds8MaRxJKWYctAH7Y,513
|
3
|
+
kenenet-0.1.7.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
4
|
+
kenenet-0.1.7.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
+
kenenet-0.1.7.dist-info/RECORD,,
|
kenenet-0.1.5.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=76mfcNtSLA7WkY7_0TVGA7L55W2cndvKOw3hWP-I5F0,1254
|
2
|
-
kenenet-0.1.5.dist-info/METADATA,sha256=fB0NE9UjGJ5QgMJzHdtbq46jdvodpzIj_Ayq0CreYIw,513
|
3
|
-
kenenet-0.1.5.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
4
|
-
kenenet-0.1.5.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|