コード例 #1
0
ファイル: serve.py プロジェクト: chrisrossi/octomotron
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
ファイル: wsgisvc.py プロジェクト: OpenCIOC/featuretracker
    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
ファイル: wsgisvc.py プロジェクト: OpenCIOC/onlineresources
    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)