當前位置: 首頁>>代碼示例>>Python>>正文


Python Config.merge方法代碼示例

本文整理匯總了Python中traitlets.config.Config.merge方法的典型用法代碼示例。如果您正苦於以下問題:Python Config.merge方法的具體用法?Python Config.merge怎麽用?Python Config.merge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在traitlets.config.Config的用法示例。


在下文中一共展示了Config.merge方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
    def default_config(self):
        # import jupyter_core.paths
        # import os
        c = Config({
            'NbConvertBase': {
                'display_data_priority': ['application/javascript',
                                          'text/html',
                                          'text/markdown',
                                          'image/svg+xml',
                                          'text/latex',
                                          'image/png',
                                          'image/jpeg',
                                          'text/plain'
                                          ]
            },
            'CSSHTMLHeaderPreprocessor': {
                'enabled': True},
            'HighlightMagicsPreprocessor': {
                'enabled': True},
            'ExtractOutputPreprocessor': {
                'enabled': True},
            'latex_envs.LenvsLatexPreprocessor': {'enabled': True}
        }
        )
        from jupyter_contrib_nbextensions.nbconvert_support import (
            templates_directory)
        c.merge(super(LenvsLatexExporter, self).default_config)

        # user_templates = os.path.join(jupyter_core.paths.jupyter_data_dir(),
        # 'templates')
        c.TemplateExporter.template_path = ['.', templates_directory()]

        # c.Exporter.preprocessors = ['tmp.LenvsLatexPreprocessor' ]
        # c.NbConvertApp.postprocessor_class = 'tmp.TocPostProcessor'
        return c
開發者ID:flipphillips,項目名稱:IPython-notebook-extensions,代碼行數:37,代碼來源:latex_envs.py

示例2: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     c = Config({
         'RevealHelpPreprocessor': {
             'enabled': True,
             },
         })
     c.merge(super(SlidesExporter,self).default_config)
     return c
開發者ID:CaptainAL,項目名稱:Spyder,代碼行數:10,代碼來源:slides.py

示例3: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
    def default_config(self):
        c = Config({"ExtractOutputPreprocessor": {"enabled": True}})
        #  import here to avoid circular import
        from jupyter_contrib_nbextensions.nbconvert_support import templates_directory

        c.merge(super(TocExporter, self).default_config)

        c.TemplateExporter.template_path = [".", templates_directory()]

        return c
開發者ID:flipphillips,項目名稱:IPython-notebook-extensions,代碼行數:12,代碼來源:toc2.py

示例4: _compile_string

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def _compile_string(self, nb_json):
     """Export notebooks as HTML strings."""
     self._req_missing_ipynb()
     c = Config(get_default_jupyter_config())
     c.merge(Config(self.site.config['IPYNB_CONFIG']))
     if 'template_file' not in self.site.config['IPYNB_CONFIG'].get('Exporter', {}):
         c['Exporter']['template_file'] = 'basic.tpl'  # not a typo
     exportHtml = HTMLExporter(config=c)
     body, _ = exportHtml.from_notebook_node(nb_json)
     return body
開發者ID:getnikola,項目名稱:nikola,代碼行數:12,代碼來源:ipynb.py

示例5: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     import jupyter_core.paths
     import os
     c = Config({'ExtractOutputPreprocessor':{'enabled':True}})
     c.merge(super(TocExporter,self).default_config)
     
     user_templates = os.path.join(jupyter_core.paths.jupyter_data_dir(), 'templates')
     c.TemplateExporter.template_path = [
                             '.', user_templates ]
     return c
開發者ID:Jernej88,項目名稱:IPython-notebook-extensions,代碼行數:12,代碼來源:toc2.py

示例6: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     c = Config({
         'RegexRemovePreprocessor': {
             'enabled': True
             },
         'TagRemovePreprocessor': {
             'enabled': True
             }
         })
     c.merge(super(TemplateExporter, self).default_config)
     return c
開發者ID:BarnetteME1,項目名稱:DnD-stuff,代碼行數:13,代碼來源:templateexporter.py

示例7: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     c = Config({
         'ExtractOutputPreprocessor':{
             'enabled':True
             },
         'HighlightMagicsPreprocessor': {
             'enabled':True
             },
         })
     c.merge(super(RSTExporter,self).default_config)
     return c
開發者ID:jupyter,項目名稱:nbconvert,代碼行數:13,代碼來源:rst.py

示例8: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     c = Config({
         'ExtractOutputPreprocessor': {
             'enabled': True,
             'output_filename_template': '{unique_key}_{cell_index}_{index}{extension}'
         },
         'HighlightMagicsPreprocessor': {
             'enabled': True
         },
     })
     c.merge(super(UpgradedRSTExporter, self).default_config)
     return c
開發者ID:sdpython,項目名稱:pyquickhelper,代碼行數:14,代碼來源:notebook_exporter.py

