mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Revert script changes unrelated to uWSGI mule work. Includes
galaxy.util.script so that get_uwsgi_args.py still works, but that will be PR'd separately and merged later.
This commit is contained in:
@@ -8,9 +8,9 @@ from six.moves import shlex_quote
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
|
||||
|
||||
from galaxy.script import main_factory
|
||||
from galaxy.util.path import get_ext
|
||||
from galaxy.util.properties import load_app_properties, nice_config_parser
|
||||
from galaxy.util.script import main_factory
|
||||
|
||||
|
||||
DESCRIPTION = "Script to determine uWSGI command line arguments"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import argparse
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
@@ -9,17 +10,44 @@ from galaxy.config import (
|
||||
find_root,
|
||||
parse_dependency_options,
|
||||
)
|
||||
from galaxy.script import main_factory
|
||||
from galaxy.tools.deps import CachedDependencyManager, DependencyManager, NullDependencyManager
|
||||
from galaxy.util.properties import find_config_file, load_app_properties
|
||||
|
||||
DESCRIPTION = "Script to manage tool dependencies (with focus on a Conda environments)."
|
||||
|
||||
|
||||
def _init_if_needed(args, kwargs):
|
||||
def main(argv=None):
|
||||
"""Entry point for conversion process."""
|
||||
if argv is None:
|
||||
argv = sys.argv[1:]
|
||||
args = _arg_parser().parse_args(argv)
|
||||
action = args.action
|
||||
action_func = ACTIONS[action]
|
||||
action_func(args)
|
||||
|
||||
|
||||
def _init_if_needed(args):
|
||||
kwargs = _app_properties(args)
|
||||
|
||||
# If conda_auto_init is set, simply building the Conda resolver will call handle installation.
|
||||
_build_dependency_manager_no_config(kwargs)
|
||||
|
||||
|
||||
def _app_properties(args):
|
||||
config_file = find_config_file("config/galaxy.ini", "universe_wsgi.ini", args.config_file)
|
||||
app_properties = load_app_properties(ini_file=config_file)
|
||||
return app_properties
|
||||
|
||||
|
||||
def _arg_parser():
|
||||
parser = argparse.ArgumentParser(description=DESCRIPTION)
|
||||
parser.add_argument('action', metavar='ACTION', type=str,
|
||||
choices=ACTIONS.keys(),
|
||||
help='action to perform')
|
||||
parser.add_argument("-c", "--config-file", default=None)
|
||||
return parser
|
||||
|
||||
|
||||
def _build_dependency_manager_no_config(kwargs):
|
||||
"""Simplified variant of build_dependency_manager from galaxy.tools.deps.
|
||||
|
||||
@@ -56,5 +84,4 @@ ACTIONS = {
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main = main_factory(description=DESCRIPTION, actions=ACTIONS)
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user