Skip to content

Commit d826357

Browse files
Merge pull request #6 from LouisJalouzot/main
Add the possibility to specify the rich console to use
2 parents 8b3fb5d + decbc7a commit d826357

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

joblib_progress/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Optional
33

44
import joblib
5+
from rich.console import Console
56
from rich.progress import (
67
BarColumn,
78
MofNCompleteColumn,
@@ -17,7 +18,11 @@
1718

1819

1920
@contextlib.contextmanager
20-
def joblib_progress(description: Optional[str] = None, total: Optional[int] = None):
21+
def joblib_progress(
22+
description: Optional[str] = None,
23+
total: Optional[int] = None,
24+
console: Optional[Console] = None,
25+
):
2126
if description is None:
2227
description = "Processing..."
2328

@@ -30,6 +35,7 @@ def joblib_progress(description: Optional[str] = None, total: Optional[int] = No
3035
TimeElapsedColumn(),
3136
"<",
3237
TimeRemainingColumn(),
38+
console=console,
3339
)
3440
task_id = progress.add_task(f"[cyan]{description}", total=total)
3541

0 commit comments

Comments
 (0)