示例9: export_through_preprocessor

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
def export_through_preprocessor(
        notebook_node, preproc_cls, exporter_class, export_format, customconfig=None):
    """Export a notebook through a given preprocessor."""
    config=Config(NbConvertApp={'export_format': export_format })
    if customconfig is not None:
        config.merge(customconfig)
    exporter = exporter_class(
        preprocessors=[preproc_cls.__module__ + '.' + preproc_cls.__name__],
        config=config)
    try:
        return exporter.from_notebook_node(notebook_node)
    except PandocMissing:
        raise SkipTest("Pandoc wasn't found")
開發者ID:jcb91,項目名稱:IPython-notebook-extensions,代碼行數:15,代碼來源:test_preprocessors.py

示例10: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
    def default_config(self):
        c = Config({'ExtractOutputPreprocessor': {'enabled': False}})
        #  import here to avoid circular import
        from jupyter_contrib_nbextensions.nbconvert_support import (
            templates_directory)
        c.merge(super(TocExporter, self).default_config)

        c.TemplateExporter.template_path = [
            '.',
            templates_directory(),
        ]

        return c
開發者ID:ipython-contrib,項目名稱:jupyter_contrib_nbextensions,代碼行數:15,代碼來源:toc2.py

示例11: load_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
    def load_config(self):
        paths = jupyter_config_path()
        paths.insert(0, os.getcwd())

        config_found = False
        full_config = Config()
        for config in NbGrader._load_config_files("nbgrader_config", path=paths, log=self.log):
            full_config.merge(config)
            config_found = True

        if not config_found:
            self.log.warning("No nbgrader_config.py file found. Rerun with DEBUG log level to see where nbgrader is looking.")

        return full_config
開發者ID:jhamrick,項目名稱:nbgrader,代碼行數:16,代碼來源:handlers.py

示例12: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     c = Config({
         'NbConvertBase': {
             'display_data_priority' : ['application/javascript', 'text/html', 'text/markdown', 'application/pdf', 'image/svg+xml', 'text/latex', 'image/png', 'image/jpeg', 'text/plain']
             },
         'CSSHTMLHeaderPreprocessor':{
             'enabled':True
             },
         'HighlightMagicsPreprocessor': {
             'enabled':True
             }
         })
     c.merge(super(HTMLExporter,self).default_config)
     return c
開發者ID:drocco007,項目名稱:jupyter_nbconvert,代碼行數:16,代碼來源:html.py

示例13: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
    def default_config(self):
        c = Config({
            'ExtractOutputPreprocessor': {'enabled': True},
            'NbConvertBase': {
                'display_data_priority': ['text/html',
                                          'text/markdown',
                                          'image/svg+xml',
                                          'text/latex',
                                          'image/png',
                                          'image/jpeg',
                                          'text/plain'
                                          ]
            },

        })
        c.merge(super(MarkdownExporter, self).default_config)
        return c
開發者ID:Carreau,項目名稱:nbconvert,代碼行數:19,代碼來源:markdown.py

示例14: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     c = Config({
         'NbConvertBase': {
             'display_data_priority' : ['text/latex', 'application/pdf', 'image/png', 'image/jpeg', 'image/svg+xml', 'text/markdown', 'text/plain']
             },
          'ExtractOutputPreprocessor': {
                 'enabled':True
              },
          'SVG2PDFPreprocessor': {
                 'enabled':True
              },
          'LatexPreprocessor': {
                 'enabled':True
              },
          'SphinxPreprocessor': {
                 'enabled':True
              },
          'HighlightMagicsPreprocessor': {
                 'enabled':True
              }
      })
     c.merge(super(LatexExporter,self).default_config)
     return c
開發者ID:Carreau,項目名稱:nbconvert,代碼行數:25,代碼來源:latex.py

示例15: default_config

# 需要導入模塊: from traitlets.config import Config [as 別名]
# 或者: from traitlets.config.Config import merge [as 別名]
 def default_config(self):
     c = Config(
         {
             "NbConvertBase": {
                 "display_data_priority": [
                     "text/latex",
                     "application/pdf",
                     "image/png",
                     "image/jpeg",
                     "image/svg+xml",
                     "text/markdown",
                     "text/plain",
                 ]
             },
             "ExtractOutputPreprocessor": {"enabled": True},
             "SVG2PDFPreprocessor": {"enabled": True},
             "LatexPreprocessor": {"enabled": True},
             "SphinxPreprocessor": {"enabled": True},
             "HighlightMagicsPreprocessor": {"enabled": True},
         }
     )
     c.merge(super(LatexExporter, self).default_config)
     return c
開發者ID:joshhanna,項目名稱:biostats-i-final,代碼行數:25,代碼來源:latex.py


注:本文中的traitlets.config.Config.merge方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。