コード例 #1
0
ファイル: healthMapGirder.py プロジェクト: jbeezley/healthMap
def setupGirder():
    server.setup()
    model = model_importer.ModelImporter()
    models = {
            'user': model.model('user'),
            'group': model.model('group'),
            'collection': model.model('collection'),
            'folder': model.model('folder'),
            'item': model.model('item')
        }
    return models
コード例 #2
0
ファイル: serve.py プロジェクト: xinlaoda/girder
def main(testing, database, host, port):
    if database:
        cherrypy.config['database']['uri'] = database
    if host:
        cherrypy.config['server.socket_host'] = host
    if port:
        cherrypy.config['server.socket_port'] = port
    server.setup(testing)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #3
0
ファイル: serve.py プロジェクト: data-exp-lab/girder
def main(testing, database, host, port):
    if database:
        cherrypy.config['database']['uri'] = database
    if host:
        cherrypy.config['server.socket_host'] = host
    if port:
        cherrypy.config['server.socket_port'] = port
    server.setup(testing)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #4
0
ファイル: serve.py プロジェクト: wegiangb/girder
def main(testing, database, host, port):
    # If the user provides no options, the existing config values get re-set through click
    cherrypy.config['database']['uri'] = database
    if six.PY2:
        # On Python 2, click returns the value as unicode and CherryPy expects a str
        # Keep this conversion explicitly for Python 2 only, so it can be removed when Python 2
        # support is dropped
        host = str(host)
    cherrypy.config['server.socket_host'] = host
    cherrypy.config['server.socket_port'] = port

    _attachFileLogHandlers()
    server.setup(testing)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #5
0
ファイル: serve.py プロジェクト: girder/girder
def main(testing, database, host, port):
    # If the user provides no options, the existing config values get re-set through click
    cherrypy.config['database']['uri'] = database
    if six.PY2:
        # On Python 2, click returns the value as unicode and CherryPy expects a str
        # Keep this conversion explicitly for Python 2 only, so it can be removed when Python 2
        # support is dropped
        host = str(host)
    cherrypy.config['server.socket_host'] = host
    cherrypy.config['server.socket_port'] = port

    _attachFileLogHandlers()
    server.setup(testing)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #6
0
def main(dev, mode, database, host, port):
    if dev and mode:
        raise click.ClickException('Conflict between --dev and --mode')
    if dev:
        mode = ServerMode.DEVELOPMENT

    # If the user provides no options, the existing config values get re-set through click
    cherrypy.config['database']['uri'] = database
    cherrypy.config['server.socket_host'] = host
    cherrypy.config['server.socket_port'] = port

    _attachFileLogHandlers()
    server.setup(mode)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #7
0
def main(testing, database, host, port):
    if database:
        cherrypy.config['database']['uri'] = database
    if host:
        cherrypy.config['server.socket_host'] = host
    if port:
        cherrypy.config['server.socket_port'] = port

    ### pvWeb add ssl for https  ###
    # cherrypy.config['server.ssl_module'] = 'builtin'
    # cherrypy.config['server.ssl_certificate'] = '/opt/histomicstk/girder/girder/cli/cert.pem'
    # cherrypy.config['server.ssl_private_key'] = '/opt/histomicstk/girder/girder/cli/privkey.pem'

    server.setup(testing)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #8
0
ファイル: __main__.py プロジェクト: 0x414A/girder
def main():
    parser = argparse.ArgumentParser(
        description='Girder: data management platform for the web.')
    parser.add_argument("-t", "--testing", help="run in testing mode",
                        action="store_true")
    parser.add_argument("-d", "--database",
                        help="to what database url should Girder connect")
    parser.add_argument("-p", "--port",
                        help="on what port should Girder serve")
    args = parser.parse_args()
    if args.database:
        cherrypy.config['database']['uri'] = args.database
    if args.port:
        cherrypy.config['server.socket_port'] = int(args.port)
    server.setup(args.testing)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #9
