mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 01:21:11 +00:00
chore: improve rhci_progress typing, remove mutable arguments
This commit is contained in:
parent
c6b46d75cb
commit
b25520cf18
|
@ -1,13 +1,20 @@
|
||||||
from typing import Callable, List, Union
|
from typing import Callable, List, Optional, Union
|
||||||
|
|
||||||
from rich.console import ConsoleRenderable, Group, RichCast
|
from rich.console import ConsoleRenderable, Group, RichCast
|
||||||
from rich.progress import Progress
|
from rich.progress import Progress
|
||||||
|
|
||||||
|
|
||||||
class CustomProgress(Progress):
|
class CustomProgress(Progress):
|
||||||
def __init__(self, *args, cust_objs=[], cust_callables: List[Callable] = [], **kwargs) -> None:
|
def __init__(
|
||||||
self._cust_objs = cust_objs
|
self,
|
||||||
self._cust_callables = cust_callables
|
*args,
|
||||||
|
cust_objs: Optional[List[ConsoleRenderable]] = None,
|
||||||
|
cust_callables: Optional[List[Callable[[], ConsoleRenderable]]] = None,
|
||||||
|
**kwargs,
|
||||||
|
) -> None:
|
||||||
|
self._cust_objs = cust_objs or []
|
||||||
|
self._cust_callables = cust_callables or []
|
||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
def get_renderable(self) -> Union[ConsoleRenderable, RichCast, str]:
|
def get_renderable(self) -> Union[ConsoleRenderable, RichCast, str]:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user