本文整理汇总了Python中pelican.settings.DEFAULT_CONFIG类的典型用法代码示例。如果您正苦于以下问题:Python DEFAULT_CONFIG类的具体用法?Python DEFAULT_CONFIG怎么用?Python DEFAULT_CONFIG使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DEFAULT_CONFIG类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialized
def initialized(pelican):
global fancybox_settings
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('FANCYBOX_SETTINGS', {})
if pelican:
pelican.settings.setdefault('FANCYBOX_SETTINGS', {})
fancybox_settings = supercopy(pelican.settings['FANCYBOX_SETTINGS'])
示例2: initialized
def initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM', False)
DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_DIR' 'comments')
if pelican:
pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM', False)
pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_DIR', 'comments')
示例3: initialized
def initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('STATIC_COMMENTS', False)
DEFAULT_CONFIG.setdefault('STATIC_COMMENTS_DIR' 'comments')
if pelican:
pelican.settings.setdefault('STATIC_COMMENTS', False)
pelican.settings.setdefault('STATIC_COMMENTS_DIR', 'comments')
示例4: initialized
def initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('DISQUS_SECRET_KEY', '')
DEFAULT_CONFIG.setdefault('DISQUS_PUBLIC_KEY', '')
if pelican:
pelican.settings.setdefault('DISQUS_SECRET_KEY', '')
pelican.settings.setdefault('DISQUS_PUBLIC_KEY', '')
示例5: initialized
def initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault("SUMMARY_BEGIN_MARKER", "<!-- PELICAN_BEGIN_SUMMARY -->")
DEFAULT_CONFIG.setdefault("SUMMARY_END_MARKER", "<!-- PELICAN_END_SUMMARY -->")
if pelican:
pelican.settings.setdefault("SUMMARY_BEGIN_MARKER", "<!-- PELICAN_BEGIN_SUMMARY -->")
pelican.settings.setdefault("SUMMARY_END_MARKER", "<!-- PELICAN_END_SUMMARY -->")
示例6: initialized
def initialized(pelican):
"""Initialize the plugin """
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('MDF_DEFAULT_CONFIG', '')
DEFAULT_CONFIG.setdefault('BOOTSTRAPPER_FIGURES', False)
if pelican:
pelican.settings.setdefault('MDF_DEFAULT_CONFIG', '')
pelican.settings.setdefault('BOOTSTRAPPER_FIGURES', False)
示例7: setdefault
def setdefault(pelican, settings):
from pelican.settings import DEFAULT_CONFIG
for key, value in settings:
DEFAULT_CONFIG.setdefault(key, value)
if not pelican:
return
for key, value in settings:
pelican.settings.setdefault(key, value)
示例8: init_default_config
def init_default_config(pelican):
from pelican.settings import DEFAULT_CONFIG
TOC_DEFAULT = {
'TOC_HEADERS': '^h[1-6]',
'TOC_RUN': 'true'
}
DEFAULT_CONFIG.setdefault('TOC', TOC_DEFAULT)
if(pelican):
pelican.settings.setdefault('TOC', TOC_DEFAULT)
示例9: initialized
def initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('ARTICLEHEAD_BEGIN_MARKER',
'<!-- ARTICLE_HEAD_BEGIN -->')
DEFAULT_CONFIG.setdefault('ARTICLEHEAD_END_MARKER',
'<!-- ARTICLE_HEAD_END -->')
if pelican:
pelican.settings.setdefault('ARTICLEHEAD_BEGIN_MARKER',
'<!-- ARTICLE_HEAD_BEGIN -->')
pelican.settings.setdefault('ARTICLEHEAD_END_MARKER',
'<!-- ARTICLE_HEAD_END -->')
示例10: initialized
def initialized(pelican):
p = os.path.expanduser('~/Pictures')
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('PHOTO_MTIME', False)
DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', ( 760, 506, 80))
DEFAULT_CONFIG.setdefault('PHOTO_THUMB', ( 192, 144, 60))
if pelican:
pelican.settings.setdefault('PHOTO_MTIME', False)
pelican.settings.setdefault('PHOTO_LIBRARY', p)
pelican.settings.setdefault('PHOTO_GALLERY', (1024, 768, 80))
pelican.settings.setdefault('PHOTO_ARTICLE', ( 760, 506, 80))
pelican.settings.setdefault('PHOTO_THUMB', ( 192, 144, 60))
示例11: test_do_not_use_folder_as_category
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))
示例12: twitter_card
def twitter_card(generator):
"""
https://dev.twitter.com/cards
TWITTER_CARD_USE = (True) # (False)
TWITTER_CARD_SITE = '@website' # The site's Twitter handle like @my_blog
TWITTER_CARD_SITE_ID = 123456 # The site's Twitter ID
TWITTER_CARD_CREATOR = '@username' # Your twitter handle like @yourtwitname
TWITTER_CARD_CREATOR_ID = 56789 # The site creator's id
GRAVATAR_URL = ''
"""
DEFAULT_CONFIG.setdefault('TWITTER_CARD_SITE', '')
DEFAULT_CONFIG.setdefault('TWITTER_CARD_SITE_ID', '')
DEFAULT_CONFIG.setdefault('TWITTER_CARD_CREATOR', '')
DEFAULT_CONFIG.setdefault('TWITTER_CARD_CREATOR_ID', '')
DEFAULT_CONFIG.setdefault('GRAVATAR_URL', '')
示例13: get_settings
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
示例14: initialized
def initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault(
'HTMLMINIFY_FILE_EXTENSIONS',
['html', 'htm']
)
DEFAULT_CONFIG.setdefault(
'HTMLMINIFY_SETTINGS',
{}
)
if pelican:
pelican.settings.setdefault(
'HTMLMINIFY_FILE_EXTENSIONS',
DEFAULT_CONFIG['HTMLMINIFY_FILE_EXTENSIONS']
)
pelican.settings.setdefault(
'HTMLMINIFY_SETTINGS',
DEFAULT_CONFIG['HTMLMINIFY_SETTINGS']
)
示例15: initialized
def initialized(pelican):
p = os.path.expanduser("~/Pictures")
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault("PHOTO_LIBRARY", p)
DEFAULT_CONFIG.setdefault("PHOTO_GALLERY", (1024, 768, 80))
DEFAULT_CONFIG.setdefault("PHOTO_ARTICLE", (760, 506, 80))
DEFAULT_CONFIG.setdefault("PHOTO_THUMB", (192, 144, 60))
if pelican:
pelican.settings.setdefault("PHOTO_LIBRARY", p)
pelican.settings.setdefault("PHOTO_GALLERY", (1024, 768, 80))
pelican.settings.setdefault("PHOTO_ARTICLE", (760, 506, 80))
pelican.settings.setdefault("PHOTO_THUMB", (192, 144, 60))