|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | import os |
2 | 4 | import tomllib |
3 | 5 | from enum import IntEnum, auto |
@@ -67,39 +69,39 @@ def is_ocr(self): |
67 | 69 | """ |
68 | 70 | return bool(self.texts) |
69 | 71 |
|
70 | | - def get_delay_time(self, default: "AutoSplit | int"): |
| 72 | + def get_delay_time(self, default: AutoSplit | int): |
71 | 73 | """Get image's delay time or fallback to the default value from spinbox.""" |
72 | 74 | if self.__delay_time is not None: |
73 | 75 | return self.__delay_time |
74 | 76 | if isinstance(default, int): |
75 | 77 | return default |
76 | 78 | return default.settings_dict["default_delay_time"] |
77 | 79 |
|
78 | | - def __get_comparison_method_index(self, default: "AutoSplit | int"): |
| 80 | + def __get_comparison_method_index(self, default: AutoSplit | int): |
79 | 81 | """Get image's comparison or fallback to the default value from combobox.""" |
80 | 82 | if self.__comparison_method is not None: |
81 | 83 | return self.__comparison_method |
82 | 84 | if isinstance(default, int): |
83 | 85 | return default |
84 | 86 | return default.settings_dict["default_comparison_method"] |
85 | 87 |
|
86 | | - def get_pause_time(self, default: "AutoSplit | float"): |
| 88 | + def get_pause_time(self, default: AutoSplit | float): |
87 | 89 | """Get image's pause time or fallback to the default value from spinbox.""" |
88 | 90 | if self.__pause_time is not None: |
89 | 91 | return self.__pause_time |
90 | 92 | if isinstance(default, (float, int)): |
91 | 93 | return default |
92 | 94 | return default.settings_dict["default_pause_time"] |
93 | 95 |
|
94 | | - def get_similarity_threshold(self, default: "AutoSplit | float"): |
| 96 | + def get_similarity_threshold(self, default: AutoSplit | float): |
95 | 97 | """Get image's similarity threshold or fallback to the default value from spinbox.""" |
96 | 98 | if self.__similarity_threshold is not None: |
97 | 99 | return self.__similarity_threshold |
98 | 100 | if isinstance(default, (float, int)): |
99 | 101 | return default |
100 | 102 | return default.settings_dict["default_similarity_threshold"] |
101 | 103 |
|
102 | | - def get_fps_limit(self, default: "AutoSplit"): |
| 104 | + def get_fps_limit(self, default: AutoSplit): |
103 | 105 | """Get image's fps limit or fallback to the default value from spinbox.""" |
104 | 106 | if self.__fps_limit != 0: |
105 | 107 | return self.__fps_limit |
@@ -197,7 +199,7 @@ def __read_image_bytes(self, path: str): |
197 | 199 | def check_flag(self, flag: int): |
198 | 200 | return self.flags & flag == flag |
199 | 201 |
|
200 | | - def compare_with_capture(self, default: "AutoSplit | int", capture: MatLike | None): |
| 202 | + def compare_with_capture(self, default: AutoSplit | int, capture: MatLike | None): |
201 | 203 | """ |
202 | 204 | Compare image with capture using image's comparison method. Falls back to combobox. |
203 | 205 |
|
|
0 commit comments