kenenet 0.2.8__py3-none-any.whl → 0.3.2__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 +21 -2
- {kenenet-0.2.8.dist-info → kenenet-0.3.2.dist-info}/METADATA +1 -1
- kenenet-0.3.2.dist-info/RECORD +5 -0
- kenenet-0.2.8.dist-info/RECORD +0 -5
- {kenenet-0.2.8.dist-info → kenenet-0.3.2.dist-info}/WHEEL +0 -0
- {kenenet-0.2.8.dist-info → kenenet-0.3.2.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
import inspect, sys, zhmiscellany, keyboard, mss, time, linecache, types
|
2
|
-
|
1
|
+
import inspect, sys, zhmiscellany, keyboard, mss, time, linecache, types, os
|
2
|
+
import numpy as np
|
3
|
+
from PIL import Image
|
4
|
+
global timings, ospid
|
5
|
+
ospid = None
|
3
6
|
timings = {}
|
4
7
|
|
5
8
|
def _quick_print(message, l=None):
|
@@ -119,6 +122,22 @@ def pp(msg='caca', subdir=None, pps=3):
|
|
119
122
|
_quick_print('PP finished B======D')
|
120
123
|
os.chdir(os_current)
|
121
124
|
|
125
|
+
def save_img(img, name='', file='temp_screenshots'):
|
126
|
+
global ospid
|
127
|
+
if ospid is None:
|
128
|
+
if os.path.exists(file): zhmiscellany.fileio.empty_directory(file)
|
129
|
+
else: zhmiscellany.fileio.create_folder(file)
|
130
|
+
ospid = True
|
131
|
+
frame = inspect.currentframe().f_back
|
132
|
+
lineno = frame.f_lineno
|
133
|
+
if isinstance(img, np.ndarray):
|
134
|
+
save_name = name + f'{time.time()}'
|
135
|
+
img = Image.fromarray(img)
|
136
|
+
img.save(f'{file}/{save_name}.png')
|
137
|
+
_quick_print(f'Saved image as {save_name}', lineno)
|
138
|
+
else:
|
139
|
+
_quick_print(f"Your img is not a fucking numpy array you twat, couldn't save {name}", lineno)
|
140
|
+
|
122
141
|
class k:
|
123
142
|
pass
|
124
143
|
|
@@ -0,0 +1,5 @@
|
|
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,,
|
kenenet-0.2.8.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=x8fsWkCUPf-ci1rtSiXD_Rcy8-eKqFK4RQ9_1zM2V2Y,4991
|
2
|
-
kenenet-0.2.8.dist-info/METADATA,sha256=ofjGHLi9dOwBaOU7WfNtm-pMVURVddeoAOmLC66v1uI,513
|
3
|
-
kenenet-0.2.8.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
4
|
-
kenenet-0.2.8.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-0.2.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|