本文整理汇总了Python中application.Application.initialize方法的典型用法代码示例。如果您正苦于以下问题:Python Application.initialize方法的具体用法?Python Application.initialize怎么用?Python Application.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类application.Application
的用法示例。
在下文中一共展示了Application.initialize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AppFixture
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import initialize [as 别名]
def AppFixture():
MM = MudMapper()
MM.bootstrap()
MM.initialize()
MM.show()
return MM
示例2: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import initialize [as 别名]
def main():
#---------------------------------------------------------------------------
import sys, argparse
#application local
from gui import GUI
from application import Application
#---------------------------------------------------------------------------
#parse command line arguments
parser = argparse.ArgumentParser()
parser.add_argument("--skip-test",
default = False,
action = 'store_true',
help = "skip over device tests",
)
parser.add_argument("--no-detach",
dest = "detach",
default = True,
action = 'store_false',
help = "remain bound to terminal session",
)
parser.add_argument("--ignore-device-errors",
dest = "ignore_device_errors",
default = False,
action = 'store_true',
help = "ignore initial device errors"
)
args = parser.parse_args()
#initialize the control application
app = Application(skip_test = args.skip_test,
ignore_device_errors = args.ignore_device_errors,
)
#parse and loads the configuration objects
app.load(config_filepath = OLMpstat.pkg_info.platform['config_filepath'])
#initialize the controllers
app.initialize()
if args.detach:
#detach the process from its controlling terminal
from automat.system_tools.daemonize import detach
app.print_comment("Process Detached.")
app.print_comment("You may now close the terminal window...")
detach()
#start the graphical interface
gui = GUI(app)
#give the app the ability to print to the GUI's textbox
app.setup_textbox_printer(gui.print_to_text_display)
#launch the GUI
gui.load()
gui.launch()
示例3: create_entity
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import initialize [as 别名]
entity_args_strings = ENTITY_ARGS.split()
entity_args = parser.parse_args(entity_args_strings)
def create_entity():
return Entity(bvh_reader, pose, FLOOR, Z_UP, entity_args)
pose = bvh_reader.get_hierarchy().create_pose()
entity = create_entity()
num_input_dimensions = entity.get_value_length()
student = DimensionalityReductionFactory.create(
DIMENSIONALITY_REDUCTION_TYPE, num_input_dimensions, NUM_REDUCED_DIMENSIONS, DIMENSIONALITY_REDUCTION_ARGS)
student.load(STUDENT_MODEL_PATH)
improvise_params = ImproviseParameters()
preferred_location = None
improvise = Improvise(
student,
student.num_reduced_dimensions,
improvise_params,
preferred_location,
MAX_NOVELTY)
index = 0
avatar = Avatar(index, entity, improvise)
avatars = [avatar]
application = Application(student, avatars, args, receive_from_pn=True, create_entity=create_entity)
application.initialize()
application.run()
示例4: RecallBehavior
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import initialize [as 别名]
memory.set_frames(storage.load(args.memory))
recall_behavior = RecallBehavior()
master_behavior = MasterBehavior()
avatar = Avatar(index, master_entity, master_behavior)
def clear_memory():
recall_behavior.reset()
memory.clear()
avatars = [avatar]
application = Application(
students[args.model], avatars, args, receive_from_pn=True, create_entity=create_entity, z_up=Z_UP)
set_model(args.model)
set_max_angular_step(args.max_angular_step)
if args.with_ui:
qt_app = QtGui.QApplication(sys.argv)
ui_window = UiWindow(master_behavior)
ui_window.show()
application.initialize(ui_window)
if args.preset:
ui_window.set_preset(args.preset)
qt_app.exec_()
else:
if args.preset:
raise Exception("--preset requires --with-ui")
application.initialize()
application.main_loop()
示例5: MudMapper
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import initialize [as 别名]
from application import Application as MudMapper
mapper = MudMapper()
mapper.bootstrap()
mapper.initialize()
mapper.show()
mapper.run()