def new_facade():
    facade = \
        Facade("tests/unit-testing/cli/interactive_commands/toilets.chatette",
               "tests/unit-testing/cli/interactive_commands/", None, False,
               None)
    facade.run_parsing()
    return facade
def get_facade():
    global FACADE
    if FACADE is None:
        FACADE = \
            Facade("tests/unit-testing/cli/interactive_commands/toilets.chatette",
                   "tests/unit-testing/cli/interactive_commands/", None, False,
                   None)
        FACADE.run_parsing()
    return FACADE
Beispiel #3
0
def get_facade():
    if not Facade.was_instantiated():
        facade = \
            Facade(
                "tests/unit-testing/cli/interactive_commands/toilets.chatette",
                "tests/unit-testing/cli/interactive_commands/", None, False,
                None
            )
        facade.run_parsing()
    return Facade.get_or_create()
Beispiel #4
0
    def execute(self):
        """
        Implements the command `parse`,
        parsing a new template file using the current parser.
        """
        if len(self.command_tokens) <= 1:
            self.print_wrapper.error_log("Missing template file path\nUsage: " +
                                         "'parse <file_path>'")
            return
        file_path = self.command_tokens[1]

        if Facade.was_instantiated():
            facade = Facade.get_or_create()
            facade.parse_file(file_path)
        else:
            facade = Facade(file_path)
            facade.run_parsing()
Beispiel #5
0
def new_facade():
    if Facade.was_instantiated():
        print("reset facade")
        facade = \
            Facade.reset_system(
                "tests/unit-testing/cli/interactive_commands/toilets.chatette",
                "tests/unit-testing/cli/interactive_commands/", None, False,
                None
            )
    else:
        print("new facade")
        facade = \
            Facade(
                "tests/unit-testing/cli/interactive_commands/toilets.chatette",
                "tests/unit-testing/cli/interactive_commands/", None, False,
                None
            )
    facade.run_parsing()
    return Facade.get_or_create()