本文整理汇总了Python中pelican.Pelican.modified_run方法的典型用法代码示例。如果您正苦于以下问题:Python Pelican.modified_run方法的具体用法?Python Pelican.modified_run怎么用?Python Pelican.modified_run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pelican.Pelican
的用法示例。
在下文中一共展示了Pelican.modified_run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from pelican import Pelican [as 别名]
# 或者: from pelican.Pelican import modified_run [as 别名]
def setUp(self, settings_overrides=None, count=5,
categories_per_content=1, categories=None):
self.temp_input_dir = tempfile.mkdtemp(prefix="cc-input-")
page_directory = os.path.join(self.temp_input_dir, 'pages')
os.mkdir(page_directory)
self.temp_output_dir = tempfile.mkdtemp(prefix="cc-output-")
if categories is None:
categories = [get_random_text_and_whitespace() for _ in range(5)]
self.articles = make_content(
self.temp_input_dir, categories, count=count,
categories_per_content=categories_per_content)
self.pages = make_content(
page_directory, categories, count=count,
categories_per_content=categories_per_content)
settings = {
'PATH': self.temp_input_dir,
'PAGE_DIR': 'pages',
'OUTPUT_PATH': self.temp_output_dir,
'PLUGINS': [cc],
'DEFAULT_DATE': (2014, 6, 8),
}
if settings_overrides is not None:
settings.update(settings_overrides)
settings = read_settings(override=settings)
pelican = Pelican(settings=settings)
pelican.modified_run = modified_pelican_run
self.collations = pelican.modified_run(pelican)['collations']