autonomous-app 0.2.20__py3-none-any.whl → 0.2.22__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.
- autonomous/__init__.py +1 -1
- autonomous/model/automodel.py +0 -3
- autonomous/model/serializer.py +1 -1
- autonomous/storage/imagestorage.py +37 -2
- {autonomous_app-0.2.20.dist-info → autonomous_app-0.2.22.dist-info}/METADATA +1 -1
- {autonomous_app-0.2.20.dist-info → autonomous_app-0.2.22.dist-info}/RECORD +9 -9
- {autonomous_app-0.2.20.dist-info → autonomous_app-0.2.22.dist-info}/WHEEL +1 -1
- {autonomous_app-0.2.20.dist-info → autonomous_app-0.2.22.dist-info}/LICENSE +0 -0
- {autonomous_app-0.2.20.dist-info → autonomous_app-0.2.22.dist-info}/top_level.txt +0 -0
autonomous/__init__.py
CHANGED
autonomous/model/automodel.py
CHANGED
|
@@ -141,7 +141,6 @@ class AutoModel(ABC):
|
|
|
141
141
|
except DanglingReferenceError as e:
|
|
142
142
|
log(e)
|
|
143
143
|
super().__setattr__(name, None)
|
|
144
|
-
self.save()
|
|
145
144
|
return None
|
|
146
145
|
else:
|
|
147
146
|
super().__setattr__(name, result)
|
|
@@ -161,7 +160,6 @@ class AutoModel(ABC):
|
|
|
161
160
|
if scrubbed:
|
|
162
161
|
super().__setattr__(name, results)
|
|
163
162
|
obj = results
|
|
164
|
-
self.save()
|
|
165
163
|
|
|
166
164
|
elif isinstance(obj, dict):
|
|
167
165
|
results = {}
|
|
@@ -178,7 +176,6 @@ class AutoModel(ABC):
|
|
|
178
176
|
if scrubbed:
|
|
179
177
|
super().__setattr__(name, results)
|
|
180
178
|
obj = results
|
|
181
|
-
self.save()
|
|
182
179
|
return obj
|
|
183
180
|
|
|
184
181
|
def __str__(self) -> str:
|
autonomous/model/serializer.py
CHANGED
|
@@ -52,7 +52,7 @@ class AutoEncoder:
|
|
|
52
52
|
o,
|
|
53
53
|
"The above object was not been saved. You must save subobjects if you want them to persist.",
|
|
54
54
|
)
|
|
55
|
-
raise ValueError("Cannot encode unsaved
|
|
55
|
+
raise ValueError(f"Cannot encode unsaved {o.model_name(qualified=True)}")
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
class AutoDecoder:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import glob
|
|
1
2
|
import io
|
|
2
3
|
import os
|
|
3
4
|
import shutil
|
|
@@ -130,6 +131,40 @@ class ImageStorage:
|
|
|
130
131
|
def remove(self, asset_id):
|
|
131
132
|
file_path = self.get_path(asset_id)
|
|
132
133
|
if os.path.isdir(file_path):
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
os.rmdir(file_path)
|
|
135
|
+
return False
|
|
136
|
+
|
|
137
|
+
def clear_cached(self, asset_id):
|
|
138
|
+
file_path = self.get_path(asset_id)
|
|
139
|
+
if os.path.isdir(file_path):
|
|
140
|
+
for file in glob.glob(os.path.join(file_path, "*")):
|
|
141
|
+
if os.path.basename(file) != "orig.webp":
|
|
142
|
+
os.remove(file)
|
|
143
|
+
return False
|
|
144
|
+
|
|
145
|
+
def rotate(self, asset_id, amount=-90):
|
|
146
|
+
file_path = self.get_path(asset_id)
|
|
147
|
+
log(asset_id)
|
|
148
|
+
with Image.open(f"{file_path}/orig.webp") as img:
|
|
149
|
+
# Rotate the image 90 degrees
|
|
150
|
+
rotated_img = img.rotate(amount, expand=True)
|
|
151
|
+
# Save the rotated image
|
|
152
|
+
log(img, rotated_img)
|
|
153
|
+
# img = img.copy()
|
|
154
|
+
# img_byte_arr = io.BytesIO()
|
|
155
|
+
# img.save(img_byte_arr, )
|
|
156
|
+
self.clear_cached(asset_id)
|
|
157
|
+
rotated_img.save(f"{file_path}/orig.webp", format="WEBP")
|
|
158
|
+
return False
|
|
159
|
+
|
|
160
|
+
def flip(self, asset_id, flipx=True, flipy=True):
|
|
161
|
+
file_path = self.get_path(asset_id)
|
|
162
|
+
with Image.open(f"{file_path}/orig.webp") as img:
|
|
163
|
+
if flipx:
|
|
164
|
+
rotated_img = img.transpose(Image.FLIP_LEFT_RIGHT)
|
|
165
|
+
if flipy:
|
|
166
|
+
rotated_img = img.transpose(Image.FLIP_TOP_BOTTOM)
|
|
167
|
+
# Save the rotated image
|
|
168
|
+
rotated_img.save(f"{file_path}/orig.webp", format="WEBP")
|
|
169
|
+
self.clear_cached(asset_id)
|
|
135
170
|
return False
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: autonomous-app
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.22
|
|
4
4
|
Summary: Containerized application framework built on Flask with additional libraries and tools for rapid development of web applications.
|
|
5
5
|
Author-email: Steven A Moore <samoore@binghamton.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
autonomous/__init__.py,sha256=
|
|
1
|
+
autonomous/__init__.py,sha256=9ulnRfkifMh508zMo0ZotnJ6X_YN3YLiqajC2MbKRF4,87
|
|
2
2
|
autonomous/cli.py,sha256=z4AaGeWNW_uBLFAHng0J_lfS9v3fXemK1PeT85u4Eo4,42
|
|
3
3
|
autonomous/logger.py,sha256=jePQ4kTtECTwGtIcDmpLSE6rSwhaUEiQe2vK06h5XIg,1915
|
|
4
4
|
autonomous/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -15,11 +15,11 @@ autonomous/errors/__init__.py,sha256=OruWG9IkAF4LN-OAo5c2K9Dnds4oZFJJQHKaXbQaWnA
|
|
|
15
15
|
autonomous/errors/danglingreferenceerror.py,sha256=obfNjpn2vsyK4ak-UuuwFTMVzecs1SaeFPshOvnukS8,275
|
|
16
16
|
autonomous/model/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
17
17
|
autonomous/model/autoattribute.py,sha256=q09cORKC6-LpoZ3Ez-lRkd5kxuSFQrB2nA2f9_8k2c8,588
|
|
18
|
-
autonomous/model/automodel.py,sha256
|
|
18
|
+
autonomous/model/automodel.py,sha256=-YXzE6Pacxao3bu6_ItivRxryd-YLbd-F9_TRaStIwk,12672
|
|
19
19
|
autonomous/model/orm.py,sha256=IJrbp15RmBgF61vLsqcS_VdnAnw9736sLW75_xFYE9Y,2521
|
|
20
|
-
autonomous/model/serializer.py,sha256=
|
|
20
|
+
autonomous/model/serializer.py,sha256=ixJ5LZ0sicv49WIaPKSzNX0IFy0InlHYv9X-uG8Pi5Y,3048
|
|
21
21
|
autonomous/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
-
autonomous/storage/imagestorage.py,sha256=
|
|
22
|
+
autonomous/storage/imagestorage.py,sha256=jR1abLTNcrS02OYXAomsMkL-MIQuWbPXjPxHOAc628M,6040
|
|
23
23
|
autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2MPpwE,2286
|
|
24
24
|
autonomous/storage/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
|
|
25
25
|
autonomous/storage/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
|
|
@@ -29,8 +29,8 @@ autonomous/storage/version_control/GHVersionControl.py,sha256=VIhVRxe6gJgozFWyhy
|
|
|
29
29
|
autonomous/storage/version_control/__init__.py,sha256=tP0bAWYl1RwBRi62HsIidmgyqHuSlCUqwGuKUKKRugc,117
|
|
30
30
|
autonomous/tasks/__init__.py,sha256=pn7iZ14MhcHUdzcLkfkd4-45wgPP0tXahAz_cFgb_Tg,32
|
|
31
31
|
autonomous/tasks/autotask.py,sha256=_WQ8w1LyV2FVJ0Ct0FoF9q1W8ClXfS57-omnBb0LNWE,4910
|
|
32
|
-
autonomous_app-0.2.
|
|
33
|
-
autonomous_app-0.2.
|
|
34
|
-
autonomous_app-0.2.
|
|
35
|
-
autonomous_app-0.2.
|
|
36
|
-
autonomous_app-0.2.
|
|
32
|
+
autonomous_app-0.2.22.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
|
|
33
|
+
autonomous_app-0.2.22.dist-info/METADATA,sha256=lMjolFoTDRAgacf8CERHgFgH95Nwpl0z2X42Gz3Nsz4,4229
|
|
34
|
+
autonomous_app-0.2.22.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
|
35
|
+
autonomous_app-0.2.22.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
|
|
36
|
+
autonomous_app-0.2.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|