本文整理汇总了Python中application.Application.stop方法的典型用法代码示例。如果您正苦于以下问题:Python Application.stop方法的具体用法?Python Application.stop怎么用?Python Application.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类application.Application
的用法示例。
在下文中一共展示了Application.stop方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: stop
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import stop [as 别名]
def stop(self):
"""Stop the instance by pid. By the default
the signal is 15."""
Application.stop(self)
if socketStatus(self.hostname, self.port):
self._releaseOpenOfficePort()
self._cleanRequest()
示例2: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import stop [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: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import stop [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()
示例4: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import stop [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()
示例5: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import stop [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()
示例6: app_stop
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import stop [as 别名]
def app_stop(name, namespace):
app = Application(name, namespace=namespace)
app.stop()