Пример #1
0
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
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
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
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
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
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
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
#
#    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
###############################################################################
#  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
#  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
# -*- 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
# -*- 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()