From 923f696e24915acce2a335288604a59dfd74443c Mon Sep 17 00:00:00 2001 From: Faraphel Date: Sun, 14 Aug 2022 11:52:49 +0200 Subject: [PATCH] fixed 2 wrong type hint about layer --- source/mkw/Patch/PatchOperation/BmgTxtEditor/__init__.py | 3 +-- source/mkw/Patch/PatchOperation/ImageEditor/__init__.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/source/mkw/Patch/PatchOperation/BmgTxtEditor/__init__.py b/source/mkw/Patch/PatchOperation/BmgTxtEditor/__init__.py index 2d812de..e95381b 100644 --- a/source/mkw/Patch/PatchOperation/BmgTxtEditor/__init__.py +++ b/source/mkw/Patch/PatchOperation/BmgTxtEditor/__init__.py @@ -5,7 +5,6 @@ from abc import ABC, abstractmethod from source.mkw.Patch.PatchOperation import AbstractPatchOperation if TYPE_CHECKING: - from source.mkw.Patch.PatchOperation import Layer from source.mkw.Patch import Patch @@ -26,7 +25,7 @@ class AbstractLayer(ABC): """ @classmethod - def get(cls, layer: dict) -> "Layer": + def get(cls, layer: dict) -> "AbstractLayer": """ return the correct type of layer corresponding to the layer mode :param layer: the layer to load diff --git a/source/mkw/Patch/PatchOperation/ImageEditor/__init__.py b/source/mkw/Patch/PatchOperation/ImageEditor/__init__.py index 76cf584..56b703a 100644 --- a/source/mkw/Patch/PatchOperation/ImageEditor/__init__.py +++ b/source/mkw/Patch/PatchOperation/ImageEditor/__init__.py @@ -6,7 +6,6 @@ from PIL import Image from source.mkw.Patch.PatchOperation import AbstractPatchOperation if TYPE_CHECKING: - from source.mkw.Patch.PatchOperation import Layer from source.mkw.Patch import Patch @@ -68,7 +67,7 @@ class AbstractLayer(ABC): """ @classmethod - def get(cls, layer: dict) -> "Layer": + def get(cls, layer: dict) -> "AbstractLayer": """ return the correct type of layer corresponding to the layer mode :param layer: the layer to load @@ -87,7 +86,7 @@ class ImageGenerator(AbstractPatchOperation): type = "img-edit" def __init__(self, layers: list[dict]): - self.layers: list["Layer"] = [AbstractLayer.get(layer) for layer in layers] + self.layers: list["AbstractLayer"] = [AbstractLayer.get(layer) for layer in layers] def patch(self, patch: "Patch", file_name: str, file_content: IO) -> (str, IO): image = Image.open(file_content).convert("RGBA")