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


Python Application.initialized方法代码示例

本文整理汇总了Python中IPython.config.Application.initialized方法的典型用法代码示例。如果您正苦于以下问题:Python Application.initialized方法的具体用法?Python Application.initialized怎么用?Python Application.initialized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPython.config.Application的用法示例。


在下文中一共展示了Application.initialized方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: wrappedfunc

# 需要导入模块: from IPython.config import Application [as 别名]
# 或者: from IPython.config.Application import initialized [as 别名]
 def wrappedfunc(nb, resources):
     from IPython.config import Application
     if Application.initialized():
         Application.instance().log.debug(
             "Applying preprocessor: %s", function.__name__
         )
     for worksheet in nb.worksheets:
         for index, cell in enumerate(worksheet.cells):
             worksheet.cells[index], resources = function(cell, resources, index)
     return nb, resources
开发者ID:JamesDavid,项目名称:rpi-ipython-venv,代码行数:12,代码来源:coalescestreams.py

示例2: _logger

# 需要导入模块: from IPython.config import Application [as 别名]
# 或者: from IPython.config.Application import initialized [as 别名]
def _logger():
    """get the logger for the current Application
    
    the root logger will be used if no Application is running
    """
    if Application.initialized():
        logger = Application.instance().log
    else:
        logger = logging.getLogger()
        if not logger.handlers:
            logging.basicConfig()
    
    return logger
开发者ID:ellbur,项目名称:ipython,代码行数:15,代码来源:pickleutil.py

示例3: get_logger

# 需要导入模块: from IPython.config import Application [as 别名]
# 或者: from IPython.config.Application import initialized [as 别名]
def get_logger():
    """Grab the global logger instance.

    If a global IPython Application is instantiated, grab its logger.
    Otherwise, grab the root logger.
    """
    global _logger

    if _logger is None:
        from IPython.config import Application
        if Application.initialized():
            _logger = Application.instance().log
        else:
            logging.basicConfig()
            _logger = logging.getLogger()
    return _logger
开发者ID:mattvonrocketstein,项目名称:smash,代码行数:18,代码来源:log.py

示例4: log

# 需要导入模块: from IPython.config import Application [as 别名]
# 或者: from IPython.config.Application import initialized [as 别名]
 def log(self):
     """use the IPython log by default, falling back on tornado's logger"""
     if Application.initialized():
         return Application.instance().log
     else:
         return app_log
开发者ID:Kiiwi,项目名称:Syssel,代码行数:8,代码来源:handlers.py


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