本文整理汇总了Python中service.Service.toHtml方法的典型用法代码示例。如果您正苦于以下问题:Python Service.toHtml方法的具体用法?Python Service.toHtml怎么用?Python Service.toHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service.Service
的用法示例。
在下文中一共展示了Service.toHtml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import toHtml [as 别名]
def main():
while True:
doFileFlag = False
doProcessFlag = False
doAutorunFlag = False
doServiceFlag = False
doDriversFlag = False
cmd = enter_command()
if cmd == '':
continue
if cmd == '?':
print_help()
elif cmd == 'quit':
return
elif cmd == 'all':
doFileFlag = True
doProcessFlag = True
doAutorunFlag = True
doServiceFlag = True
doDriversFlag = True
else:
wrongFlag = False
for i in range(0, len(cmd)):
if cmd[i] not in ('h','a','s','d','p'):
wrongFlag = True
break
if wrongFlag:
continue
doFileFlag = True
if 'p' in cmd:
doProcessFlag = True
if 'a' or 's' or 'd' in cmd:
doAutorunFlag = True
if 's' in cmd:
doServiceFlag = True
if 'd' in cmd:
doDriversFlag = True
if doFileFlag:
try:
xmlFile = r'assessreport.xml'
print("Starting parsing assessreport.xml...")
computerName, fileList, autorunList, processList = xmlFileParse(xmlFile)
print("Parsing is finished.")
except:
print("Sorry, parsing is failed. The program will exit.")
raw_input("Exit program.")
return
if doProcessFlag:
try:
createIndexHtml(computerName)
print("Starting collecting process info...")
process = Process(r'.\result\process.html', processList)
process.toHtml(fileList)
print("Collecting process info is finished.")
except:
print("Sorry, collecting process info is failed. The program will exit.")
raw_input("Exit program.")
return
if doAutorunFlag:
try:
print("Starting collecting autorun info...")
autorun = Autorun(r'.\result\autorun.html', autorunList)
autorun.toHtml(fileList)
print("Collecting autorun info is finished.")
except:
print("Sorry, collecting autorun info is failed. The program will exit.")
raw_input("Exit program.")
return
if doServiceFlag:
try:
print("Starting collecting service info...")
service = Service(r'.\result\service.html', autorunList)
service.toHtml(fileList)
print("Collecting service info is finished.")
except:
print("Sorry, collecting service info is failed. The program will exit.")
raw_input("Exit program.")
return
if doDriversFlag:
try:
print("Starting collecting drivers info...")
drivers = Drivers(r'.\result\drivers.html', autorunList)
drivers.toHtml(fileList)
print("Collecting drivers info is finished.")
except:
print("Sorry, collecting drivers info is failed. The program will exit.")
raw_input("Exit program.")
return
print("Starting creating files...")
for file in fileList.values():
writeToHTML(file)
HighSuspecter(r'.\result\highsuspect.html', fileList).toHtml()
print("Files have been created.")
open = raw_input("The program will open your default web browser to open index.html. If you don't want. Please enter (n/N): ")
open = open.strip().lower()
if open == 'n': return
else:
webbrowser.open(r'index.html')
return