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


Python Application.start方法代码示例

本文整理汇总了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)
开发者ID:Seb182,项目名称:cloudooo,代码行数:30,代码来源:openoffice.py

示例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()
开发者ID:bropony,项目名称:gamit,代码行数:61,代码来源:gate.py

示例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
开发者ID:,项目名称:,代码行数:12,代码来源:

示例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_()
开发者ID:akalingking,项目名称:PriceGenerator,代码行数:21,代码来源:pricegeneratord.py

示例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()
开发者ID:bropony,项目名称:gamit,代码行数:43,代码来源:dbcache.py

示例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()
开发者ID:bropony,项目名称:gamit,代码行数:23,代码来源:client_test.py

示例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()
开发者ID:bropony,项目名称:gamit,代码行数:42,代码来源:servicegate.py

示例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()
开发者ID:jianghaishanyue,项目名称:alauda-CLI,代码行数:5,代码来源:commands.py

示例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()
开发者ID:jianghaishanyue,项目名称:alauda-CLI,代码行数:6,代码来源:commands.py


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