Commit b62a20e7 authored by inkhey's avatar inkhey

fixing type for mypy

parent 3eefaab1
Pipeline #231833 failed with stage
in 1 minute and 13 seconds
......@@ -9,6 +9,11 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.770'
hooks:
- id: mypy
args: [--ignore-missing-imports]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
......
......@@ -28,7 +28,7 @@ class Layer(object):
self.name = name
def get_random_image(
self, chooser: Chooser = random, allow_no_alpha_layer: bool = False
self, chooser: Chooser = random.Random(), allow_no_alpha_layer: bool = False
) -> Image:
"""Get random image from layer based on current seed"""
assert self.variations_images_paths
......
from abc import ABC
from abc import abstractmethod
import hashlib
import typing
class Chooser(ABC):
class Chooser(typing.Protocol):
"""
Interface for chooser,
chooser does one thing: they choose in a sequence item according to a seed given
......@@ -21,7 +20,7 @@ class Chooser(ABC):
pass
class HashAlgorithm(ABC):
class HashAlgorithm(typing.Protocol):
"""Hash Algorithm Interface for HashLibChooser """
@abstractmethod
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment