Skip to content

Commit 0f33845

Browse files
authored
fix: correct bad log-levels
fixes #138
2 parents 9f5aa99 + c0951cf commit 0f33845

34 files changed

+19
-28
lines changed

resolve_proxy_encoder/app/checks.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ def check_worker_presence():
2222
"""Warn user if no celery workers are available"""
2323

2424
online_workers = celery_app.control.inspect().active_queues()
25-
26-
if not online_workers:
27-
28-
logger.warning(
29-
"[yellow]There are no workers currently online to process jobs!\n"
30-
"Make sure you start at least one."
31-
)
32-
3325
logger.debug(f"[magenta]Online workers:[/]\n{online_workers}")
3426
return online_workers
3527

@@ -105,7 +97,7 @@ def check_for_updates(github_url: str, package_name: str) -> Union[dict, None]:
10597
}
10698

10799

108-
def check_worker_compatability(online_workers):
100+
def check_worker_compatibility(online_workers):
109101

110102
if settings["app"]["disable_version_constrain"]:
111103
logger.warning(
@@ -115,7 +107,7 @@ def check_worker_compatability(online_workers):
115107
return
116108

117109
spinner = yaspin(
118-
text="Checking worker compatability...",
110+
text="Checking worker compatibility...",
119111
color="cyan",
120112
)
121113

@@ -124,12 +116,14 @@ def check_worker_compatability(online_workers):
124116

125117
spinner.fail("❌ ")
126118
logger.warning(
127-
"[yellow]No workers found. Can't check compatability.\n"
119+
"[yellow]No workers found. Can't check compatibility.\n"
128120
+ "Jobs may not be received if no compatible workers are available!\n[/]"
129121
+ "[red]CONTINUE AT OWN RISK![/]\n"
130122
)
131123

132-
if not Confirm.ask("[cyan]Do you wish to continue?[/]"):
124+
if not Confirm.ask(
125+
"[yellow]No workers found.[/] [cyan]Do you wish to continue?[/]"
126+
):
133127
core.app_exit(1, -1)
134128

135129
return

resolve_proxy_encoder/app/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def queue():
5858
DaVinci Resolve timeline
5959
"""
6060

61-
checks.check_worker_compatability(settings["online_workers"])
61+
checks.check_worker_compatibility(settings["online_workers"])
6262

6363
print("\n")
6464
console.rule(

resolve_proxy_encoder/app/utils/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def install_rich_tracebacks(show_locals=False):
3737
install(show_locals=show_locals)
3838

3939

40-
def app_exit(level: int = 0, timeout: int = -1, cleanup_funcs: list = []):
40+
def app_exit(level: int = 0, timeout: int = 0, cleanup_funcs: list = []):
4141

4242
"""
4343
Exit function to allow time to
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

resolve_proxy_encoder/queuer/link.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_proxy_path():
2828
f = Prompt.ask("Enter path to search for proxies")
2929
if f is None:
3030
print("User cancelled. Exiting.")
31-
exit(0)
31+
core.app_exit(0, 0)
3232
return f
3333

3434

resolve_proxy_encoder/queuer/queue.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ def main():
142142

143143
except Exception as e:
144144

145-
print("[red]Couldn't link jobs. Link manually:[/]")
146-
print(e)
145+
logger.error(f"[red]Couldn't link jobs. Link manually.[/]\nError: {e}")
147146
core.app_exit(1, -1)
148147

149148

resolve_proxy_encoder/queuer/resolve.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _populate_variables(self):
5656

5757
except:
5858

59-
logger.warning(
59+
logger.critical(
6060
"[red] :warning: Couldn't access the Resolve Python API. Is DaVinci Resolve running?[/]"
6161
)
6262
core.app_exit(1, -1)
@@ -69,7 +69,7 @@ def _populate_variables(self):
6969

7070
except:
7171

72-
logger.warning(
72+
logger.critical(
7373
"[red] :warning: Couldn't get current project. Is a project open in Resolve?[/]"
7474
)
7575
core.app_exit(1, -1)
@@ -81,7 +81,7 @@ def _populate_variables(self):
8181
raise TypeError
8282
except:
8383

84-
logger.warning(
84+
logger.critical(
8585
"[red] :warning: Couldn't get current timeline. Is a timeline open in Resolve?[/]"
8686
)
8787
core.app_exit(1, -1)
@@ -94,7 +94,7 @@ def _populate_variables(self):
9494

9595
except:
9696

97-
logger.warning("[red] :warning: Couldn't get Resolve's media pool.[/]")
97+
logger.critical("[red] :warning: Couldn't get Resolve's media pool.[/]")
9898
core.app_exit(1, -1)
9999

100100

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

resolve_proxy_encoder/settings/manager.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _ensure_user_file(self):
176176
except OSError:
177177

178178
self.spinner.fail("❌ ")
179-
logger.error("[red]Error creating directory![/]")
179+
logger.critical("[red]Error creating directory![/]")
180180
core.app_exit(1, -1)
181181

182182
try:
@@ -187,7 +187,7 @@ def _ensure_user_file(self):
187187
except:
188188

189189
self.spinner.fail("❌ ")
190-
print(
190+
logger.error(
191191
f"[red]Couldn't copy default settings to {self.user_file}![/]"
192192
)
193193
core.app_exit(1, -1)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

resolve_proxy_encoder/worker/ffmpeg/ffmpeg_process.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ def run(self, logfile):
136136
except KeyboardInterrupt:
137137
progress_bar.stop()
138138
process.kill()
139-
logger.warning(
140-
"[yellow][KeyboardInterrupt] FFmpeg process killed. Exiting...[/]"
141-
)
139+
print("[yellow][KeyboardInterrupt] FFmpeg process killed. Exiting...[/]")
142140
core.app_exit(0)
143141

144142
except Exception as e:

resolve_proxy_encoder/worker/launch_workers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_celery_binary_path():
9494
if celery_bin:
9595
return celery_bin
9696
logger.warning(
97-
"[yellow]Using Celery on path." + "Please ensure version compatability![/]"
97+
"[yellow]Using Celery on path." + "Please ensure version compatibility![/]"
9898
)
9999

100100
logger.error("[red]Couldn't find celery binary! Is it installed?[/]")
Binary file not shown.
Binary file not shown.
Binary file not shown.

resolve_proxy_encoder/worker/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_queue():
5151

5252
logger.warning(
5353
"[yellow]Version constrain is disabled!\n"
54-
"You [bold]must[/] ensure routing and version compatability yourself!"
54+
"You [bold]must[/] ensure routing and version compatibility yourself!"
5555
)
5656

5757
return "celery"

0 commit comments

Comments
 (0)