当前位置: 首页>>代码示例>>Python>>正文


Python Application.initialize方法代码示例

本文整理汇总了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
开发者ID:michael-donat,项目名称:MudMapper,代码行数:9,代码来源:test_controllerMap.py

示例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()
开发者ID:p-v-o-s,项目名称:olm-pstat,代码行数:52,代码来源:main.py

示例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()
开发者ID:gaborpapp,项目名称:AIam,代码行数:32,代码来源:single_learning_avatar.py

示例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()
开发者ID:gaborpapp,项目名称:AIam,代码行数:32,代码来源:learn_recall_improvise.py

示例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()
开发者ID:michael-donat,项目名称:MudMapper,代码行数:9,代码来源:MudMapper.py


注:本文中的application.Application.initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。