Esempio n. 1
0
def getsystemmessages(session):
    """Get unread system messages."""
    while True:
        message = gdk.get_system_message(session.session_obj)
        if not message:
            break

        click.echo("--- MESSAGE STARTS ---")
        click.echo(message)
        click.echo("--- MESSAGE ENDS ---")
        if not click.confirm("Mark message as read (sign and send acknowledgement to the server)?"):
            break

        gdk_resolve(gdk.ack_system_message(session.session_obj, message))
Esempio n. 2
0
    def inner(session, *args, **kwargs):
        if not context.logged_in:
            logging.info("Logging in")
            result = context.authenticator.login(session.session_obj)
            gdk_resolve(result)
            context.logged_in = True

            if not context.no_warn_sysmsg:
                # Show the user a prompt to read and acknowledge outstanding system messages
                system_message = gdk.get_system_message(session.session_obj)
                if system_message:
                    click.echo(
                        "You have unread system messages, please call getsystemmessages"
                    )

        return fn(session, *args, **kwargs)
Esempio n. 3
0
    def inner(session, *args, **kwargs):
        if not context.logged_in:
            logging.info("Logging in")
            result = context.authenticator.login(session.session_obj)
            # authenticator.login attempts to abstract the actual login method, it may call
            # GA_login, GA_login_with_pin or GA_login_watch_only
            # Unfortunately only GA_login returns an auth_handler, so both cases must be handled
            if result:
                gdk_resolve(result)
            context.logged_in = True

            if not context.no_warn_sysmsg:
                # Show the user a prompt to read and acknowledge outstanding system messages
                system_message = gdk.get_system_message(session.session_obj)
                if system_message:
                    click.echo(
                        "You have unread system messages, please call getsystemmessages"
                    )

        return fn(session, *args, **kwargs)