本文整理匯總了Python中log.Log.Log.info方法的典型用法代碼示例。如果您正苦於以下問題:Python Log.info方法的具體用法?Python Log.info怎麽用?Python Log.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類log.Log.Log
的用法示例。
在下文中一共展示了Log.info方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: runTest
# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import info [as 別名]
def runTest(self):
Log.debug('start: DcgFixture.runTest')
print 'now start to test......'
starttime = datetime.datetime.now()
runTime = 0
try:
Log.info('iteration count: ' + str(GlobalSetting.ITERATION))
iterationCount = GlobalSetting.ITERATION
if type(iterationCount) != types.IntType:
iterationCount = 0
while True:
path = 'reports\\'
if not os.path.exists(path):
os.mkdir(path)
dcg = TextFixture()
dcg.doTextTest(self.textfilename, path + self.outreportname)
endtime = datetime.datetime.now()
runTime = (endtime - starttime).seconds
print 'run time(seconds) is: ' + str(runTime)
try:
if GlobalSetting.RUNTIME > 0:
if runTime > GlobalSetting.RUNTIME:
break
elif iterationCount < 1:
break
except BaseException, e:
Log.exception(e)
break
iterationCount -= 1
except (KeyboardInterrupt, SystemExit), e:
print 'user Interrupt test'
Log.exception(e)
os._exit(0)
示例2: bind
# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import info [as 別名]
def bind (self, heads, expandColumnsTag = None):
self.columnBindings = [None] * heads.size()
i = 0
while heads:
name = heads.text()
# strip ' ','\n'
name = name.replace(' ', '')
name = name.replace('\n','')
sufix = "()"
try:
if name[-len(sufix):] == sufix:
self.columnBindings[i] = \
self.bindMethod(name[:-len(sufix)])
if expandColumnsTag is not None:
setattr(self, 'rowspan', 2) # added in 2009/08/21, the first row means show test result, second test data
style = heads.getStyle()
if style is None:
style = ''
try:
heads.addToBody(self.getExpandheads(style))
except AttributeError, e:
Log.info('please implement getExpandheads()!')
Log.exception(e)
else: # name is field
self.columnBindings[i] = self.bindField(name)
示例3: __init__
# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import info [as 別名]
def __init__(self, argv, multipleInstanceFlag = False):
# output-file argv not exists,deafault name :Year-m-d-h-m-sreport.html
self.expandColumnsTag = 'colspan=21'
if len(argv) < 2:
sys.stderr.write("usage: python input-file output-file\n")
sys.exit(-1)
if len(argv) == 2:
self.outreportname = 'reports\\' + time.strftime('%Y-%m-%d-%H-%M-%S') + 'report.html'
argv.append(self.outreportname)
elif(len(argv) > 2):
self.outreportname = argv[2]
infilename = self.convertExcelToHtml(argv[1], multipleInstanceFlag)
Log.info('html file: ' + infilename)
infile = open(infilename,'r')
modtime = time.ctime(os.fstat(infile.fileno())[stat.ST_MTIME])
try:
self.outfile = open(argv[2],'w')
except IOError:
os.mkdir('reports\\')
self.outfile = open(argv[2],'w')
self.fixture.summary["input file"] = os.path.abspath(argv[1])
self.fixture.summary["input update"] = modtime
self.fixture.summary["output file"] = os.path.abspath(argv[2])
self.input = infile.read()
infile.close()
self.output = self.outfile