Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pulsar/web/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import atexit
import inspect
import logging
import os

import pulsar.web.routes
from pulsar.core import PulsarApp
Expand All @@ -10,11 +11,14 @@
log = logging.getLogger(__name__)


def app_factory(global_conf, **local_conf):
def app_factory(global_conf=None, **local_conf):
"""
Returns the Pulsar WSGI application.
"""
configuration_file = global_conf.get("__file__", None)
if global_conf:
configuration_file = global_conf.get("__file__")
else:
configuration_file = os.environ.get("PULSAR_CONFIG_FILE")
webapp = init_webapp(ini_path=configuration_file, local_conf=local_conf)
return webapp

Expand Down
8 changes: 4 additions & 4 deletions scripts/pulsar
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ then
elif hash chaussette 2>/dev/null; then
MODE="chaussette"
else
MODE="paster"
MODE="granian"
fi
fi

Expand All @@ -129,9 +129,9 @@ elif [ "$MODE" == "circusd" ]; then
elif [ "$MODE" == "chaussette" ]; then
echo "Attempting to use chaussette instead of paster, you must specify port on command-line (--port 8913)."
chaussette "paste:$PULSAR_CONFIG_FILE" "$@"
elif [ "$MODE" == "paster" ]; then
echo "Starting pulsar with command [paster server \"$PULSAR_CONFIG_FILE\" \"$@\"]"
paster serve "$PULSAR_CONFIG_FILE" "$@"
elif [ "$MODE" == "granian" ]; then
echo "Starting pulsar with command [PULSAR_CONFIG_FILE=\"$PULSAR_CONFIG_FILE\" granian --access-log --interface wsgi --factory "pulsar.web.wsgi:app_factory" \"$PULSAR_CONFIG_FILE\" \"$@\"]"
PULSAR_CONFIG_FILE="$PULSAR_CONFIG_FILE" granian --access-log --interface wsgi --factory "pulsar.web.wsgi:app_factory" "$@"
elif [ "$MODE" == "webless" ]; then
if hash pulsar-main 2>/dev/null; then
# Running from pip install since
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
install_requires=requirements,
extras_require={
'amqp': ['kombu'],
'web': ['Paste', 'PasteScript'],
'web': ['granian'],
'galaxy_extended_metadata': ['galaxy-job-execution', 'galaxy-util[template]'],
},
license="Apache License 2.0",
Expand Down
Loading