Enforced variable types
This commit is contained in:
@ -7,9 +7,9 @@ from PIL.ImageFile import ImageFile
|
||||
|
||||
class Post:
|
||||
def __init__(self, id: int, image_dir: int, image_id: str, tags: list[str]):
|
||||
self.id: int = id
|
||||
self.image_dir: int = image_dir
|
||||
self.image_id: str = image_id
|
||||
self.id: int = int(id)
|
||||
self.image_dir: int = int(image_dir)
|
||||
self.image_id: str = str(image_id)
|
||||
self.tags: list[str] = tags.copy()
|
||||
self.thumbnail_data: bytes = scraper.get(f"https://wimg.rule34.xxx/thumbnails/{self.image_dir}/thumbnail_{self.image_id}.jpg")
|
||||
self.thumbnail: ImageFile = Image.open(BytesIO(self.thumbnail_data))
|
||||
|
||||
@ -34,7 +34,7 @@ class ViewTags:
|
||||
|
||||
class View:
|
||||
def __init__(self, id: int):
|
||||
self.id = id
|
||||
self.id = int(id)
|
||||
self._image_data: bytes | None = None
|
||||
self._image: ImageFile | None = None
|
||||
self._image_url: ImageURL | None = None
|
||||
|
||||
Reference in New Issue
Block a user