示例#1
0
def serve(args):
    if args.config is None:
        args.config = get_default_config()
    os.environ['PASTE_CONFIG_FILE'] = args.config

    cmd = ServeCommand('octomotron serve')
    exit_code = cmd.run([])
    sys.exit(exit_code)
示例#2
0
    def SvcDoRun(self):

        if self.ss.getVirtualEnv():
            activate_virtualenv(self.ss.getVirtualEnv())

        os.chdir(self.ss.getCfgFileDir())
        sys.path.append(self.ss.getCfgFileDir())

        from paste.script.serve import ServeCommand as Server
        s = Server(None)
        args = [self.ss.getCfgFileName()]

        http_port = self.ss.getHttpPort()
        if http_port:
            args.append('http_port=' + str(http_port))

        s.run(args)
        win32event.WaitForSingleObject(self.stop_event, win32event.INFINITE)
示例#3
0
    def SvcDoRun(self):
        
        if self.ss.getVirtualEnv():
            activate_virtualenv(self.ss.getVirtualEnv())

        os.chdir(self.ss.getCfgFileDir())
        sys.path.append(self.ss.getCfgFileDir())

        from paste.script.serve import ServeCommand as Server
        s = Server(None)
        args = [ self.ss.getCfgFileName()]

        http_port = self.ss.getHttpPort()
        if http_port:
            args.append('http_port=' + str(http_port))

        s.run(args) 
        win32event.WaitForSingleObject(self.stop_event, win32event.INFINITE)
示例#4
0
文件: karlctl.py 项目: iotest3/new
def main():
    os.environ['PASTE_CONFIG_FILE'] = get_default_config()

    cmd = ServeCommand('karl')
    cmd.description = """\
    Run the KARL application.

    If start/stop/restart is given, then --daemon is implied, and it will
    start (normal operation), stop (--stop-daemon), or do both.

    You can also include variable assignments like 'http_port=8080'
    and then use %(http_port)s in your config files.
    """
    exit_code = cmd.run(sys.argv[1:])
    sys.exit(exit_code)
示例#5
0
    def SvcDoRun(self):
        # required to find some DLLs that extentions need
        os.add_dll_directory(os.path.join(sys.prefix, "DLLs"))
        os.add_dll_directory(sys.prefix)

        env = self.ss.getVirtualEnv()
        if env:
            activate_virtualenv(env)

        sys.dont_write_bytecode = True
        os.chdir(self.ss.getCfgFileDir())
        sys.path.append(self.ss.getCfgFileDir())

        from paste.script.serve import ServeCommand as Server

        s = Server(None)
        args = [self.ss.getCfgFileName()]

        http_port = self.ss.getHttpPort()
        if http_port:
            args.append("http_port=" + str(http_port))

        s.run(args)
        win32event.WaitForSingleObject(self.stop_event, win32event.INFINITE)
示例#6
0
 def SvcDoRun(self):
     os.chdir(SCRIPT_DIR)
     s = Server(SERV_APPLICATION)
     os.environ[SERV_LOG_FILE_VAR] = self.logFile
     s.run([self.iniFile])
     win32event.WaitForSingleObject(self.stop_event, win32event.INFINITE)
示例#7
0
文件: serve.py 项目: chrisrossi/jove
def main(args):
    os.environ['PASTE_CONFIG_FILE'] = args.config

    cmd = ServeCommand('jove serve')
    exit_code = cmd.run([])
    sys.exit(exit_code)