示例#1
0
    def run(self):
        """For each file in noseOfYeti/specs, output nodes to represent each spec file"""
        with hp.a_temp_file() as fle:
            fle.write(dedent("""
                ---
                environments: { dev: {account_id: "123"} }
                stacks: { app: {} }
            """).encode('utf-8'))
            fle.seek(0)
            collector = Collector()
            collector.prepare(fle.name, {'bespin': {'extra': ""}, "command": None, "bash": None})

        section = nodes.section()
        section['ids'].append("available-tasks")

        title = nodes.title()
        title += nodes.Text("Default tasks")
        section += title

        for name, task in sorted(collector.configuration['task_finder'].tasks.items(), key=lambda x: len(x[0])):

            lines = [name] + ["  {0}".format(line.strip()) for line in task.description.split('\n')]
            viewlist = ViewList()
            for line in lines:
                viewlist.append(line, name)
            self.state.nested_parse(viewlist, self.content_offset, section)

        return [section]
示例#2
0
    def execute(self, args, extra_args, cli_args, logging_handler):
        collector = Collector(configuration_file=args.bespin_config.name)
        collector.configuration["$@"] = extra_args

        if "term_colors" in collector.configuration:
            self.setup_logging_theme(logging_handler, colors=collector.configuration["term_colors"])

        collector.prepare(cli_args)
        collector.configuration["task_runner"](collector.configuration["bespin"].chosen_task)
示例#3
0
文件: executor.py 项目: carukc/bespin
    def execute(self, args_obj, args_dict, extra_args, logging_handler):
        collector = Collector()
        args_dict["bespin"]["extra"] = extra_args

        collector.prepare(args_obj.bespin_config.name, args_dict)
        if "term_colors" in collector.configuration:
            self.setup_logging_theme(logging_handler, colors=collector.configuration["term_colors"])

        collector.configuration["task_runner"](collector.configuration["bespin"].chosen_task)
示例#4
0
    def execute(self, args_obj, args_dict, extra_args, logging_handler):
        collector = Collector()
        args_dict["bespin"]["extra"] = extra_args

        collector.prepare(args_obj.bespin_config.name, args_dict)
        if "term_colors" in collector.configuration:
            self.setup_logging_theme(
                logging_handler, colors=collector.configuration["term_colors"])

        collector.configuration["task_runner"](
            collector.configuration["bespin"].chosen_task)
示例#5
0
    def run(self):
        """For each file in noseOfYeti/specs, output nodes to represent each spec file"""
        with hp.a_temp_file() as fle:
            fle.write(
                dedent("""
                ---
                environments: { dev: {account_id: "123"} }
                stacks: { app: {} }
            """).encode('utf-8'))
            fle.seek(0)
            collector = Collector()
            collector.prepare(fle.name, {
                'bespin': {
                    'extra': ""
                },
                "command": None,
                "bash": None
            })

        section = nodes.section()
        section['ids'].append("available-tasks")

        title = nodes.title()
        title += nodes.Text("Default tasks")
        section += title

        for name, task in sorted(
                collector.configuration['task_finder'].tasks.items(),
                key=lambda x: len(x[0])):

            lines = [name] + [
                "  {0}".format(line.strip())
                for line in task.description.split('\n')
            ]
            viewlist = ViewList()
            for line in lines:
                viewlist.append(line, name)
            self.state.nested_parse(viewlist, self.content_offset, section)

        return [section]