# Path: linux_story/story/challenges/CompanionMisc.py
# class StepTemplateNano(StepTemplateEleanorBernard):
#     TerminalClass = TerminalNanoBernard
# 
# Path: linux_story/helper_functions.py
# def record_user_interaction(instance, base_name):
#     """
#     This is to store some of the user actions, so we can determine
#     if the user does the optional side quests.
# 
#     Args:
#         The class instance.
#         base_name (str): a string for the identity of the command.
#     """
# 
#     class_instance = instance.__class__.__name__
#     challenge_number = instance.__module__.split("_")[-1]
#     profile_var_name = "{} {} {}".format(
#         base_name, challenge_number, class_instance
#     )
# 
#     # First, try loading the profile variable name
#     # If the value is None, then make it True and increment the total.
#     already_done = load_app_state_variable("linux-story", profile_var_name)
# 
#     # If the command has not been done yet in this class, then increment the
#     # total
#     if not already_done:
#         save_app_state_variable("linux-story", profile_var_name, True)
#         total_name = "{} total".format(base_name)
#         increment_app_state_variable("linux-story", total_name, 1)
# 
#         # If total reaches a certain amount, then can award XP.


import os
from linux_story.story.challenges.CompanionMisc import StepTemplateNano
from linux_story.helper_functions import record_user_interaction
    ]
}


# Generate the story from the step number
def create_story(step):
    print_text = ""

    if step > 1:
        print_text = _("{{yb:%s}}") % story_replies["echo 1"][step - 2]["user"]

    story = [
        story_replies["echo 1"][step - 2]["clara"],
        _("\n{{yb:1: %s}}") % story_replies["echo 1"][step - 1]["user"],
        _("{{yb:2: %s}}") % story_replies["echo 2"][0]["user"],
        _("{{yb:3: %s}}") % story_replies["echo 3"][0]["user"]
    ]

    return print_text, story


# Want to eliminate the story that the user has already seen
def pop_story(user_input):
    # if the user_input is echo 1, echo 2 or echo 3
    if user_input in story_replies:
        reply = story_replies[user_input][0]
        story_replies[user_input].remove(reply)
        return reply



# Path: linux_story/story/challenges/CompanionMisc.py
# class StepTemplateNano(StepTemplateEleanorBernard):
#     TerminalClass = TerminalNanoBernard
# 
# Path: linux_story/helper_functions.py
# def record_user_interaction(instance, base_name):
#     """
#     This is to store some of the user actions, so we can determine
#     if the user does the optional side quests.
# 
#     Args:
#         The class instance.
#         base_name (str): a string for the identity of the command.
#     """
# 
#     class_instance = instance.__class__.__name__
#     challenge_number = instance.__module__.split("_")[-1]
#     profile_var_name = "{} {} {}".format(
#         base_name, challenge_number, class_instance
#     )
# 
#     # First, try loading the profile variable name
#     # If the value is None, then make it True and increment the total.
#     already_done = load_app_state_variable("linux-story", profile_var_name)
# 
#     # If the command has not been done yet in this class, then increment the
#     # total
#     if not already_done:
#         save_app_state_variable("linux-story", profile_var_name, True)
#         total_name = "{} total".format(base_name)
#         increment_app_state_variable("linux-story", total_name, 1)
# 
#         # If total reaches a certain amount, then can award XP.


# Path: linux_story/story/challenges/challenge_29.py
import os
from linux_story.story.challenges.CompanionMisc import StepTemplateNano
from linux_story.helper_functions import record_user_interaction

    ]
}


# Generate the story from the step number
def create_story(step):
    print_text = ""

    if step > 1:
        print_text = _("{{yb:%s}}") % story_replies["echo 1"][step - 2]["user"]

    story = [
        story_replies["echo 1"][step - 2]["clara"],
        _("\n{{yb:1: %s}}") % story_replies["echo 1"][step - 1]["user"],
        _("{{yb:2: %s}}") % story_replies["echo 2"][0]["user"],
        _("{{yb:3: %s}}") % story_replies["echo 3"][0]["user"]
    ]

    return print_text, story


# Want to eliminate the story that the user has already seen
def pop_story(user_input):
    # if the user_input is echo 1, echo 2 or echo 3
    if user_input in story_replies:
        reply = story_replies[user_input][0]
        story_replies[user_input].remove(reply)
        return reply



class StepNanoStory(StepTemplateNano):