示例#1
0
def prepare_director(args, site):
    """Prepare the director to produce a site."""
    loader = ExtensionLoader()
    loader.load()
    config = build_config(site.config_file, args)
    extensions = loader.get_active_extensions(config)
    return Director(config, site, extensions)
示例#2
0
文件: base.py 项目: iter8ve/handroll
def prepare_director(args, site):
    """Prepare the director to produce a site."""
    loader = ExtensionLoader()
    loader.load()
    config = build_config(site.config_file, args)
    extensions = loader.get_active_extensions(config)
    return Director(config, site, extensions)
示例#3
0
    def test_gets_active_extensions(self):
        config = Configuration()
        config.active_extensions.add('blog')
        loader = ExtensionLoader()
        loader.load()

        extensions = loader.get_active_extensions(config)

        self.assertEqual(1, len(extensions))
        self.assertTrue(isinstance(extensions[0], BlogExtension))
示例#4
0
    def test_gets_active_extensions(self):
        config = Configuration()
        config.active_extensions.add('blog')
        loader = ExtensionLoader()
        loader.load()

        extensions = loader.get_active_extensions(config)

        self.assertEqual(1, len(extensions))
        self.assertTrue(isinstance(extensions[0], BlogExtension))
示例#5
0
 def test_loads_available_extensions(self):
     loader = ExtensionLoader()
     loader.load()
     self.assertEqual(BlogExtension, loader._available_extensions['blog'])
示例#6
0
 def test_loads_available_extensions(self):
     loader = ExtensionLoader()
     loader.load()
     self.assertEqual(BlogExtension, loader._available_extensions['blog'])