本文整理匯總了Python中Engine.Engine.run方法的典型用法代碼示例。如果您正苦於以下問題:Python Engine.run方法的具體用法?Python Engine.run怎麽用?Python Engine.run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Engine.Engine
的用法示例。
在下文中一共展示了Engine.run方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: mainfunc
# 需要導入模塊: from Engine import Engine [as 別名]
# 或者: from Engine.Engine import run [as 別名]
def mainfunc():
"""The entry point. Note, if you want dont want argument parsing, feel free to directly use Engine class"""
engine = None
skippass2 = False
datadumpdirectory = None
indexgit = None
customindexfile = None
indexentries = None
testentries = None
indexgitbranch = "master"
cmdargs = initparser().parse_args()
# Set up the parameters to Engine, based on argument parsing.
if cmdargs.indexgiturl is not None and cmdargs.customindexfile is not None:
Logger().log(Logger.error,
"indexgiturl and customindexfile are mutually exclusive. So please specify either one")
exit(5)
if cmdargs.indexgiturl is not None:
indexgit = cmdargs.indexgiturl[0]
if cmdargs.indexgitbranch is not None:
indexgitbranch = cmdargs.indexgitbranch[0]
if cmdargs.customindexfile is not None:
customindexfile = cmdargs.customindexfile[0]
if cmdargs.skippass2 is not None:
skippass2 = cmdargs.skippass2
if cmdargs.datadumpdirectory is not None:
datadumpdirectory = cmdargs.datadumpdirectory[0]
if cmdargs.indexentry is not None:
indexentries = []
for item in cmdargs.indexentry:
indexentries.append(int(item[0]))
if cmdargs.testentry is not None:
testentries = cmdargs.testentry
engine = Engine(datadumpdirectory=datadumpdirectory, indexgit=indexgit, customindexfile=customindexfile,
skippass2=skippass2, specificindexentries=indexentries, testindexentries=testentries,
indexgitbranch=indexgitbranch)
status = engine.run()
if not status:
exit(1)
return
示例2: loading
# 需要導入模塊: from Engine import Engine [as 別名]
# 或者: from Engine.Engine import run [as 別名]
def loading(self):
"""Loading state loop."""
done = Engine.run(self)
self.clearScreen()
if self.data.essentialResourcesLoaded():
if not self.loadingScreenShown:
self.loadingScreenShown = True
Dialogs.showLoadingScreen(self, self.data.resourcesLoaded)
if self.startupLayer:
self.view.pushLayer(self.startupLayer)
self.mainloop = self.main
self.view.render()
self.video.flip()
return done
示例3: main
# 需要導入模塊: from Engine import Engine [as 別名]
# 或者: from Engine.Engine import run [as 別名]
def main(self):
"""Main state loop."""
# Tune the scheduler priority so that transitions are as smooth as possible
if self.view.isTransitionInProgress():
self.boostBackgroundThreads(False)
else:
self.boostBackgroundThreads(True)
done = Engine.run(self)
self.clearScreen()
self.view.render()
if self.debugLayer:
self.debugLayer.render(1.0, True)
self.video.flip()
return done
示例4: get_parser
# 需要導入模塊: from Engine import Engine [as 別名]
# 或者: from Engine.Engine import run [as 別名]
parser.add_argument(
"-c",
"--cleanup",
help="Specify to force cleanup of test bench. If your running multiple times on same system,"
" this is not recommended as it will require downloading of repositories again and again",
action="store_true"
)
return parser
if __name__ == '__main__':
cmd_args = get_parser().parse_args()
clean_up = False
index = cmd_args.index
if cmd_args.cleanup is not None and cmd_args.cleanup:
clean_up = True
e = Engine(index_path=index, cleanup=clean_up)
status, status_list, dependency_graph = e.run()
if cmd_args.list is not None and cmd_args.list:
for item in status_list:
print item
if not status:
exit(1)