Skip to content

Commit 175f65e

Browse files
committed
feat: bool to any
1 parent 2f619d3 commit 175f65e

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

Ui/Gui/Compilation/compiler.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(
6060
engine_id: str,
6161
context: BuildContext,
6262
engine_config: Optional[Dict[str, Any]] = None,
63-
is_rebuild: bool = False,
63+
is_rebuild: any = False,
6464
):
6565
"""
6666
Initialize the compilation thread.
@@ -180,7 +180,7 @@ def status(self) -> CompilationStatus:
180180
return self._status
181181

182182
@property
183-
def is_running(self) -> bool:
183+
def is_running(self) -> any:
184184
"""Return True when a compilation is currently running."""
185185
return self._status == CompilationStatus.RUNNING
186186

@@ -200,7 +200,7 @@ def compile(
200200
engine_id: Optional[str] = None,
201201
file_path: Optional[str] = None,
202202
workspace_dir: Optional[str] = None,
203-
) -> bool:
203+
) -> any:
204204
"""
205205
Legacy compile method. Use compile_from_context instead.
206206
"""
@@ -226,8 +226,8 @@ def compile_from_context(
226226
engine_id: str,
227227
context: BuildContext,
228228
engine_config: Optional[Dict[str, Any]] = None,
229-
is_rebuild: bool = False,
230-
) -> bool:
229+
is_rebuild: any = False,
230+
) -> any:
231231
"""
232232
Start an async compilation from a BuildContext.
233233
"""
@@ -272,7 +272,7 @@ def compile_from_context(
272272

273273
return True
274274

275-
def cancel(self) -> bool:
275+
def cancel(self) -> any:
276276
"""
277277
Cancel current compilation.
278278
"""

Ui/Gui/Compilation/helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def run_bcasl_before_compile(
6565
pass
6666
return
6767
try:
68-
log_i18n_level(
68+
log_i18n_level(
6969
gui_instance,
7070
"info",
7171
"Pré-compilation (BCASL) si activée...",
@@ -83,7 +83,7 @@ def run_bcasl_before_compile(
8383
pass
8484

8585

86-
def bcasl_report_allows_compile(gui_instance, report) -> bool:
86+
def bcasl_report_allows_compile(gui_instance, report) -> any:
8787
"""Return True when BCASL pre-compile report allows compilation to continue."""
8888
try:
8989
if report is None:
@@ -116,7 +116,7 @@ def bcasl_report_allows_compile(gui_instance, report) -> bool:
116116
if status in {"disabled", "skipped"}:
117117
return True
118118
if "ok" in report:
119-
ok = bool(report.get("ok"))
119+
ok = any(report.get("ok"))
120120
if not ok:
121121
log_i18n_level(
122122
gui_instance,
@@ -128,7 +128,7 @@ def bcasl_report_allows_compile(gui_instance, report) -> bool:
128128
return True
129129

130130
if hasattr(report, "ok"):
131-
ok = bool(getattr(report, "ok"))
131+
ok = any(getattr(report, "ok"))
132132
if not ok:
133133
log_i18n_level(
134134
gui_instance,

Ui/Gui/Compilation/mainprocess.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,21 @@ def current_engine(self) -> Optional[str]:
140140
return self._current_engine
141141

142142
@property
143-
def is_ready(self) -> bool:
143+
def is_ready(self) -> any:
144144
"""Return True when the process is ready."""
145145
return self._state in (ProcessState.READY, ProcessState.IDLE)
146146

147147
@property
148-
def is_compiling(self) -> bool:
148+
def is_compiling(self) -> any:
149149
"""Return True when a compilation is currently running."""
150150
return self._state == ProcessState.COMPILING
151151

152152
@property
153-
def is_idle(self) -> bool:
153+
def is_idle(self) -> any:
154154
"""Return True when the process is idle."""
155155
return self._state == ProcessState.IDLE
156156

157-
def set_workspace(self, workspace_dir: str) -> bool:
157+
def set_workspace(self, workspace_dir: str) -> any:
158158
"""
159159
Set workspace directory.
160160
@@ -180,7 +180,7 @@ def set_workspace(self, workspace_dir: str) -> bool:
180180

181181
return True
182182

183-
def set_file(self, file_path: str) -> bool:
183+
def set_file(self, file_path: str) -> any:
184184
"""
185185
Set file to compile.
186186
@@ -218,7 +218,7 @@ def compile(
218218
engine_id: Optional[str] = None,
219219
file_path: Optional[str] = None,
220220
workspace_dir: Optional[str] = None,
221-
) -> bool:
221+
) -> any:
222222
"""
223223
Start a compilation.
224224
@@ -296,7 +296,7 @@ def compile(
296296

297297
return success
298298

299-
def cancel(self) -> bool:
299+
def cancel(self) -> any:
300300
"""
301301
Cancel current compilation.
302302
@@ -385,8 +385,8 @@ def compile_from_context(
385385
engine_id: str,
386386
context: BuildContext,
387387
engine_config: Optional[Dict[str, Any]] = None,
388-
is_rebuild: bool = False,
389-
) -> bool:
388+
is_rebuild: any = False,
389+
) -> any:
390390
"""
391391
Start an async compilation from a :class:`BuildContext`.
392392
@@ -455,7 +455,7 @@ def get_exclusion_patterns(self) -> List[str]:
455455
pass
456456
return DEFAULT_EXCLUDE_PATTERNS
457457

458-
def should_exclude(self, file_path: str) -> bool:
458+
def should_exclude(self, file_path: str) -> any:
459459
"""
460460
Determine whether a file must be excluded from compilation.
461461

0 commit comments

Comments
 (0)