Skip to content

Commit

Permalink
refactor: Update configuration manager to support loading environment…
Browse files Browse the repository at this point in the history
… variables from a specified file (#80)
  • Loading branch information
MountainGod2 authored Nov 1, 2024
1 parent feb7018 commit 1aa29e2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/chaturbate_poller/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,23 @@ def setup() -> None: # pragma: no cover
@click.option(
"--token", default=lambda: ConfigManager().get("CB_TOKEN", ""), help="Chaturbate token."
)
@click.option("--timeout", default=10, help="Timeout for the API requests.")
@click.option("--version", is_flag=True, help="Show the version and exit.")
@click.option("--timeout", default=10, help="Timeout for the API requests.", show_default=True)
@click.option("--testbed", is_flag=True, help="Use the testbed environment.")
@click.option("--use-database", is_flag=True, help="Enable database integration.")
@click.option("--verbose", is_flag=True, help="Enable verbose logging.")
@click.version_option(version=__version__)
def start( # pylint: disable=too-many-arguments,too-many-positional-arguments # noqa: PLR0913 # pragma: no cover
username: str,
token: str,
timeout: int,
*,
version: bool,
testbed: bool,
use_database: bool,
verbose: bool,
) -> None: # pragma: no cover
"""CLI entrypoint for Chaturbate Poller."""
asyncio.run(
main(
version=version,
testbed=testbed,
timeout=timeout,
username=username,
Expand All @@ -125,21 +123,16 @@ def start( # pylint: disable=too-many-arguments,too-many-positional-arguments
)


async def main( # pylint: disable=too-many-arguments # noqa: PLR0913 # pragma: no cover
async def main( # pylint: disable=too-many-arguments # noqa: PLR0913
timeout: int, # noqa: ASYNC109
username: str,
token: str,
*,
version: bool,
testbed: bool,
use_database: bool,
verbose: bool,
) -> None: # pragma: no cover
"""Run the Chaturbate Poller."""
if version:
console.print(f"chaturbate_poller [bold green]v{__version__}[/bold green]")
return

"""Main entrypoint for the Chaturbate Poller."""
setup_logging()

if verbose:
Expand Down

0 comments on commit 1aa29e2

Please sign in to comment.