0
ファイル: __main__.py プロジェクト: iwillcodeu/girder
def main():
    parser = argparse.ArgumentParser(
        description='Girder: data management platform for the web.')
    parser.add_argument("-t", "--testing", help="run in testing mode",
                        action="store_true")
    parser.add_argument("-d", "--database",
                        help="to what database url should Girder connect")
    parser.add_argument("-H", "--host", help="on what host should Girder serve")
    parser.add_argument("-p", "--port",
                        help="on what port should Girder serve")
    args = parser.parse_args()
    if args.database:
        cherrypy.config['database']['uri'] = args.database
    if args.host:
        cherrypy.config['server.socket_host'] = args.host
    if args.port:
        cherrypy.config['server.socket_port'] = int(args.port)
    server.setup(args.testing)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #10
0
ファイル: wsgi.py プロジェクト: xinlaoda/girder
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
###############################################################################

import cherrypy
from girder.utility import config, server

config.loadConfig(
)  # Read the config files first, so we can override some values
cherrypy.config.update({
    'engine.autoreload.on': False,
    'environment': 'embedded'
})
cherrypy.config['server'].update({
    'cherrypy_server': False,
    'disable_event_daemon': True
})

# 'application' is the default callable object for WSGI implementations, see PEP 3333 for more.
server.setup()
application = cherrypy.tree

cherrypy.server.unsubscribe()
cherrypy.engine.start()
コード例 #11
0
ファイル: __main__.py プロジェクト: dsa-code/girder
###############################################################################
#  Copyright 2013 Kitware Inc.
#
#  Licensed under the Apache License, Version 2.0 ( the "License" );
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
###############################################################################

import sys  # pragma: no cover
import cherrypy  # pragma: no cover

from girder.utility import server  # pragma: no cover

if __name__ == '__main__':  # pragma: no cover
    if len(sys.argv) > 1 and sys.argv[1] == 'test':
        test = True
    else:
        test = False
    server.setup(test)

    cherrypy.engine.start()
    cherrypy.engine.block()
コード例 #12
0
ファイル: wsgi.py プロジェクト: psavery/girder
#  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
###############################################################################

import cherrypy
from girder.utility import config, server

config.loadConfig(
)  # Read the config files first, so we can override some values
cherrypy.config.update({
    'engine.autoreload.on': False,
    'environment': 'embedded'
})
cherrypy.config['server'].update({
    'cherrypy_server': False,
    'disable_event_daemon': True
})

# 'application' is the default callable object for WSGI implementations, see PEP 3333 for more.
application = server.setup()

cherrypy.server.unsubscribe()
cherrypy.engine.start()
コード例 #13
0
ファイル: wsgi.py プロジェクト: girder/girder
# -*- coding: utf-8 -*-
import cherrypy
import girder
from girder.utility import server

cherrypy.config.update({'engine.autoreload.on': False,
                        'environment': 'embedded'})
cherrypy.config['server'].update({'disable_event_daemon': True})

# TODO The below line can be removed if we do away with girder.logprint
girder._quiet = True  # This means we won't duplicate messages to stdout/stderr
_formatter = girder.LogFormatter('[%(asctime)s] %(levelname)s: %(message)s')
_handler = cherrypy._cplogging.WSGIErrorHandler()
_handler.setFormatter(_formatter)
girder.logger.addHandler(_handler)

# 'application' is the default callable object for WSGI implementations, see PEP 3333 for more.
server.setup()
application = cherrypy.tree

cherrypy.server.unsubscribe()
cherrypy.engine.start()
コード例 #14
0
ファイル: wsgi.py プロジェクト: adsorensen/girder
# -*- coding: utf-8 -*-

###############################################################################
#  Copyright 2017 Kitware Inc.
#
#  Licensed under the Apache License, Version 2.0 ( the "License" );
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
###############################################################################

import cherrypy
from girder.utility import server

cherrypy.config.update({'engine.autoreload.on': False,
                        'environment': 'embedded'})
cherrypy.config['server'].update({'cherrypy_server': False})

# 'application' is the default callable object for WSGI implementations, see PEP 3333 for more.
application = server.setup()

cherrypy.server.unsubscribe()
cherrypy.engine.start()