예제 #1
0
파일: run.py 프로젝트: jackqu7/Facio
    def run(self):
        """ Run the Facio processes. """

        interface = CommandLineInterface()
        interface.start()

        config = ConfigurationFile()
        parsed = config.read()

        settings = Settings(interface, parsed)
        state.update_context_variables(settings.get_variables())

        template = Template(settings.get_template_path())
        template.update_copy_ignore_globs(settings.copy_ignore_globs())
        template.update_render_ignore_globs(settings.render_ignore_globs())
        template.copy()

        pipeline = Hook()
        pipeline.load(os.path.join(
            state.get_project_root(),
            HOOKS_FILE_NAME))

        if pipeline.has_before():
            pipeline.run_before()

        template.rename()
        template.render()

        if pipeline.has_after():
            pipeline.run_after()

        self.success('Done')
예제 #2
0
    def run(self):
        """ Run the Facio processes. """

        interface = CommandLineInterface()
        interface.start()

        config = ConfigurationFile()
        parsed = config.read()

        settings = Settings(interface, parsed)
        state.update_context_variables(settings.get_variables())

        template = Template(settings.get_template_path())
        template.update_copy_ignore_globs(settings.copy_ignore_globs())
        template.update_render_ignore_globs(settings.render_ignore_globs())
        template.copy()

        pipeline = Hook()
        pipeline.load(os.path.join(state.get_project_root(), HOOKS_FILE_NAME))

        if pipeline.has_before():
            pipeline.run_before()

        template.rename()
        template.render()

        if pipeline.has_after():
            pipeline.run_after()

        self.success('Done')
예제 #3
0
파일: test_config.py 프로젝트: krak3n/Facio
    def test_empty_copy_ignore_no_option(self):
        self.config.get.side_effect = ConfigParser.NoOptionError(
            'files', 'copy_ignore')

        s = Settings(self.interface, self.config)

        self.assertEqual(s.copy_ignore_globs(), [])
예제 #4
0
    def test_empty_copy_ignore_no_option(self):
        self.config.get.side_effect = ConfigParser.NoOptionError(
            'files',
            'copy_ignore')

        s = Settings(self.interface, self.config)

        self.assertEqual(s.copy_ignore_globs(), [])
예제 #5
0
    def test_copy_ignore_returned_as_list(self):
        self.config.get.return_value = 'foo=bar,baz=foo'

        s = Settings(self.interface, self.config)

        self.assertEqual(s.copy_ignore_globs(), ['foo=bar', 'baz=foo'])
예제 #6
0
파일: test_config.py 프로젝트: krak3n/Facio
    def test_copy_ignore_returned_as_list(self):
        self.config.get.return_value = 'foo=bar,baz=foo'

        s = Settings(self.interface, self.config)

        self.assertEqual(s.copy_ignore_globs(), ['foo=bar', 'baz=foo'])