mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Move logging logic to singleton
- Renamed module and class because "conductor" didn't make a lot of sense - Used singleton approach (there's only one stdout after all) - Redesigned progress bars (now with download speed!)
This commit is contained in:
@ -5,7 +5,6 @@ from rich.markup import escape
|
||||
|
||||
from .authenticator import Authenticator
|
||||
from .authenticators import AUTHENTICATORS
|
||||
from .conductor import TerminalConductor
|
||||
from .config import Config
|
||||
from .crawler import Crawler
|
||||
from .crawlers import CRAWLERS
|
||||
@ -18,7 +17,6 @@ class PferdLoadException(Exception):
|
||||
class Pferd:
|
||||
def __init__(self, config: Config):
|
||||
self._config = config
|
||||
self._conductor = TerminalConductor()
|
||||
self._authenticators: Dict[str, Authenticator] = {}
|
||||
self._crawlers: Dict[str, Crawler] = {}
|
||||
|
||||
@ -34,12 +32,7 @@ class Pferd:
|
||||
print(f"[red]Error: Unknown authenticator type {t}")
|
||||
continue
|
||||
|
||||
authenticator = authenticator_constructor(
|
||||
name,
|
||||
section,
|
||||
self._config,
|
||||
self._conductor,
|
||||
)
|
||||
authenticator = authenticator_constructor(name, section, self._config)
|
||||
self._authenticators[name] = authenticator
|
||||
|
||||
if abort:
|
||||
@ -57,13 +50,7 @@ class Pferd:
|
||||
print(f"[red]Error: Unknown crawler type {t}")
|
||||
continue
|
||||
|
||||
crawler = crawler_constructor(
|
||||
name,
|
||||
section,
|
||||
self._config,
|
||||
self._conductor,
|
||||
self._authenticators,
|
||||
)
|
||||
crawler = crawler_constructor(name, section, self._config, self._authenticators)
|
||||
self._crawlers[name] = crawler
|
||||
|
||||
if abort:
|
||||
|
Reference in New Issue
Block a user