本文整理汇总了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()
示例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()