Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def web_flow(ctx):

auth_req = client.construct_AuthorizationRequest(request_args=args)
login_url = auth_req.request(client.authorization_endpoint)
click.echo(f"If your Browser does not open automatically, go to the following URL and login:\n{login_url}")
console.info("If your Browser does not open automatically, go to the following URL and login:")
console.link(login_url)
click.launch(login_url)
return True

Expand Down
2 changes: 1 addition & 1 deletion src/cli/console/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .deck import deck_list
from .exit import exit_generic_error, exit_login_required
from .input import list
from .logger import debug, echo, error, info, success, warning
from .logger import debug, echo, error, info, link, success, warning
from .orga import organization_list
from .output import table
from .project import project_list
13 changes: 11 additions & 2 deletions src/cli/console/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class LogLevel(str, Enum):


# helper
def _click_secho(msg: str, silent: bool, log_level: str = None, _exit: bool = False, _exit_code: int = 1, **kwargs):
def _click_secho(
msg: str, silent: bool, log_level: str = None, _exit: bool = False, _exit_code: int = 1, color=None, **kwargs
):
# get log level settings and console mapping
setting_log_level = LogLevel(settings.CLI_LOG_LEVEL.lower())
console_log_level = log_level_mapping.get(log_level, None)
Expand All @@ -51,7 +53,10 @@ def _click_secho(msg: str, silent: bool, log_level: str = None, _exit: bool = Fa
return None

# color
fg = color_mapping.get(log_level, "")
if color:
fg = color
else:
fg = color_mapping.get(log_level, "")

# console echo
if log_level:
Expand Down Expand Up @@ -87,3 +92,7 @@ def error(msg: str, _exit: bool = False, _exit_code: int = 1, **kwargs):

def success(msg: str, silent: bool = False, **kwargs):
_click_secho(msg=msg, silent=silent, log_level=LogLevel.SUCCESS, **kwargs)


def link(msg: str, silent: bool = False, _exit: bool = False, _exit_code: int = 1, **kwargs):
_click_secho(msg=msg, silent=silent, log_level=None, _exit=_exit, _exit_code=_exit_code, color="cyan", **kwargs)
2 changes: 0 additions & 2 deletions unikube.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ def system(ctx):


# system


system.add_command(system_cmd.install)
system.add_command(system_cmd.verify)

Expand Down