本文整理汇总了Python中pelican.settings.DEFAULT_CONFIG.setdefault方法的典型用法代码示例。如果您正苦于以下问题:Python DEFAULT_CONFIG.setdefault方法的具体用法?Python DEFAULT_CONFIG.setdefault怎么用?Python DEFAULT_CONFIG.setdefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pelican.settings.DEFAULT_CONFIG
的用法示例。
在下文中一共展示了DEFAULT_CONFIG.setdefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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')
示例2: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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'])
示例3: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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 -->')
示例9: init_default_config
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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)
示例10: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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: twitter_card
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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', '')
示例12: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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']
)
示例13: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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))
示例14: initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
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 -->')
DEFAULT_CONFIG.setdefault('SUMMARY_USE_FIRST_PARAGRAPH', False)
if pelican:
pelican.settings.setdefault('SUMMARY_BEGIN_MARKER',
'<!-- PELICAN_BEGIN_SUMMARY -->')
pelican.settings.setdefault('SUMMARY_END_MARKER',
'<!-- PELICAN_END_SUMMARY -->')
pelican.settings.setdefault('SUMMARY_USE_FIRST_PARAGRAPH', False)
示例15: pelican_initialized
# 需要导入模块: from pelican.settings import DEFAULT_CONFIG [as 别名]
# 或者: from pelican.settings.DEFAULT_CONFIG import setdefault [as 别名]
def pelican_initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM", False)
DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_DIR" "comments")
DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH" "images/identicon")
DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_DATA", ())
DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE", 72)
DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_AUTHORS", {})
DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_FEED", os.path.join("feeds", "comment.%s.atom.xml"))
DEFAULT_CONFIG.setdefault("COMMENT_URL", "#comment-{path}")
if pelican:
pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM", False)
pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_DIR", "comments")
pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH", "images/identicon")
pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_DATA", ())
pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE", 72)
pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_AUTHORS", {})
pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_FEED", os.path.join("feeds", "comment.%s.atom.xml"))
pelican.settings.setdefault("COMMENT_URL", "#comment-{path}")