Lazy load login command
MODIFY
plextraktsync/cli.py
plextraktsync/cli.py
from functools import wraps
import click
-from plextraktsync.commands.login import login
from plextraktsync.commands.plex_login import plex_login
from plextraktsync.commands.self_update import enable_self_update, self_update
from plextraktsync.commands.sync import sync
@@ -105,6 +104,14 @@ def inspect():
pass
+@command()
+def login():
+ """
+ Log in to Plex and Trakt if needed
+ """
+ pass
+
+
cli.add_command(cache)
cli.add_command(clear_collections)
cli.add_command(info)

MODIFY
plextraktsync/commands/login.py
plextraktsync/commands/login.py
plex_login_autoconfig)
from plextraktsync.commands.trakt_login import (has_trakt_token,
trakt_login_autoconfig)
-from plextraktsync.style import comment, highlight, success
+from plextraktsync.style import highlight, success
def ensure_login():
@@ -15,12 +15,7 @@ def ensure_login():
trakt_login_autoconfig()
-@click.command()
def login():
- """
- Log in to Plex and Trakt if needed
- """
-
click.echo(highlight("Checking Plex and Trakt logins"))
ensure_login()
click.echo(success("Success!"))

Lazy load login command