本文整理汇总了Python中Utils.Logger.error方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.error方法的具体用法?Python Logger.error怎么用?Python Logger.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Logger
的用法示例。
在下文中一共展示了Logger.error方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _parse_douban
# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
def _parse_douban(page):
soup = BeautifulSoup(page)
ret = []
try:
table = soup.findAll('table', {'class':'olt'})[0]
'''
nexturl = soup.findAll('div', {'class':'paginator'})[0]\
.findAll('span', {'class':'next'})[0]
try:
nexturl = nexturl.findAll('link')[0]['href']
except:
nexturl = ''
'''
for row in PageParser._clean(table)[1:]: #skip table header
try:
url, _, _, reply_time = PageParser._clean(row)
except:
continue
url = PageParser._clean(url)[0]['href'].strip()
reply_time = PageParser._clean(reply_time)[0].strip()
if ':' in reply_time:
year = time.strftime('%Y-',time.localtime(time.time()))
reply_time = time.strptime(year+reply_time, '%Y-%m-%d %H:%M')
else:
reply_time = time.strptime(reply_time, '%Y-%m-%d')
reply_time = int(time.mktime(reply_time))
hashurl = hashlib.md5(url).hexdigest()
ret.append(Link(
hashurl=hashurl,
url=url,
reply_time=reply_time
))
except IndexError:
Logger.error('index error!')
return ret #, nexturl
示例2: Logger
# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
# Desc: Functionality for sending email notifications to a set of email
# addresses in case of test suite success/failure, based on policies
# about the frequency and type of notifications desired.
#
#-------------------------------------------------------------------------------
from Utils import Logger
LOGGER = Logger(__name__).setup()
try:
import sys
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
except ImportError, e:
LOGGER.error(str(e))
sys.exit(1)
class EmailNotifierException(Exception):
'''
General Exception raised by EmailNotifier.
'''
def __init__(self, desc):
'''
Constructs Exception
@param desc: description of an error
'''
self.desc = desc
def __str__(self):
'''
示例3: Logger
# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
# Desc: TODO:
#-------------------------------------------------------------------------------
from Utils import Logger
LOGGER = Logger(__name__).setup()
try:
import sys
import os
import socket
import cherrypy
from Utils import Command
from Cheetah.Template import Template
from cherrypy.lib.static import serve_file
except ImportError, e:
LOGGER.error(str(e))
sys.exit(1)
class XrdWebInterfaceException(Exception):
'''
General Exception raised by WebInterface.
'''
def __init__(self, desc):
'''
Constructs Exception
@param desc: description of an error
'''
self.desc = desc
def __str__(self):
'''
示例4: __init__
# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
try:
import sys
import os
import re
import threading
import libvirt
from ClusterUtils import ClusterManagerException, Cluster
from ClusterUtils import ERR_CONNECTION, ERR_ADD_HOST, ERR_CREATE_NETWORK
from Utils import Command, State
from SocketUtils import XrdMessage
from copy import deepcopy
from libvirt import libvirtError
except ImportError, e:
LOGGER.error(str(e))
sys.exit(1)
class ClusterManager:
"""
Virtual machines clusters' manager
"""
def __init__(self):
"""
Creates Manager instance. Needs url to virtual virt domains manager
"""
# Socket reference back to the master, for publishing status updates
self.sockStream = None
# definitions of clusters. Key: name Value: cluster definition