当前位置: 首页>>代码示例>>Python>>正文


Python DEFAULT_CONFIG.copy方法代码示例

本文整理汇总了Python中pelican.settings.DEFAULT_CONFIG.copy方法的典型用法代码示例。如果您正苦于以下问题:Python DEFAULT_CONFIG.copy方法的具体用法?Python DEFAULT_CONFIG.copy怎么用?Python DEFAULT_CONFIG.copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pelican.settings.DEFAULT_CONFIG的用法示例。


在下文中一共展示了DEFAULT_CONFIG.copy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_do_not_use_folder_as_category

# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import copy [as 别名]
    def test_do_not_use_folder_as_category(self):

        settings = DEFAULT_CONFIG.copy()
        settings['ARTICLE_DIR'] = 'content'
        settings['DEFAULT_CATEGORY'] = 'Default'
        settings['DEFAULT_DATE'] = (1970, 1, 1)
        settings['USE_FOLDER_AS_CATEGORY'] = False
        settings['filenames'] = {}
        generator = ArticlesGenerator(
            settings.copy(), settings, CUR_DIR, DEFAULT_CONFIG['THEME'], None,
            DEFAULT_CONFIG['MARKUP'])
        generator.generate_context()
        # test for name
        # categories are grouped by slug; if two categories have the same slug
        # but different names they will be grouped together, the first one in
        # terms of process order will define the name for that category
        categories = [cat.name for cat, _ in generator.categories]
        categories_alternatives = (
            sorted(['Default', 'Yeah', 'test', '指導書']),
            sorted(['Default', 'yeah', 'test', '指導書']),
        )
        self.assertTrue(sorted(categories) in categories_alternatives)
        # test for slug
        categories = [cat.slug for cat, _ in generator.categories]
        categories_expected = ['default', 'yeah', 'test', 'zhi-dao-shu']
        self.assertEqual(sorted(categories), sorted(categories_expected))
开发者ID:alefteris,项目名称:pelican,代码行数:28,代码来源:test_generators.py

示例2: get_settings

# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import copy [as 别名]
def get_settings(**kwargs):
    """Provide tweaked setting dictionaries for testing

    Set keyword arguments to override specific settings.
    """
    settings = DEFAULT_CONFIG.copy()
    for key,value in kwargs.items():
        settings[key] = value
    return settings
开发者ID:0xMF,项目名称:pelican,代码行数:11,代码来源:support.py

示例3: get_settings

# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import copy [as 别名]
def get_settings(**kwargs):
    settings = DEFAULT_CONFIG.copy()
    for key, value in kwargs.items():
        settings[key] = value
    settings['PLUGINS'] = ['microdata']
    return settings
开发者ID:noirbizarre,项目名称:pelican-microdata,代码行数:8,代码来源:tests.py

示例4: get_settings

# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import copy [as 别名]
def get_settings(**kwargs):
    settings = DEFAULT_CONFIG.copy()
    for key, value in kwargs.items():
        settings[key] = value
    return settings
开发者ID:noirbizarre,项目名称:pelican-frontmark,代码行数:7,代码来源:test_reader.py

示例5: setUp

# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import copy [as 别名]
 def setUp(self):
     settings = DEFAULT_CONFIG.copy()
     settings['EXTRA_TEMPLATES_PATHS'] = ['.']
     context = settings.copy()
     self.generator = Generator(context, settings, settings['PATH'],
                                settings['THEME'], settings['OUTPUT_PATH'])
开发者ID:bendmorris,项目名称:pelican-category_template,代码行数:8,代码来源:test_categorytpl.py

示例6: create_generator

# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import copy [as 别名]
def create_generator(path):
    settings = DEFAULT_CONFIG.copy()
    settings['filenames'] = {}
    settings['CACHE_CONTENT'] = False  # cache not needed for this logic tests
    return ArticlesGenerator(context=settings.copy(), settings=settings,
                             path=path, theme=settings['THEME'], output_path=None)
开发者ID:romainx,项目名称:panorama,代码行数:8,代码来源:test_panorama.py


注:本文中的pelican.settings.DEFAULT_CONFIG.copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。