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