add types and decouple packs functions from flask

This commit is contained in:
Kentai Radiquum 2025-05-14 23:49:01 +05:00
parent ee133e9111
commit f4d15c5eaf
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
7 changed files with 174 additions and 48 deletions

21
src/type/file.py Normal file
View file

@ -0,0 +1,21 @@
import json
class ModFile:
def __init__(
self, version: str, hashes: dict[str, str], url: str, filename: str, size: int
):
self.version = version
self.hashes = hashes
self.url = url
self.filename = filename
self.size = size
def json(self):
return {
"version": self.version,
"hashes": self.hashes,
"url": self.url,
"filename": self.filename,
"size": self.size,
}