本文整理汇总了Python中application.Application.start方法的典型用法代码示例。如果您正苦于以下问题:Python Application.start方法的具体用法?Python Application.start怎么用?Python Application.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类application.Application
的用法示例。
在下文中一共展示了Application.start方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def start(self, init=True):
"""Start Instance."""
self.path_user_installation = join(self.path_run_dir, \
"cloudooo_instance_%s" % self.port)
if init and exists(self.path_user_installation):
removeDirectory(self.path_user_installation)
# Create command with all parameters to start the instance
self.command = [join(self.office_binary_path, self._bin_soffice),
'-headless',
'-invisible',
'-nocrashreport',
'-nologo',
'-nodefault',
'-norestore',
'-nofirststartwizard',
'-accept=socket,host=%s,port=%d;urp;' % (self.hostname, self.port),
'-env:UserInstallation=file://%s' % self.path_user_installation,
'-language=%s' % self.default_language,
]
# To run soffice.bin, several environment variables should be set.
env = self.environment_dict.copy()
env.setdefault("LANG", "en_US.UTF-8")
env["HOME"] = self.path_user_installation
env["TMP"] = self.path_user_installation
env["TMPDIR"] = self.path_user_installation
self._startProcess(self.command, env)
self._cleanRequest()
Application.start(self)
示例2: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def main():
optParser = OptionParser()
optParser.add_option("-c", "--channel-id", type="int", dest="channelId")
options, args = optParser.parse_args()
channelId = options.channelId or 0
#load server configs
ServerConfigManager.loadConfig()
# start logger
logDirName = "log/gate"
if channelId > 0:
logDirName = "{}-{}".format(logDirName, channelId)
loggerDir = os.path.join(os.getcwd(), logDirName)
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
staticdata.dataloader.loadConfigs()
Logger.logInfo("Loading ImageToken Configs...")
ImageToken.loadConfig()
Logger.logInfo("Loading SMS Configs...")
SMSManager.loadConfig()
Logger.logInfo("Init db connection")
connConfig = os.path.join(parent_dir, "config/dbcache_connection_config.xml")
tableConfig = os.path.join(parent_dir, "staticdata/dbconfig/main_db_config.xml")
if not MongoDatabase.loadConfig(connConfig, tableConfig):
Logger.logInfo("DbCache", "Load MongoDatata Config Failed")
return
app = Application("Gate", channelId)
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting mongodb")
if not MongoDatabase.start():
Logger.logInfo("Starting mongoDb Failed")
return
Logger.logInfo("starting scheduler...")
Scheduler.start()
# load everty thing
loadEveryThing()
# sys command load
Logger.logInfo("starting system command loader...")
SystemCommandLoder.start()
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()
示例3: _get_app_node
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def _get_app_node(self, network_node, app):
assert self._lock.locked()
name = "a%s" % app
if network_node.has_child(name):
return network_node.get_child(name)
# Obviously an app factory based on app id, someday...
application_node = Application()
application_node.configure({"parent": network_node, "name": name, "app": app})
application_node.start()
return application_node
示例4: Application_
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
class Application_():
def __init__(self, address=None, port=None, configFile=None):
self.application = Application(address=address, port=port, configFile=configFile)
Application.application_name = "pricegenerator"
pidfile = self.application.application_name + ".pid"
# fields required by DaemonRunner
self.stdin_path = '/dev/null'
self.stdout_path = '/dev/tty'
self.stderr_path = '/dev/tty'
self.pidfile_path = '/tmp/' + pidfile
self.pidfile_timeout = 5
self.foreground = False
self.application.is_run_ = True
self.application.isdaemon_ = True
def run(self):
self.application.start()
self.application.do_work_()
示例5: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def main():
#load server configs
ServerConfigManager.loadConfig()
# start logger
loggerDir = os.path.join(os.getcwd(), "log/DbCache")
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
if not staticdata.dataloader.loadConfigs():
return
Logger.logInfo("Init db connection")
connConfig = os.path.join(parent_dir, "config/dbcache_connection_config.xml")
tableConfig = os.path.join(parent_dir, "staticdata/dbconfig/main_db_config.xml")
if not MongoDatabase.loadConfig(connConfig, tableConfig):
Logger.logInfo("DbCache", "Load MongoDatata Config Failed")
return
app = Application("DbCache")
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting mongodb")
if not MongoDatabase.start():
Logger.logInfo("Starting mongoDb Failed")
return
# Logger.logInfo("starting scheduler...")
# Scheduler.start()
Logger.logInfo("starting system command loader...")
SystemCommandLoder.start()
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()
示例6: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def main():
ServerConfigManager.loadConfig()
# start logger
loggerDir = os.path.join(os.getcwd(), "log/test")
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
staticdata.dataloader.loadConfigs()
app = Application()
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()
示例7: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def main():
optParser = OptionParser()
optParser.add_option("-c", "--channel-id", type="int", dest="channelId")
options, args = optParser.parse_args()
channelId = options.channelId or 0
#load server configs
ServerConfigManager.loadConfig()
# start logger
logDirName = "log/servicegate"
if channelId > 0:
logDirName = "{}-{}".format(logDirName, channelId)
loggerDir = os.path.join(os.getcwd(), logDirName)
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
staticdata.dataloader.loadConfigs()
Logger.logInfo("Loading ImageToken Configs...")
ImageToken.loadConfig()
Logger.logInfo("Loading SMS Configs...")
SMSManager.loadConfig()
app = Application("Gate", channelId)
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting scheduler...")
Scheduler.start()
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()
示例8: app_start
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def app_start(name, namespace):
app = Application(name, namespace=namespace)
app.start()
示例9: app_run
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import start [as 别名]
def app_run(name, namespace, region, file):
app = Application(name, region, file, namespace)
app.create()
app.start()