コード例 #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
ファイル: 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)
コード例 #3
0
ファイル: serve.py プロジェクト: cajun-code/pecan
 def command(self):
     
     # set defaults for removed options
     setattr(self.options, 'app_name', None)
     setattr(self.options, 'server', None)
     setattr(self.options, 'server_name', None)
     
     # for file-watching to work, we need a filename, not a module
     if self.requires_config_file and self.args:
         self.config = self.load_configuration(self.args[0])
         self.args[0] = self.config.__file__
         if self.options.reload is None:
             self.options.reload = getattr(self.config.app, 'reload', False)
     
     # run the base command
     _ServeCommand.command(self)
コード例 #4
0
ファイル: serve.py プロジェクト: westurner/workhours
def main(*args, **kwargs):
    import os
    this_file = '%s/bin/activate_this.py' % os.environ['VIRTUAL_ENV']
    execfile(this_file, dict(__file__=this_file))

    from paste.script.serve import ServeCommand

    ServeCommand("serve")  #.run(["development.ini"])
コード例 #5
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)
コード例 #6
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)
コード例 #7
0
    def __init__(self, *args, **kwargs):

        ServeCommand.__init__(self, *args, **kwargs)
        self.parser.add_option('--host',
                               dest='host',
                               metavar='HOST',
                               help="host server address")
        self.parser.add_option('--port',
                               dest='port',
                               default=8080,
                               metavar='PORT',
                               help="Http server port")
        self.parser.add_option('--generation-path',
                               dest='generation_path',
                               default=os.path.join(os.getcwd(), 'generated_projects'),
                               metavar='GENERATIONPATH',
                               help="where to generate projects")

        self.parser.add_option('--debug',
                               dest='debug',
                               action="store_true",
                               metavar='DEBUG',
                               help="Run cgwb in debug mode")
コード例 #8
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)
コード例 #9
0
def serve_app(args=None, default_config=''):
    config = default_config
    type = 'prod'

    # Load from comand line if we didn't get them as params.
    if args is None:
        import sys
        args = sys.argv[1:]

    # Load values from args if available.
    if len(args) > 0:
        config = args[0]
    if len(args) > 1:
        type = args[1]

    # Add the reload param if developing.
    if type == 'prod':
        params = [config]
    else:
        params = ["--reload", config]

    ServeCommand("serve").run(params)
コード例 #10
0
ファイル: wsgi.py プロジェクト: audip/lunr
 def __init__(self, name):
     self.name = name if name != '__main__' else None
     ServeCommand.__init__(self, '')
コード例 #11
0
from paste.script.serve import ServeCommand
ServeCommand("serve").run(["development.ini"])
コード例 #12
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)
コード例 #13
0
"""NDG OAuth 2.0 

Example paster script to run short-lived credential service example client app
"""
__author__ = "Philip Kershaw"
__date__ = "24/08/12"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "*****@*****.**"
__revision__ = "$Id$"
from paste.script.serve import ServeCommand

ServeCommand("serve").run(["./slcs_client_app.ini"])
コード例 #14
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)
コード例 #15
0
ファイル: run.py プロジェクト: sleeepyjack/SAUCE
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Start the Paster server

Given command line arguments will be passed through
'''
#
## SAUCE - System for AUtomated Code Evaluation
## Copyright (C) 2013 Moritz Schlarb
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU Affero General Public License for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import sys
from paste.script.serve import ServeCommand

if __name__ == '__main__':
    ServeCommand("serve").run(sys.argv[1:] or ['--reload', 'development.ini'])
コード例 #16
0
## SAUCE - System for AUtomated Code Evaluation
## Copyright (C) 2013 Moritz Schlarb
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU Affero General Public License for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
'''Start the Paster server

Given command line arguments will be passed through
'''

import sys
from paste.script.serve import ServeCommand

if __name__ == '__main__':
    if len(sys.argv) == 1:
        args = ['--reload', 'development.ini']
    else:
        args = sys.argv[1:]
    ServeCommand("serve").run(args)
コード例 #17
0
ファイル: wsgi.py プロジェクト: pombredanne/lunr
 def __init__(self, name):
     self.name = name if name != '__main__' else None
     ServeCommand.__init__(self, '')
コード例 #18
0
"""NDG OAuth 2.0 

Example paster script to run bearer token example client app
"""
__author__ = "Philip Kershaw"
__date__ = "24/08/12"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "*****@*****.**"
__revision__ = "$Id$"
from paste.script.serve import ServeCommand

ServeCommand("serve").run(["./bearer_tok_client_app.ini"])
コード例 #19
0
 def parse_args(self, *a, **k):
     ServeCommand.parse_args(self, *a, **k)
     if self.options.debug:
         self.args.append('debug=true')
     self.args.append('generation_path=%s'%self.options.generation_path)
コード例 #20
0
#!/usr/lib/ckan/default/bin paster

from paste.script.serve import ServeCommand

ServeCommand("serve").run(["/etc/ckan/default/development.ini"])