Full completed project

This commit is contained in:
2025-02-10 12:37:33 +00:00
commit b9abff8012
229 changed files with 16866 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
from PIL import Image
import io
from android.storage import app_storage_path
root_path = app_storage_path()
class profile():
def __init__(self):
pass
def username():
pass
def name(self, first_name=None, last_name=None):
if first_name:
self.first_name
if last_name:
self.last_name
if first_name and last_name:
pass
class image():
def __init__(self, post_id):
self.post_id = post_id
self.path = None
def load(self, image_bytes):
image_formats = ['png', 'jpg']
for form in image_formats:
try:
self.path = root_path + f"data/images/{self.post_id}.{form}"
with Image.open(io.BytesIO(image_bytes)) as recieved:
recieved.save(self.path)
print("saved image")
break
except:
print("cant save image")
self.path = None
def delete(self):
os.remove(self.path)