def requires_session(method):
    """UserInterface method wrapper for checking if a client session was created."""

    def check_session_before_call(*args):
        user_interface = args[0]
        if not user_interface.has_session():
            print("Server connection required. Call \"connect\" first.")
            return
        else:
            return method(*args)

    return check_session_before_call