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
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()
    def _createDatasetFromTemplate(self):
        with tempfile.TemporaryDirectory() as tmpdirname:
            generator = Facade(master_file_path=self.base_file,
                               output_dir_path=tmpdirname,
                               force_overwriting=True)
            generator.run()

            with open(tmpdirname + '/train/output.json') as dataset:
                dataset = json.load(dataset)
        self.dataset = dataset
Exemple #5
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()
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()