autonomous-app 0.2.21__tar.gz → 0.2.23__tar.gz
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_app-0.2.21 → autonomous_app-0.2.23}/PKG-INFO +1 -1
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/__init__.py +1 -1
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/imagestorage.py +49 -8
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous_app.egg-info/PKG-INFO +1 -1
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/LICENSE +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/README.md +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/pyproject.toml +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/requirements.txt +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/setup.cfg +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/setup.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/ai/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/ai/oaiagent.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/auth/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/auth/autoauth.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/auth/github.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/auth/google.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/auth/user.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/cli.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/db/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/db/autodb.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/db/table.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/errors/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/errors/danglingreferenceerror.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/logger.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/model/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/model/autoattribute.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/model/automodel.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/model/orm.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/model/serializer.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/localstorage.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/markdown.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/version_control/GHCallbacks.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/version_control/GHOrganization.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/version_control/GHRepo.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/version_control/GHVersionControl.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/version_control/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/tasks/__init__.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/tasks/autotask.py +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous_app.egg-info/SOURCES.txt +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous_app.egg-info/dependency_links.txt +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous_app.egg-info/requires.txt +0 -0
- {autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous_app.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: autonomous-app
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.23
|
|
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,3 +1,4 @@
|
|
|
1
|
+
import glob
|
|
1
2
|
import io
|
|
2
3
|
import os
|
|
3
4
|
import shutil
|
|
@@ -14,6 +15,12 @@ class ImageStorage:
|
|
|
14
15
|
def __init__(self, path="static/images"):
|
|
15
16
|
self.base_path = path
|
|
16
17
|
|
|
18
|
+
def scan_storage(self, path=None):
|
|
19
|
+
for root, dirs, files in os.walk(path or self.base_path):
|
|
20
|
+
for file in files:
|
|
21
|
+
if file == "orig.webp":
|
|
22
|
+
yield os.path.join(root, file)
|
|
23
|
+
|
|
17
24
|
@classmethod
|
|
18
25
|
def _get_key(cls, folder="", pkey=None):
|
|
19
26
|
if folder and not folder.endswith("/"):
|
|
@@ -68,10 +75,10 @@ class ImageStorage:
|
|
|
68
75
|
if not asset_id:
|
|
69
76
|
return ""
|
|
70
77
|
original_path = f"{self.get_path(asset_id)}"
|
|
71
|
-
# log(f"Getting image: {asset_id}
|
|
78
|
+
# log(f"Getting image: {asset_id}", original_path)
|
|
72
79
|
if not os.path.exists(original_path):
|
|
73
80
|
log(f"Original image not found: {original_path}")
|
|
74
|
-
return
|
|
81
|
+
return None
|
|
75
82
|
file_path = f"{original_path}/{size}.webp"
|
|
76
83
|
# log(file_path)
|
|
77
84
|
result_url = f"/{file_path}"
|
|
@@ -108,10 +115,7 @@ class ImageStorage:
|
|
|
108
115
|
|
|
109
116
|
def get_path(self, asset_id):
|
|
110
117
|
if asset_id:
|
|
111
|
-
|
|
112
|
-
if asset_path.endswith("/"):
|
|
113
|
-
asset_path = asset_path[:-1]
|
|
114
|
-
return os.path.join(self.base_path, f"{asset_path}")
|
|
118
|
+
return os.path.join(self.base_path, f"{asset_id}")
|
|
115
119
|
else:
|
|
116
120
|
return self.base_path
|
|
117
121
|
|
|
@@ -128,8 +132,45 @@ class ImageStorage:
|
|
|
128
132
|
return imgs
|
|
129
133
|
|
|
130
134
|
def remove(self, asset_id):
|
|
135
|
+
if not asset_id:
|
|
136
|
+
return False
|
|
137
|
+
file_path = self.get_path(asset_id)
|
|
138
|
+
if os.path.isdir(file_path):
|
|
139
|
+
print(f"Removing {file_path}")
|
|
140
|
+
# return shutil.rmtree(file_path, ignore_errors=True)
|
|
141
|
+
return False
|
|
142
|
+
|
|
143
|
+
def clear_cached(self, asset_id):
|
|
131
144
|
file_path = self.get_path(asset_id)
|
|
132
145
|
if os.path.isdir(file_path):
|
|
133
|
-
|
|
134
|
-
|
|
146
|
+
for file in glob.glob(os.path.join(file_path, "*")):
|
|
147
|
+
if os.path.basename(file) != "orig.webp":
|
|
148
|
+
os.remove(file)
|
|
149
|
+
return False
|
|
150
|
+
|
|
151
|
+
def rotate(self, asset_id, amount=-90):
|
|
152
|
+
file_path = self.get_path(asset_id)
|
|
153
|
+
log(asset_id)
|
|
154
|
+
with Image.open(f"{file_path}/orig.webp") as img:
|
|
155
|
+
# Rotate the image 90 degrees
|
|
156
|
+
rotated_img = img.rotate(amount, expand=True)
|
|
157
|
+
# Save the rotated image
|
|
158
|
+
log(img, rotated_img)
|
|
159
|
+
# img = img.copy()
|
|
160
|
+
# img_byte_arr = io.BytesIO()
|
|
161
|
+
# img.save(img_byte_arr, )
|
|
162
|
+
self.clear_cached(asset_id)
|
|
163
|
+
rotated_img.save(f"{file_path}/orig.webp", format="WEBP")
|
|
164
|
+
return False
|
|
165
|
+
|
|
166
|
+
def flip(self, asset_id, flipx=True, flipy=True):
|
|
167
|
+
file_path = self.get_path(asset_id)
|
|
168
|
+
with Image.open(f"{file_path}/orig.webp") as img:
|
|
169
|
+
if flipx:
|
|
170
|
+
rotated_img = img.transpose(Image.FLIP_LEFT_RIGHT)
|
|
171
|
+
if flipy:
|
|
172
|
+
rotated_img = img.transpose(Image.FLIP_TOP_BOTTOM)
|
|
173
|
+
# Save the rotated image
|
|
174
|
+
rotated_img.save(f"{file_path}/orig.webp", format="WEBP")
|
|
175
|
+
self.clear_cached(asset_id)
|
|
135
176
|
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.23
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/errors/danglingreferenceerror.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/version_control/GHRepo.py
RENAMED
|
File without changes
|
|
File without changes
|
{autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous/storage/version_control/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{autonomous_app-0.2.21 → autonomous_app-0.2.23}/src/autonomous_app.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|