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


Python log_loading.info方法代码示例

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


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

示例1: load_protocols

# 需要导入模块: from error import log_loading [as 别名]
# 或者: from error.log_loading import info [as 别名]
def load_protocols(filename):
    spaces = re.compile("[ \t]+|\n")
    dct = DADict(_name=filename)
    try:
        for l in open(filename):
            try:
                shrp = l.find("#")
                if  shrp >= 0:
                    l = l[:shrp]
                l = l.strip()
                if not l:
                    continue
                lt = tuple(re.split(spaces, l))
                if len(lt) < 2 or not lt[0]:
                    continue
                dct[lt[0]] = int(lt[1])
            except Exception,e:
                log_loading.info("Couldn't parse file [%s]: line [%r] (%s)" % (filename,l,e))
    except IOError:
        log_loading.info("Can't open %s file" % filename)
    return dct 
开发者ID:medbenali,项目名称:CyberScan,代码行数:23,代码来源:data.py

示例2: load_ethertypes

# 需要导入模块: from error import log_loading [as 别名]
# 或者: from error.log_loading import info [as 别名]
def load_ethertypes(filename):
    spaces = re.compile("[ \t]+|\n")
    dct = DADict(_name=filename)
    try:
        f=open(filename)
        for l in f:
            try:
                shrp = l.find("#")
                if  shrp >= 0:
                    l = l[:shrp]
                l = l.strip()
                if not l:
                    continue
                lt = tuple(re.split(spaces, l))
                if len(lt) < 2 or not lt[0]:
                    continue
                dct[lt[0]] = int(lt[1], 16)
            except Exception,e:
                log_loading.info("Couldn't parse file [%s]: line [%r] (%s)" % (filename,l,e))
        f.close() 
开发者ID:medbenali,项目名称:CyberScan,代码行数:22,代码来源:data.py


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