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


Python DEFAULT_CONFIG.setdefault方法代码示例

本文整理汇总了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')
开发者ID:eingrossfilou,项目名称:pelican-plugins,代码行数:9,代码来源:pelican_comment_system.py

示例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'])
开发者ID:kaizer666,项目名称:pelican-fancybox,代码行数:9,代码来源:fancybox.py

示例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')
开发者ID:0xMF,项目名称:pelican-plugins,代码行数:9,代码来源:static_comments.py

示例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', '')
开发者ID:0xMF,项目名称:pelican-plugins,代码行数:9,代码来源:disqus_static.py

示例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 -->")
开发者ID:EmuxEvans,项目名称:linuxtoy.org,代码行数:10,代码来源:summary.py

示例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)
开发者ID:bnice5000,项目名称:markdown_figure,代码行数:11,代码来源:markdown_figure.py

示例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)
开发者ID:DjalelBBZ,项目名称:pelican-plugins,代码行数:12,代码来源:pelican_comment_system.py

示例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 -->')
开发者ID:drewbarbs,项目名称:homepage,代码行数:13,代码来源:headextra.py

示例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)
开发者ID:sbadia,项目名称:site,代码行数:13,代码来源:toc.py

示例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))
开发者ID:allanman,项目名称:pelican-plugins,代码行数:16,代码来源:photos.py

示例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', '')
开发者ID:dm-wyncode,项目名称:zipped-code,代码行数:18,代码来源:twitter_card.py

示例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']
        )
开发者ID:mankyd,项目名称:othm,代码行数:21,代码来源:htmlminify.py

示例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))
开发者ID:Raniz85,项目名称:blog.raneland.se,代码行数:15,代码来源:photos.py

示例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)
开发者ID:DjalelBBZ,项目名称:pelican-plugins,代码行数:15,代码来源:summary.py

示例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}")
开发者ID:erfaan,项目名称:pelican-plugins,代码行数:22,代码来源:pelican_comment_system.py


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