kenenet 1.2.4__py3-none-any.whl → 1.2.5__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 +16 -1
- {kenenet-1.2.4.dist-info → kenenet-1.2.5.dist-info}/METADATA +1 -1
- kenenet-1.2.5.dist-info/RECORD +5 -0
- kenenet-1.2.4.dist-info/RECORD +0 -5
- {kenenet-1.2.4.dist-info → kenenet-1.2.5.dist-info}/WHEEL +0 -0
- {kenenet-1.2.4.dist-info → kenenet-1.2.5.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import sys, zhmiscellany, keyboard, mss, time, linecache, os, random, pyperclip, inspect, re
|
1
|
+
import sys, zhmiscellany, keyboard, mss, time, linecache, os, random, pyperclip, inspect, re, ast
|
2
2
|
import numpy as np
|
3
3
|
from PIL import Image
|
4
4
|
from collections import defaultdict
|
@@ -557,6 +557,21 @@ def rgb_at_coord(coord=None, rgb=None, range=1):
|
|
557
557
|
|
558
558
|
rac = rgb_at_coord
|
559
559
|
|
560
|
+
def if_condition(s):
|
561
|
+
e = s.strip()[3:] if s.strip().startswith("if ") else s
|
562
|
+
tree = ast.parse(e, mode="eval").body
|
563
|
+
ctx = {**inspect.currentframe().f_back.f_globals, **inspect.currentframe().f_back.f_locals}
|
564
|
+
full = eval(compile(ast.Expression(tree), "<ast>", "eval"), ctx)
|
565
|
+
parts = tree.values if isinstance(tree, ast.BoolOp) and isinstance(tree.op, ast.And) else [tree]
|
566
|
+
out = []
|
567
|
+
for p in parts:
|
568
|
+
code = ast.unparse(p)
|
569
|
+
val = eval(compile(ast.Expression(p), "<ast>", "eval"), ctx)
|
570
|
+
out.append(f"'{code}': {val}")
|
571
|
+
quick_print(f"Overall: {str(full).upper()}, " + ", ".join(out))
|
572
|
+
|
573
|
+
if_cond = if_condition
|
574
|
+
|
560
575
|
class k:
|
561
576
|
pass
|
562
577
|
|
@@ -0,0 +1,5 @@
|
|
1
|
+
kenenet/__init__.py,sha256=gojKDAkm-H7AFGGc8d4guZSM25oIHP-V5cLDMZYjOMo,22910
|
2
|
+
kenenet-1.2.5.dist-info/METADATA,sha256=_5pplHx9bNTlk36KJv2Ke4QXrTNPHAmOFmxNZpmdnA0,1693
|
3
|
+
kenenet-1.2.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
kenenet-1.2.5.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
+
kenenet-1.2.5.dist-info/RECORD,,
|
kenenet-1.2.4.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=a0Phi1EQqUfDXbIA0OJeP3FK2YXBQ0Jc8VUSsrzotjc,22233
|
2
|
-
kenenet-1.2.4.dist-info/METADATA,sha256=a3sJyHW-aJ1fZy4YIilsfkHRJZQTNiMghVPqAgh5Fv0,1693
|
3
|
-
kenenet-1.2.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
kenenet-1.2.4.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-1.2.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|