kenenet 1.2.7__py3-none-any.whl → 1.2.9__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
@@ -23,38 +23,37 @@ def quick_print(message, l=None):
23
23
  if l: sys.stdout.write(f"\033[38;2;0;255;26m{l} || {message}\033[0m\n")
24
24
  else: sys.stdout.write(f"\033[38;2;0;255;26m {message}\033[0m\n")
25
25
 
26
-
27
26
  def get_pos(timer=3.0, key='f7', timed_key='f8', kill=False):
28
27
  coord_rgb = []
29
28
  coords = []
30
-
31
- def _get_pos(key, kill=False):
32
- while True:
33
- pressed_key = keyboard.wait(key)
34
- if pressed_key == timed_key:
35
- quick_print(f"Pausing for {timer} seconds...")
36
- time.sleep(timer)
29
+ def _get_pos(x, y):
30
+ with mss.mss() as sct:
31
+ region = {"left": x, "top": y, "width": 1, "height": 1}
32
+ screenshot = sct.grab(region)
33
+ rgb = screenshot.pixel(0, 0)
34
+ color = f"\033[38;2;{rgb[0]};{rgb[1]};{rgb[2]}m"
35
+ reset = "\033[38;2;0;255;26m"
36
+ coord_rgb.append({'coord': (x,y), 'RGB': rgb})
37
+ coords.append((x,y))
38
+ pyperclip.copy(f'coords_rgb = {coord_rgb}\ncoords = {coords}')
39
+ quick_print(f"Added Coordinates: ({str(x).rjust(3)},{str(y).rjust(3)}), RGB: {str(rgb).ljust(15)} {color}████████{reset} to clipboard", lineno)
40
+ if kill:
41
+ quick_print('killing process')
42
+ zhmiscellany.misc.die()
37
43
 
38
- x, y = zhmiscellany.misc.get_mouse_xy()
39
- if timer:
40
- quick_print('')
41
- with mss.mss() as sct:
42
- region = {"left": x, "top": y, "width": 1, "height": 1}
43
- screenshot = sct.grab(region)
44
- rgb = screenshot.pixel(0, 0)
45
- color = f"\033[38;2;{rgb[0]};{rgb[1]};{rgb[2]}m"
46
- reset = "\033[38;2;0;255;26m"
47
- coord_rgb.append({'coord': (x, y), 'RGB': rgb})
48
- coords.append((x, y))
49
- pyperclip.copy(f'coords_rgb = {coord_rgb}\ncoords = {coords}')
50
- quick_print(f"Added Coordinates: ({str(x).rjust(3)},{str(y).rjust(3)}), RGB: {str(rgb).ljust(15)} {color}████████{reset} to clipboard", lineno)
51
- if kill:
52
- quick_print('killing process')
53
- zhmiscellany.misc.die()
44
+ def _non_timer():
45
+ x, y = zhmiscellany.misc.get_mouse_xy()
46
+ get_pos(x, y)
47
+
48
+ def _timer():
49
+ x, y = zhmiscellany.misc.get_mouse_xy()
50
+ quick_print(f'waiting {timer} seconds')
51
+ time.sleep(timer)
52
+ get_pos(x, y)
53
+
54
54
  quick_print(f'Press {key} for cursor info (or {timed_key} for a {timer}s wait before), automatically copies coords/rgb to clipboard')
55
- frame = inspect.currentframe().f_back
56
- lineno = frame.f_lineno
57
- _get_pos(key, kill)
55
+ keyboard.on_press_key('f7', lambda e: _non_timer())
56
+ keyboard.on_press_key('f8', lambda e: _timer())
58
57
 
59
58
  def timer(clock=1):
60
59
  if clock in timings:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kenenet
3
- Version: 1.2.7
3
+ Version: 1.2.9
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=bc6jOZtmL5gxwj1h2aghYhS4zxKQ8TcMwHeX27nG0Fk,23193
2
+ kenenet-1.2.9.dist-info/METADATA,sha256=qlWSkxSjMjSkKLOprOOfbKgiNxHM8DaWIZ09ReR-bRA,1693
3
+ kenenet-1.2.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
+ kenenet-1.2.9.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
5
+ kenenet-1.2.9.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- kenenet/__init__.py,sha256=z1g3XVeX5y1ycu0om4GZews1k0KyUM4y2afn4t_Zqdc,23292
2
- kenenet-1.2.7.dist-info/METADATA,sha256=Wq6xceqJx7-OEI6Y0n9i3j8a8WArK4yeZ4ZmbTqy5wY,1693
3
- kenenet-1.2.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
- kenenet-1.2.7.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
5
- kenenet-1.2.7.dist-info/RECORD,,