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


Python Application.load方法代码示例

本文整理汇总了Python中application.Application.load方法的典型用法代码示例。如果您正苦于以下问题:Python Application.load方法的具体用法?Python Application.load怎么用?Python Application.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在application.Application的用法示例。


在下文中一共展示了Application.load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import load [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

示例2: application

# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import load [as 别名]
pp.pprint(res1)
res2 = db.execute_commit("INSERT INTO application (name, description) VALUES ('test2', 'cooliojeans')")
pp.pprint(res2)
#res3 = db.execute_select("SELECT * FROM test WHERE id = 1")
#pp.pprint(res3)
#res4 = db.execute_select("SELECT * FROM test WHERE id = 2")
#pp.pprint(res4)
#res4 = db.execute_select("SELECT * FROM test WHERE id = 2")
#pp.pprint(res4)



app = Application()
app.name = 'hi'
app.description = 'lol!'
app.links = 'cool!'

app.save()
print('Saved SERIAL id', app.id)

newapp = Application.load(app.id)
print('Loaded id', newapp.id, newapp)
newapp.name = 'yo'
newapp.save()

newerapp = Application.load(app.id)
print('Loaded id again', newapp.id, newerapp)
print(newerapp.name)

db.close()
开发者ID:cfebs,项目名称:keybinder,代码行数:32,代码来源:test.py


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