mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Merge pull request #5215 from nsoranzo/python3
Python3: finish first pass on whole codebase
This commit is contained in:
@@ -1,84 +0,0 @@
|
||||
client/galaxy/style/source_material/circle.py
|
||||
contrib/
|
||||
cron/
|
||||
doc/parse_gx_xsd.py
|
||||
doc/patch.py
|
||||
lib/galaxy/actions/
|
||||
lib/galaxy/auth/
|
||||
lib/galaxy/config.py
|
||||
lib/galaxy/containers/
|
||||
lib/galaxy/dataset_collections/
|
||||
lib/galaxy/datatypes/
|
||||
lib/galaxy/dependencies/
|
||||
lib/galaxy/eggs/
|
||||
lib/galaxy/exceptions/
|
||||
lib/galaxy/external_services/
|
||||
lib/galaxy/forms/
|
||||
lib/galaxy/jobs/
|
||||
lib/galaxy/managers/
|
||||
lib/galaxy/model/
|
||||
lib/galaxy/objectstore/
|
||||
lib/galaxy/openid/
|
||||
lib/galaxy/quota/
|
||||
lib/galaxy/sample_tracking/
|
||||
lib/galaxy/security/
|
||||
lib/galaxy/tags/
|
||||
lib/galaxy/tools/
|
||||
lib/galaxy/tours/
|
||||
lib/galaxy/util/
|
||||
lib/galaxy/visualization/
|
||||
lib/galaxy/web/
|
||||
lib/galaxy/webapps/galaxy/api/histories.py
|
||||
lib/galaxy/webapps/galaxy/api/library_datasets.py
|
||||
lib/galaxy/webapps/galaxy/api/tours.py
|
||||
lib/galaxy/webapps/galaxy/api/users.py
|
||||
lib/galaxy/webapps/galaxy/api/workflows.py
|
||||
lib/galaxy/webapps/galaxy/buildapp.py
|
||||
lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
|
||||
lib/galaxy/webapps/galaxy/controllers/external_services.py
|
||||
lib/galaxy/webapps/galaxy/controllers/forms.py
|
||||
lib/galaxy/webapps/galaxy/controllers/history.py
|
||||
lib/galaxy/webapps/galaxy/controllers/library_common.py
|
||||
lib/galaxy/webapps/galaxy/controllers/search.py
|
||||
lib/galaxy/webapps/galaxy/controllers/userskeys.py
|
||||
lib/galaxy/webapps/reports/config.py
|
||||
lib/galaxy/webapps/reports/controllers/tools.py
|
||||
lib/galaxy/webapps/reports/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/config.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/groups.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/user.py
|
||||
lib/galaxy/webapps/tool_shed/framework/middleware/remoteuser.py
|
||||
lib/galaxy/webapps/tool_shed/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/model/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/search/repo_search.py
|
||||
lib/galaxy/webapps/tool_shed/util/ratings_util.py
|
||||
lib/galaxy/webhooks/
|
||||
lib/galaxy/work/
|
||||
lib/galaxy/workflow/
|
||||
lib/galaxy_ext/
|
||||
lib/log_tempfile.py
|
||||
lib/mimeparse.py
|
||||
lib/psyco_full.py
|
||||
lib/tool_shed/
|
||||
scripts/api/
|
||||
scripts/auth/
|
||||
scripts/bootstrap_history.py
|
||||
scripts/build_toolbox.py
|
||||
scripts/check_eggs.py
|
||||
scripts/check_galaxy.py
|
||||
scripts/check_python.py
|
||||
scripts/cleanup_datasets/
|
||||
scripts/communication/
|
||||
scripts/data_libraries/build_whoosh_index.py
|
||||
scripts/db_shell.py
|
||||
scripts/drmaa_external_runner.py
|
||||
scripts/metagenomics/
|
||||
scripts/microbes/BeautifulSoup.py
|
||||
scripts/microbes/harvest_bacteria.py
|
||||
scripts/secret_decoder_ring.py
|
||||
scripts/tool_shed/api/common.py
|
||||
scripts/tool_shed/build_ts_whoosh_index.py
|
||||
scripts/tool_shed/deprecate_repositories_without_metadata.py
|
||||
test/
|
||||
tool_list.py
|
||||
tools/
|
||||
@@ -174,7 +174,7 @@ class TourGenerator(object):
|
||||
elif input.type == 'select':
|
||||
params = []
|
||||
if name in test_inputs:
|
||||
for option in self._tool.inputs[name].static_options:
|
||||
for option in input.static_options:
|
||||
for test_option in self._test.inputs[name]:
|
||||
if test_option == option[1]:
|
||||
params.append(option[0])
|
||||
|
||||
@@ -46,7 +46,7 @@ SWARM_MANAGER_CONF_DEFAULTS = {
|
||||
'service_wait_count_limit': 0,
|
||||
'service_wait_time_limit': 5,
|
||||
'slots_min_limit': 0,
|
||||
'slots_max_limit': sys.maxint,
|
||||
'slots_max_limit': sys.maxsize,
|
||||
'slots_min_spare': 0,
|
||||
'node_idle_limit': 120,
|
||||
'limits': [],
|
||||
@@ -137,7 +137,7 @@ class SwarmManager(object):
|
||||
state = node_state['state']
|
||||
if not nodes:
|
||||
nodes = self._docker_interface.nodes()
|
||||
node = (filter(lambda x: x.name == name, nodes) + [None])[0]
|
||||
node = ([x for x in nodes if x.name == name] + [None])[0]
|
||||
if not node:
|
||||
if elapsed > self._conf.spawn_wait_time:
|
||||
log.warning("spawning node '%s' not found in `docker node ls` and spawn_wait_time exceeded! %d seconds have elapsed", name, elapsed)
|
||||
|
||||
@@ -449,7 +449,7 @@ class ImzML(Binary):
|
||||
def generate_primary_file(self, dataset=None):
|
||||
rval = ['<html><head><title>imzML Composite Dataset </title></head><p/>']
|
||||
rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).items():
|
||||
fn = composite_name
|
||||
opt_text = ''
|
||||
if composite_file.get('description'):
|
||||
@@ -493,7 +493,7 @@ class Analyze75(Binary):
|
||||
def generate_primary_file(self, dataset=None):
|
||||
rval = ['<html><head><title>Analyze75 Composite Dataset.</title></head><p/>']
|
||||
rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).items():
|
||||
fn = composite_name
|
||||
opt_text = ''
|
||||
if composite_file.optional:
|
||||
|
||||
@@ -35,7 +35,7 @@ SQLAlchemy==1.0.15 --hash:sha256=7cbac295f87d2af82aac08346b52f72d0b0c00712290495
|
||||
--hash:sha256=f819742f33ae543ca2c48bc43e35bd75372f7c3e379e4881f9040549d3df94b6 \
|
||||
--hash:sha256=fce29753f720f8a6920185bd5a4d1670fa6b6936819475197b2bce7644243766 \
|
||||
--hash:sha256=aa8843df6869f6c999400ae32de5480fba1b7711fe535c168a14225ffd1d3de4
|
||||
mercurial==3.7.3 --hash:sha256=49f596820f005ac6f94266b89a0dbd815c0ee0aacd3aa86545dc39fb349ea4bf \
|
||||
mercurial==3.7.3; python_version < '3.0' --hash:sha256=49f596820f005ac6f94266b89a0dbd815c0ee0aacd3aa86545dc39fb349ea4bf \
|
||||
--hash:sha256=75f5b6b708bec2d6e0e68ec8912725a5dcac42df00b122fa73a8c4bd21495039 \
|
||||
--hash:sha256=8c07cb3404d26641d8829099bd1047582b76def49eca067ba6bea9a73d261775 \
|
||||
--hash:sha256=6a05bf22101b79b5f56421f7a1c6d301000f759f0114827f37cc9f847c1ab352 \
|
||||
|
||||
@@ -7,7 +7,7 @@ MarkupSafe==1.0
|
||||
PyYAML==3.12
|
||||
SQLAlchemy==1.0.15
|
||||
sqlalchemy-utils==0.32.19
|
||||
mercurial==3.7.3
|
||||
mercurial==3.7.3; python_version < '3.0'
|
||||
pycrypto==2.6.1
|
||||
uWSGI==2.0.15
|
||||
# Flexible BAM index naming is new to core pysam
|
||||
|
||||
@@ -5,7 +5,7 @@ bx-python
|
||||
MarkupSafe
|
||||
PyYAML
|
||||
SQLAlchemy
|
||||
mercurial
|
||||
mercurial; python_version < '3.0'
|
||||
pycrypto
|
||||
# Flexible BAM index naming is new to main pysam
|
||||
pysam>=0.13
|
||||
|
||||
@@ -5,11 +5,11 @@ import datetime
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
from Queue import (
|
||||
|
||||
from six.moves.queue import (
|
||||
Empty,
|
||||
Queue
|
||||
)
|
||||
|
||||
from sqlalchemy.sql.expression import (
|
||||
and_,
|
||||
func,
|
||||
@@ -343,7 +343,7 @@ class JobHandlerQueue(Monitors, object):
|
||||
if not self.track_jobs_in_database:
|
||||
self.waiting_jobs = new_waiting_jobs
|
||||
# Remove cached wrappers for any jobs that are no longer being tracked
|
||||
for id in self.job_wrappers.keys():
|
||||
for id in list(self.job_wrappers.keys()):
|
||||
if id not in new_waiting_jobs:
|
||||
del self.job_wrappers[id]
|
||||
# Flush, if we updated the state
|
||||
@@ -896,7 +896,7 @@ class DefaultJobDispatcher(object):
|
||||
job_wrapper.fail(DEFAULT_JOB_PUT_FAILURE_MESSAGE)
|
||||
|
||||
def shutdown(self):
|
||||
for runner in self.job_runners.itervalues():
|
||||
for runner in self.job_runners.values():
|
||||
try:
|
||||
runner.shutdown()
|
||||
except Exception:
|
||||
|
||||
@@ -232,7 +232,7 @@ class ChronosJobRunner(AsynchronousJobRunner):
|
||||
|
||||
def parse_destination_params(self, params):
|
||||
parsed_params = {}
|
||||
for k, spec in self.DESTINATION_PARAMS_SPEC.iteritems():
|
||||
for k, spec in self.DESTINATION_PARAMS_SPEC.items():
|
||||
value = params.get(k, spec.get('default'))
|
||||
map_to = spec.get('map_name')
|
||||
mapper = spec.get('map')
|
||||
@@ -264,7 +264,7 @@ class ChronosJobRunner(AsynchronousJobRunner):
|
||||
|
||||
def _retrieve_job(self, job_id):
|
||||
jobs = self._chronos_client.list()
|
||||
job = filter((lambda x: x['name'] == job_id), jobs)
|
||||
job = [x for x in jobs if x['name'] == job_id]
|
||||
if len(job) > 1:
|
||||
msg = 'Multiple jobs found with name {name!r}'.format(name=job_id)
|
||||
LOGGER.error(msg)
|
||||
|
||||
@@ -373,10 +373,10 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
|
||||
Return dictionary containing new-style display app urls.
|
||||
"""
|
||||
display_apps = []
|
||||
for display_app in hda.get_display_applications(trans).itervalues():
|
||||
for display_app in hda.get_display_applications(trans).values():
|
||||
|
||||
app_links = []
|
||||
for link_app in display_app.links.itervalues():
|
||||
for link_app in display_app.links.values():
|
||||
app_links.append({
|
||||
'target': link_app.url.get('target_frame', '_blank'),
|
||||
'href': link_app.get_display_url(hda, trans),
|
||||
|
||||
@@ -413,7 +413,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
else:
|
||||
inputs = step.module.get_runtime_inputs(connections=step.output_connections)
|
||||
step_model = {
|
||||
'inputs' : [input.to_dict(trans) for input in inputs.itervalues()]
|
||||
'inputs' : [input.to_dict(trans) for input in inputs.values()]
|
||||
}
|
||||
step_model['step_type'] = step.type
|
||||
step_model['step_label'] = step.label
|
||||
@@ -713,7 +713,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
# tools. This should be removed at some point. Mirrored
|
||||
# hack in _workflow_from_dict should never be removed so
|
||||
# existing workflow exports continue to function.
|
||||
for input_name, input_conn in dict(input_conn_dict).iteritems():
|
||||
for input_name, input_conn in dict(input_conn_dict).items():
|
||||
if len(input_conn) == 1:
|
||||
input_conn_dict[input_name] = input_conn[0]
|
||||
step_dict['input_connections'] = input_conn_dict
|
||||
@@ -790,7 +790,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
supplied_steps = data['steps']
|
||||
# Try to iterate through imported workflow in such a way as to
|
||||
# preserve step order.
|
||||
step_indices = supplied_steps.keys()
|
||||
step_indices = list(supplied_steps.keys())
|
||||
try:
|
||||
step_indices = sorted(step_indices, key=int)
|
||||
except ValueError:
|
||||
@@ -927,7 +927,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
"""
|
||||
for step in steps:
|
||||
# Input connections
|
||||
for input_name, conn_list in step.temp_input_connections.iteritems():
|
||||
for input_name, conn_list in step.temp_input_connections.items():
|
||||
if not conn_list:
|
||||
continue
|
||||
if not isinstance(conn_list, list): # Older style singleton connection
|
||||
|
||||
@@ -4,6 +4,8 @@ Contains OpenID provider functionality
|
||||
import logging
|
||||
import os
|
||||
|
||||
import six
|
||||
|
||||
from galaxy.util import parse_xml, string_as_bool
|
||||
from galaxy.util.odict import odict
|
||||
|
||||
@@ -87,7 +89,7 @@ class OpenIDProvider(object):
|
||||
|
||||
def post_authentication(self, trans, openid_manager, info):
|
||||
sreg_attributes = openid_manager.get_sreg(info)
|
||||
for store_pref_name, store_pref_value_name in self.store_user_preference.iteritems():
|
||||
for store_pref_name, store_pref_value_name in self.store_user_preference.items():
|
||||
if store_pref_value_name in (self.sreg_optional + self.sreg_required):
|
||||
trans.user.preferences[store_pref_name] = sreg_attributes.get(store_pref_value_name)
|
||||
else:
|
||||
@@ -129,10 +131,10 @@ class OpenIDProviders(object):
|
||||
self.providers = providers
|
||||
else:
|
||||
self.providers = odict()
|
||||
self._banned_identifiers = [provider.op_endpoint_url for provider in self.providers.itervalues() if provider.never_associate_with_user]
|
||||
self._banned_identifiers = [provider.op_endpoint_url for provider in self.providers.values() if provider.never_associate_with_user]
|
||||
|
||||
def __iter__(self):
|
||||
for provider in self.providers.itervalues():
|
||||
for provider in six.itervalues(self.providers):
|
||||
yield provider
|
||||
|
||||
def get(self, name, default=None):
|
||||
|
||||
@@ -339,7 +339,7 @@ class DefaultToolState(object):
|
||||
"""
|
||||
self.inputs = {}
|
||||
context = ExpressionContext(self.inputs)
|
||||
for input in tool.inputs.itervalues():
|
||||
for input in tool.inputs.values():
|
||||
self.inputs[input.name] = input.get_initial_value(trans, context)
|
||||
|
||||
def encode(self, tool, app, nested=False):
|
||||
|
||||
@@ -78,9 +78,9 @@ def to_cwl_job(tool, param_dict, local_working_directory):
|
||||
else:
|
||||
return str(param_dict_value)
|
||||
|
||||
for input_name, input in inputs.iteritems():
|
||||
for input_name, input in inputs.items():
|
||||
if input.type == "repeat":
|
||||
only_input = input.inputs.values()[0]
|
||||
only_input = next(iter(input.inputs.values()))
|
||||
array_value = []
|
||||
for instance in param_dict[input_name]:
|
||||
array_value.append(simple_value(only_input, instance[input_name[:-len("_repeat")]]))
|
||||
@@ -112,7 +112,7 @@ def to_galaxy_parameters(tool, as_dict):
|
||||
else:
|
||||
return param_dict_value
|
||||
|
||||
for input_name, input in inputs.iteritems():
|
||||
for input_name, input in inputs.items():
|
||||
as_dict_value = as_dict.get(input_name, NOT_PRESENT)
|
||||
galaxy_input_type = input.type
|
||||
|
||||
@@ -120,7 +120,7 @@ def to_galaxy_parameters(tool, as_dict):
|
||||
if input_name not in as_dict:
|
||||
continue
|
||||
|
||||
only_input = input.inputs.values()[0]
|
||||
only_input = next(iter(input.inputs.values()))
|
||||
for index, value in enumerate(as_dict_value):
|
||||
key = "%s_repeat_0|%s" % (input_name, only_input.name)
|
||||
galaxy_value = from_simple_value(only_input, value)
|
||||
|
||||
@@ -240,7 +240,7 @@ class JobImportHistoryArchiveWrapper(object, UsesAnnotations):
|
||||
|
||||
# Set parameters. May be useful to look at metadata.py for creating parameters.
|
||||
# TODO: there may be a better way to set parameters, e.g.:
|
||||
# for name, value in tool.params_to_strings( incoming, trans.app ).iteritems():
|
||||
# for name, value in tool.params_to_strings( incoming, trans.app ).items():
|
||||
# job.add_parameter( name, value )
|
||||
# to make this work, we'd need to flesh out the HDA objects. The code below is
|
||||
# relatively similar.
|
||||
|
||||
@@ -39,13 +39,12 @@ def expand_multi_inputs(inputs, classifier, key_filter=None):
|
||||
|
||||
def __split_inputs(inputs, classifier, key_filter):
|
||||
key_filter = key_filter or (lambda x: True)
|
||||
input_keys = filter(key_filter, inputs)
|
||||
|
||||
single_inputs = {}
|
||||
matched_multi_inputs = {}
|
||||
multiplied_multi_inputs = {}
|
||||
|
||||
for input_key in input_keys:
|
||||
for input_key in filter(key_filter, inputs):
|
||||
input_type, expanded_val = classifier(input_key)
|
||||
if input_type == input_classification.SINGLE:
|
||||
single_inputs[input_key] = expanded_val
|
||||
@@ -73,14 +72,14 @@ def __extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
|
||||
matched_multi_inputs = []
|
||||
|
||||
first_multi_input_key = multi_inputs.keys()[0]
|
||||
first_multi_input_key = next(iter(multi_inputs.keys()))
|
||||
first_multi_value = multi_inputs.get(first_multi_input_key)
|
||||
|
||||
for value in first_multi_value:
|
||||
new_inputs = __copy_and_extend_inputs(single_inputs, first_multi_input_key, value)
|
||||
matched_multi_inputs.append(new_inputs)
|
||||
|
||||
for multi_input_key, multi_input_values in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_values in multi_inputs.items():
|
||||
if multi_input_key == first_multi_input_key:
|
||||
continue
|
||||
if len(multi_input_values) != len(first_multi_value):
|
||||
@@ -95,7 +94,7 @@ def __extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
def __extend_with_multiplied_combos(input_combos, multi_inputs):
|
||||
combos = input_combos
|
||||
|
||||
for multi_input_key, multi_input_value in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_value in multi_inputs.items():
|
||||
iter_combos = []
|
||||
|
||||
for combo in combos:
|
||||
|
||||
@@ -42,7 +42,7 @@ def _app_properties(args):
|
||||
def _arg_parser():
|
||||
parser = argparse.ArgumentParser(description=DESCRIPTION)
|
||||
parser.add_argument('action', metavar='ACTION', type=str,
|
||||
choices=ACTIONS.keys(),
|
||||
choices=list(ACTIONS.keys()),
|
||||
default=DEFAULT_ACTION,
|
||||
nargs='?' if DEFAULT_ACTION is not None else None,
|
||||
help='action to perform')
|
||||
|
||||
@@ -37,7 +37,7 @@ class BaseDataProvider(object):
|
||||
"""
|
||||
raise Exception("Unimplemented Function")
|
||||
|
||||
def get_data(self, chrom, start, end, start_val=0, max_vals=sys.maxint, **kwargs):
|
||||
def get_data(self, chrom, start, end, start_val=0, max_vals=sys.maxsize, **kwargs):
|
||||
"""
|
||||
Returns data as specified by kwargs. start_val is the first element to
|
||||
return and max_vals indicates the number of values to return.
|
||||
|
||||
@@ -44,8 +44,8 @@ def get_bounds(reads, start_pos_index, end_pos_index):
|
||||
'''
|
||||
Returns the minimum and maximum position for a set of reads.
|
||||
'''
|
||||
max_low = sys.maxint
|
||||
max_high = -sys.maxint
|
||||
max_low = sys.maxsize
|
||||
max_high = -sys.maxsize
|
||||
for read in reads:
|
||||
if read[start_pos_index] < max_low:
|
||||
max_low = read[start_pos_index]
|
||||
@@ -182,7 +182,7 @@ class GenomeDataProvider(BaseDataProvider):
|
||||
"""
|
||||
raise Exception("Unimplemented Function")
|
||||
|
||||
def get_data(self, chrom=None, low=None, high=None, start_val=0, max_vals=sys.maxint, **kwargs):
|
||||
def get_data(self, chrom=None, low=None, high=None, start_val=0, max_vals=sys.maxsize, **kwargs):
|
||||
"""
|
||||
Returns data in region defined by chrom, start, and end. start_val and
|
||||
max_vals are used to denote the data to return: start_val is the first element to
|
||||
@@ -233,7 +233,7 @@ class GenomeDataProvider(BaseDataProvider):
|
||||
column_names = self.original_dataset.datatype.column_names
|
||||
except AttributeError:
|
||||
try:
|
||||
column_names = range(self.original_dataset.metadata.columns)
|
||||
column_names = list(range(self.original_dataset.metadata.columns))
|
||||
except Exception: # Give up
|
||||
return []
|
||||
|
||||
@@ -511,7 +511,7 @@ class BedDataProvider(GenomeDataProvider):
|
||||
if length >= 12:
|
||||
block_sizes = [int(n) for n in feature[10].split(',') if n != '']
|
||||
block_starts = [int(n) for n in feature[11].split(',') if n != '']
|
||||
blocks = zip(block_sizes, block_starts)
|
||||
blocks = list(zip(block_sizes, block_starts))
|
||||
payload.append([(int(feature[1]) + block[1], int(feature[1]) + block[1] + block[0]) for block in blocks])
|
||||
|
||||
# Score (filter data)
|
||||
@@ -1022,7 +1022,7 @@ class BamDataProvider(GenomeDataProvider, FilterableMixin):
|
||||
count += 1
|
||||
|
||||
# Take care of reads whose mates are out of range.
|
||||
for qname, read in paired_pending.iteritems():
|
||||
for qname, read in paired_pending.items():
|
||||
if read['mate_start'] < read['start']:
|
||||
# Mate is before read.
|
||||
read_start = read['mate_start']
|
||||
@@ -1286,7 +1286,7 @@ class IntervalIndexDataProvider(FilterableMixin, GenomeDataProvider):
|
||||
out.write(line)
|
||||
else:
|
||||
reader = GFFReaderWrapper(source, fix_strand=True)
|
||||
feature = reader.next()
|
||||
feature = next(reader)
|
||||
for interval in feature.intervals:
|
||||
out.write('\t'.join(interval.fields) + '\n')
|
||||
|
||||
@@ -1328,7 +1328,7 @@ class IntervalIndexDataProvider(FilterableMixin, GenomeDataProvider):
|
||||
|
||||
# GFF dataset.
|
||||
reader = GFFReaderWrapper(source, fix_strand=True)
|
||||
feature = reader.next()
|
||||
feature = next(reader)
|
||||
payload = package_gff_feature(feature, no_detail, filter_cols)
|
||||
payload.insert(0, offset)
|
||||
|
||||
@@ -1604,7 +1604,7 @@ class ChromatinInteractionsDataProvider(GenomeDataProvider):
|
||||
|
||||
|
||||
class ChromatinInteractionsTabixDataProvider(TabixDataProvider, ChromatinInteractionsDataProvider):
|
||||
def get_iterator(self, data_file, chrom, start=0, end=sys.maxint, interchromosomal=False, **kwargs):
|
||||
def get_iterator(self, data_file, chrom, start=0, end=sys.maxsize, interchromosomal=False, **kwargs):
|
||||
"""
|
||||
"""
|
||||
# Modify start as needed to get earlier interactions with start region.
|
||||
@@ -1661,7 +1661,7 @@ def package_gff_feature(feature, no_detail=False, filter_cols=[]):
|
||||
# Add blocks.
|
||||
block_sizes = [(interval.end - interval.start) for interval in feature_intervals]
|
||||
block_starts = [(interval.start - feature.start) for interval in feature_intervals]
|
||||
blocks = zip(block_sizes, block_starts)
|
||||
blocks = list(zip(block_sizes, block_starts))
|
||||
payload.append([(feature.start + block[1], feature.start + block[1] + block[0]) for block in blocks])
|
||||
|
||||
# Add filter data to payload.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
@@ -268,7 +267,7 @@ def main(argv=None):
|
||||
def _arg_parser():
|
||||
parser = argparse.ArgumentParser(description=DESCRIPTION)
|
||||
parser.add_argument('action', metavar='ACTION', type=str,
|
||||
choices=ACTIONS.keys(),
|
||||
choices=list(ACTIONS.keys()),
|
||||
help='action to perform')
|
||||
parser.add_argument('app', metavar='APP', type=str, nargs="?",
|
||||
help=APP_DESCRIPTION)
|
||||
@@ -691,7 +690,7 @@ def _ordered_dump(data, stream=None, Dumper=yaml.Dumper, **kwds):
|
||||
def _dict_representer(dumper, data):
|
||||
return dumper.represent_mapping(
|
||||
yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
|
||||
data.items())
|
||||
list(data.items()))
|
||||
OrderedDumper.add_representer(OrderedDict, _dict_representer)
|
||||
return yaml.dump(data, stream, OrderedDumper, **kwds)
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ Returns:
|
||||
"""
|
||||
import logging
|
||||
from base64 import b64decode
|
||||
from urllib import unquote
|
||||
|
||||
from six.moves.urllib.parse import unquote
|
||||
|
||||
from galaxy import exceptions
|
||||
from galaxy.managers import api_keys
|
||||
|
||||
@@ -88,7 +88,7 @@ class ConfigurationController(BaseAPIController):
|
||||
@require_admin
|
||||
def dynamic_tool_confs(self, trans):
|
||||
confs = self.app.toolbox.dynamic_confs(include_migrated_tool_conf=True)
|
||||
return map(_tool_conf_to_dict, confs)
|
||||
return list(map(_tool_conf_to_dict, confs))
|
||||
|
||||
@expose_api
|
||||
@require_admin
|
||||
|
||||
@@ -383,5 +383,5 @@ class DatasetsController(BaseAPIController, UsesVisualizationMixin):
|
||||
return converted
|
||||
|
||||
except model.NoConverterException:
|
||||
exc_data = dict(source=original.ext, target=target_ext, available=original.get_converter_types().keys())
|
||||
exc_data = dict(source=original.ext, target=target_ext, available=list(original.get_converter_types().keys()))
|
||||
raise galaxy_exceptions.RequestParameterInvalidException('Conversion not possible', **exc_data)
|
||||
|
||||
@@ -42,7 +42,7 @@ class DatatypesController(BaseAPIController):
|
||||
if extension in datatypes_registry.datatypes_by_extension:
|
||||
composite_files = datatypes_registry.datatypes_by_extension[extension].composite_files
|
||||
if composite_files:
|
||||
dictionary['composite_files'] = [_.dict() for _ in composite_files.itervalues()]
|
||||
dictionary['composite_files'] = [_.dict() for _ in composite_files.values()]
|
||||
rval.append(dictionary)
|
||||
return rval
|
||||
except Exception as exception:
|
||||
@@ -61,7 +61,7 @@ class DatatypesController(BaseAPIController):
|
||||
try:
|
||||
ext_to_class_name = dict()
|
||||
classes = []
|
||||
for k, v in self._datatypes_registry.datatypes_by_extension.iteritems():
|
||||
for k, v in self._datatypes_registry.datatypes_by_extension.items():
|
||||
c = v.__class__
|
||||
ext_to_class_name[k] = c.__module__ + "." + c.__name__
|
||||
classes.append(c)
|
||||
@@ -109,7 +109,7 @@ class DatatypesController(BaseAPIController):
|
||||
@expose_api_anonymous_and_sessionless
|
||||
def converters(self, trans, **kwd):
|
||||
converters = []
|
||||
for (source_type, targets) in self._datatypes_registry.datatype_converters.iteritems():
|
||||
for (source_type, targets) in self._datatypes_registry.datatype_converters.items():
|
||||
for target_type in targets:
|
||||
converters.append({
|
||||
'source': source_type,
|
||||
|
||||
@@ -92,7 +92,7 @@ class FolderContentsController(BaseAPIController, UsesLibraryMixin, UsesLibraryM
|
||||
if content_item.description:
|
||||
return_item.update(dict(description=content_item.description))
|
||||
|
||||
if content_item.api_type == 'file':
|
||||
elif content_item.api_type == 'file':
|
||||
# Is the dataset public or private?
|
||||
# When both are False the dataset is 'restricted'
|
||||
# Access rights are checked on the dataset level, not on the ld or ldda level to maintain consistency
|
||||
|
||||
@@ -96,7 +96,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
|
||||
|
||||
contents_kwds = {'types': types}
|
||||
if ids:
|
||||
ids = map(lambda id: self.decode_id(id), ids.split(','))
|
||||
ids = [self.decode_id(id) for id in ids.split(',')]
|
||||
contents_kwds['ids'] = ids
|
||||
# If explicit ids given, always used detailed result.
|
||||
details = 'all'
|
||||
@@ -209,7 +209,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
|
||||
else:
|
||||
ids = util.listify(ids)
|
||||
types = util.listify(types)
|
||||
return map(lambda s: self.encode_all_ids(trans, s), fetch_job_states(self.app, trans.sa_session, ids, types))
|
||||
return [self.encode_all_ids(trans, s) for s in fetch_job_states(self.app, trans.sa_session, ids, types)]
|
||||
|
||||
@expose_api_anonymous
|
||||
def show_jobs_summary(self, trans, id, history_id, **kwd):
|
||||
|
||||
@@ -231,7 +231,7 @@ class JobController(BaseAPIController, UsesLibraryMixinItems):
|
||||
def __dictify_associations(self, trans, *association_lists):
|
||||
rval = []
|
||||
for association_list in association_lists:
|
||||
rval.extend(map(lambda a: self.__dictify_association(trans, a), association_list))
|
||||
rval.extend(self.__dictify_association(trans, a) for a in association_list)
|
||||
return rval
|
||||
|
||||
def __dictify_association(self, trans, job_dataset_association):
|
||||
@@ -293,7 +293,7 @@ class JobController(BaseAPIController, UsesLibraryMixinItems):
|
||||
raise exceptions.ObjectAttributeMissingException("No inputs defined")
|
||||
inputs = payload.get('inputs', {})
|
||||
# Find files coming in as multipart file data and add to inputs.
|
||||
for k, v in payload.iteritems():
|
||||
for k, v in payload.items():
|
||||
if k.startswith('files_') or k.startswith('__files_'):
|
||||
inputs[k] = v
|
||||
request_context = WorkRequestContext(app=trans.app, user=trans.user, history=trans.history)
|
||||
|
||||
@@ -253,8 +253,8 @@ class ToolShedRepositoriesController(BaseAPIController):
|
||||
# this is ever not the case, this code will need to be updated.
|
||||
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry(self.app, tool_ids[0].split('/')[0])
|
||||
found_repository = json.loads(util.url_get(tool_shed_url, params=dict(tool_ids=','.join(tool_ids)), pathspec=['api', 'repositories']))
|
||||
fr_keys = found_repository.keys()
|
||||
tsr_id = found_repository[fr_keys[0]]['repository_id']
|
||||
fr_first_key = next(iter(found_repository.keys()))
|
||||
tsr_id = found_repository[fr_first_key]['repository_id']
|
||||
repository_data['current_changeset'] = found_repository['current_changeset']
|
||||
repository_data['repository'] = json.loads(util.url_get(tool_shed_url, pathspec=['api', 'repositories', tsr_id]))
|
||||
del found_repository['current_changeset']
|
||||
@@ -537,7 +537,7 @@ class ToolShedRepositoriesController(BaseAPIController):
|
||||
id=trans.security.encode_id(tool_shed_repository.id))
|
||||
return tool_shed_repository_dict
|
||||
if installed_tool_shed_repositories:
|
||||
return map(to_dict, installed_tool_shed_repositories)
|
||||
return list(map(to_dict, installed_tool_shed_repositories))
|
||||
message = "No repositories were installed, possibly because the selected repository has already been installed."
|
||||
return dict(status="ok", message=message)
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import logging
|
||||
import urllib
|
||||
from json import dumps
|
||||
|
||||
from six.moves.urllib.parse import unquote_plus
|
||||
|
||||
import galaxy.queue_worker
|
||||
from galaxy import exceptions, managers, util, web
|
||||
from galaxy.managers.collections_util import dictify_dataset_collection_instance
|
||||
@@ -201,7 +202,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
lineage_dict = None
|
||||
tool_shed_dependencies = tool.installed_tool_dependencies
|
||||
if tool_shed_dependencies:
|
||||
tool_shed_dependencies_dict = map(to_dict, tool_shed_dependencies)
|
||||
tool_shed_dependencies_dict = list(map(to_dict, tool_shed_dependencies))
|
||||
else:
|
||||
tool_shed_dependencies_dict = None
|
||||
return {
|
||||
@@ -209,7 +210,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
"tool_version": tool.version,
|
||||
"dependency_shell_commands": tool.build_dependency_shell_commands(),
|
||||
"lineage": lineage_dict,
|
||||
"requirements": map(to_dict, tool.requirements),
|
||||
"requirements": list(map(to_dict, tool.requirements)),
|
||||
"installed_tool_shed_dependencies": tool_shed_dependencies_dict,
|
||||
"tool_dir": tool.tool_dir,
|
||||
"tool_shed": tool.tool_shed,
|
||||
@@ -326,19 +327,19 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
# Set up inputs.
|
||||
inputs = payload.get('inputs', {})
|
||||
# Find files coming in as multipart file data and add to inputs.
|
||||
for k, v in payload.iteritems():
|
||||
for k, v in payload.items():
|
||||
if k.startswith('files_') or k.startswith('__files_'):
|
||||
inputs[k] = v
|
||||
|
||||
# for inputs that are coming from the Library, copy them into the history
|
||||
input_patch = {}
|
||||
for k, v in inputs.iteritems():
|
||||
for k, v in inputs.items():
|
||||
if isinstance(v, dict) and v.get('src', '') == 'ldda' and 'id' in v:
|
||||
ldda = trans.sa_session.query(trans.app.model.LibraryDatasetDatasetAssociation).get(self.decode_id(v['id']))
|
||||
if trans.user_is_admin() or trans.app.security_agent.can_access_dataset(trans.get_current_user_roles(), ldda.dataset):
|
||||
input_patch[k] = ldda.to_history_dataset_association(target_history, add_to_history=True)
|
||||
|
||||
for k, v in input_patch.iteritems():
|
||||
for k, v in input_patch.items():
|
||||
inputs[k] = v
|
||||
|
||||
# TODO: encode data ids and decode ids.
|
||||
@@ -375,7 +376,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
output_dict['output_name'] = output_name
|
||||
rval['output_collections'].append(output_dict)
|
||||
|
||||
for output_name, collection_instance in vars.get('implicit_collections', {}).iteritems():
|
||||
for output_name, collection_instance in vars.get('implicit_collections', {}).items():
|
||||
history = target_history or trans.history
|
||||
output_dict = dictify_dataset_collection_instance(collection_instance, security=trans.security, parent=history)
|
||||
output_dict['output_name'] = output_name
|
||||
@@ -387,7 +388,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
# -- Helper methods --
|
||||
#
|
||||
def _get_tool(self, id, tool_version=None, user=None):
|
||||
id = urllib.unquote_plus(id)
|
||||
id = unquote_plus(id)
|
||||
tool = self.app.toolbox.get_tool(id, tool_version)
|
||||
if not tool:
|
||||
raise exceptions.ObjectNotFound("Could not find tool with id '%s'." % id)
|
||||
@@ -466,7 +467,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
# TODO: need to handle updates to conditional parameters; conditional
|
||||
# params are stored in dicts (and dicts within dicts).
|
||||
new_inputs = payload['inputs']
|
||||
tool_params.update(dict([(key, dumps(value)) for key, value in new_inputs.items() if key in tool.inputs and new_inputs[key] is not None]))
|
||||
tool_params.update(dict([(key, dumps(value)) for key, value in new_inputs.items() if key in tool.inputs and value is not None]))
|
||||
tool_params = tool.params_from_strings(tool_params, self.app)
|
||||
|
||||
#
|
||||
|
||||
@@ -243,8 +243,8 @@ class ToolShedController(BaseAPIController):
|
||||
# this is ever not the case, this code will need to be updated.
|
||||
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry(self.app, tool_ids[0].split('/')[0])
|
||||
found_repository = json.loads(util.url_get(tool_shed_url, params=dict(tool_ids=','.join(tool_ids)), pathspec=['api', 'repositories']))
|
||||
fr_keys = found_repository.keys()
|
||||
repository_id = found_repository[fr_keys[0]]['repository_id']
|
||||
fr_first_key = next(iter(found_repository.keys()))
|
||||
repository_id = found_repository[fr_first_key]['repository_id']
|
||||
repository_data['current_changeset'] = found_repository['current_changeset']
|
||||
repository_data['repository'] = json.loads(util.url_get(tool_shed_url, pathspec=['api', 'repositories', repository_id]))
|
||||
del found_repository['current_changeset']
|
||||
|
||||
@@ -1368,7 +1368,7 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
|
||||
if users:
|
||||
if trans.request.method == 'GET':
|
||||
return {
|
||||
'message': 'Changes password(s) for: %s.' % ', '.join([user.email for user in users.itervalues()]),
|
||||
'message': 'Changes password(s) for: %s.' % ', '.join(user.email for user in users.values()),
|
||||
'status' : 'info',
|
||||
'inputs' : [{'name' : 'password', 'label' : 'New password', 'type' : 'password'},
|
||||
{'name' : 'confirm', 'label' : 'Confirm password', 'type' : 'password'}]
|
||||
@@ -1380,7 +1380,7 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
|
||||
return self.message_exception(trans, 'Use a password of at least 6 characters.')
|
||||
elif password != confirm:
|
||||
return self.message_exception(trans, 'Passwords do not match.')
|
||||
for user in users.itervalues():
|
||||
for user in users.values():
|
||||
user.set_password_cleartext(password)
|
||||
trans.sa_session.add(user)
|
||||
trans.sa_session.flush()
|
||||
|
||||
@@ -5,9 +5,9 @@ Upload class
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import urllib
|
||||
|
||||
import requests
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
from galaxy import jobs, web
|
||||
from galaxy.util import Params
|
||||
@@ -75,10 +75,10 @@ class ASync(BaseUIController):
|
||||
|
||||
# Assume there is exactly one output file possible
|
||||
TOOL_OUTPUT_TYPE = None
|
||||
for idx, obj in enumerate(tool.outputs.values()):
|
||||
for key, obj in tool.outputs.items():
|
||||
try:
|
||||
TOOL_OUTPUT_TYPE = obj.format
|
||||
params[tool.outputs.keys()[idx]] = data.id
|
||||
params[key] = data.id
|
||||
break
|
||||
except Exception:
|
||||
# exclude outputs different from ToolOutput (e.g. collections) from the previous assumption
|
||||
@@ -163,7 +163,7 @@ class ASync(BaseUIController):
|
||||
url_join_char = '&'
|
||||
else:
|
||||
url_join_char = '?'
|
||||
url = "%s%s%s" % (url, url_join_char, urllib.urlencode(params.flatten()))
|
||||
url = "%s%s%s" % (url, url_join_char, urlencode(params.flatten()))
|
||||
log.debug("connecting to -> %s" % url)
|
||||
trans.log_event("Async connecting to -> %s" % url)
|
||||
text = requests.get(url).text.strip()
|
||||
|
||||
@@ -65,7 +65,7 @@ class DataManager(BaseUIController):
|
||||
data_manager_json = {}
|
||||
error_messages.append(escape("Unable to obtain data_table info for hda (%s): %s" % (hda.id, e)))
|
||||
values = []
|
||||
for key, value in data_manager_json.get('data_tables', {}).iteritems():
|
||||
for key, value in data_manager_json.get('data_tables', {}).items():
|
||||
values.append((key, value))
|
||||
data_manager_output.append(values)
|
||||
return trans.fill_template("data_manager/view_job.mako", data_manager=data_manager, job=job, view_only=not_is_admin, hdas=hdas, data_manager_output=data_manager_output, message=message, status=status, error_messages=error_messages)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import logging
|
||||
import os
|
||||
import urllib
|
||||
|
||||
import paste.httpexceptions
|
||||
from markupsafe import escape
|
||||
from six import string_types, text_type
|
||||
from six.moves.urllib.parse import (
|
||||
quote_plus,
|
||||
unquote_plus
|
||||
)
|
||||
from sqlalchemy import false, true
|
||||
|
||||
from galaxy import (
|
||||
@@ -276,7 +279,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
return self.message_exception(trans, 'Please wait until this dataset finishes uploading before attempting to edit its metadata.')
|
||||
# let's not overwrite the imported datatypes module with the variable datatypes?
|
||||
# the built-in 'id' is overwritten in lots of places as well
|
||||
ldatatypes = [(dtype_name, dtype_name) for dtype_name, dtype_value in trans.app.datatypes_registry.datatypes_by_extension.iteritems() if dtype_value.allow_datatype_change]
|
||||
ldatatypes = [(dtype_name, dtype_name) for dtype_name, dtype_value in trans.app.datatypes_registry.datatypes_by_extension.items() if dtype_value.allow_datatype_change]
|
||||
ldatatypes.sort()
|
||||
all_roles = [(r.name, trans.security.encode_id(r.id)) for r in trans.app.security_agent.get_legitimate_roles(trans, data.dataset, 'root')]
|
||||
data_metadata = [(name, spec) for name, spec in data.metadata.spec.items()]
|
||||
@@ -352,11 +355,10 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
permission_inputs = list()
|
||||
if trans.user:
|
||||
if data.dataset.actions:
|
||||
permitted_actions = trans.app.model.Dataset.permitted_actions.items()
|
||||
in_roles = {}
|
||||
for action, roles in trans.app.security_agent.get_permissions(data.dataset).items():
|
||||
in_roles[action.action] = [trans.security.encode_id(role.id) for role in roles]
|
||||
for index, action in permitted_actions:
|
||||
for index, action in trans.app.model.Dataset.permitted_actions.items():
|
||||
if action == trans.app.security_agent.permitted_actions.DATASET_ACCESS:
|
||||
help_text = action.description + '<br/>NOTE: Users must have every role associated with this dataset in order to access it.'
|
||||
else:
|
||||
@@ -415,6 +417,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
if job_to_dataset_association.job.state not in [job_to_dataset_association.job.states.OK, job_to_dataset_association.job.states.ERROR, job_to_dataset_association.job.states.DELETED]:
|
||||
return False
|
||||
return True
|
||||
|
||||
message = None
|
||||
status = 'success'
|
||||
dataset_id = payload.get('dataset_id')
|
||||
@@ -483,9 +486,8 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
if not trans.user:
|
||||
return self.message_exception(trans, 'You must be logged in if you want to change permissions.')
|
||||
if trans.app.security_agent.can_manage_dataset(trans.get_current_user_roles(), data.dataset):
|
||||
permitted_actions = trans.app.model.Dataset.permitted_actions.items()
|
||||
payload_permissions = {}
|
||||
for action, key in permitted_actions:
|
||||
for action in trans.app.model.Dataset.permitted_actions.keys():
|
||||
payload_permissions[action] = [trans.security.decode_id(role_id) for role_id in util.listify(payload.get(action))]
|
||||
# The user associated the DATASET_ACCESS permission on the dataset with 1 or more roles. We
|
||||
# need to ensure that they did not associate roles that would cause accessibility problems.
|
||||
@@ -730,7 +732,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
if 'display_url' not in kwd or 'redirect_url' not in kwd:
|
||||
return trans.show_error_message('Invalid parameters specified for "display at" link, please contact a Galaxy administrator')
|
||||
try:
|
||||
redirect_url = kwd['redirect_url'] % urllib.quote_plus(kwd['display_url'])
|
||||
redirect_url = kwd['redirect_url'] % quote_plus(kwd['display_url'])
|
||||
except Exception:
|
||||
redirect_url = kwd['redirect_url'] # not all will need custom text
|
||||
if trans.app.security_agent.dataset_is_public(data.dataset):
|
||||
@@ -746,7 +748,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
"""Access to external display applications"""
|
||||
# Build list of parameters to pass in to display application logic (app_kwds)
|
||||
app_kwds = {}
|
||||
for name, value in dict(kwds).iteritems(): # clone kwds because we remove stuff as we go.
|
||||
for name, value in dict(kwds).items(): # clone kwds because we remove stuff as we go.
|
||||
if name.startswith("app_"):
|
||||
app_kwds[name[len("app_"):]] = value
|
||||
del kwds[name]
|
||||
@@ -763,8 +765,8 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
else:
|
||||
user_roles = []
|
||||
# Decode application name and link name
|
||||
app_name = urllib.unquote_plus(app_name)
|
||||
link_name = urllib.unquote_plus(link_name)
|
||||
app_name = unquote_plus(app_name)
|
||||
link_name = unquote_plus(link_name)
|
||||
if None in [app_name, link_name]:
|
||||
return trans.show_error_message("A display application name and link name must be provided.")
|
||||
if self._can_access_dataset(trans, data, additional_roles=user_roles):
|
||||
@@ -1143,7 +1145,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
target_histories = [history]
|
||||
if len(target_histories) != len(target_history_ids):
|
||||
error_msg = error_msg + "You do not have permission to add datasets to %i requested histories. " % (len(target_history_ids) - len(target_histories))
|
||||
source_contents = map(trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get, decoded_dataset_ids)
|
||||
source_contents = list(map(trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get, decoded_dataset_ids))
|
||||
source_contents.extend(map(trans.sa_session.query(trans.app.model.HistoryDatasetCollectionAssociation).get, decoded_dataset_collection_ids))
|
||||
source_contents.sort(key=lambda content: content.hid)
|
||||
for content in source_contents:
|
||||
|
||||
@@ -152,7 +152,7 @@ class RootController(controller.JSAppLauncher, UsesAnnotations):
|
||||
if len(query) > 2:
|
||||
search_results = trans.app.toolbox_search.search(query)
|
||||
if 'tags[]' in kwd:
|
||||
results = filter(lambda x: x in results, search_results)
|
||||
results = [x for x in search_results if x in results]
|
||||
else:
|
||||
results = search_results
|
||||
return results
|
||||
|
||||
@@ -5,10 +5,10 @@ Contains the user interface in the Universe class
|
||||
import logging
|
||||
import random
|
||||
import socket
|
||||
import urllib
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from markupsafe import escape
|
||||
from six.moves.urllib.parse import unquote
|
||||
from sqlalchemy import (
|
||||
and_,
|
||||
func,
|
||||
@@ -868,7 +868,7 @@ class User(BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Create
|
||||
Check whether token fits the user and then activate the user's account.
|
||||
"""
|
||||
params = util.Params(kwd, sanitize=False)
|
||||
email = urllib.unquote(params.get('email', None))
|
||||
email = unquote(params.get('email', None))
|
||||
activation_token = params.get('activation_token', None)
|
||||
|
||||
if email is None or activation_token is None:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import base64
|
||||
import httplib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -9,6 +8,7 @@ import sgmllib
|
||||
|
||||
import requests
|
||||
from markupsafe import escape
|
||||
from six.moves.http_client import HTTPConnection
|
||||
from sqlalchemy import and_
|
||||
from sqlalchemy.orm import joinedload
|
||||
from sqlalchemy.sql import expression
|
||||
@@ -680,7 +680,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
|
||||
auth_header = base64.b64encode('%s:%s' % (myexp_username, myexp_password))
|
||||
headers = {"Content-type": "text/xml", "Accept": "text/xml", "Authorization": "Basic %s" % auth_header}
|
||||
myexp_url = trans.app.config.get("myexperiment_url", self.__myexp_url)
|
||||
conn = httplib.HTTPConnection(myexp_url)
|
||||
conn = HTTPConnection(myexp_url)
|
||||
# NOTE: blocks web thread.
|
||||
conn.request("POST", "/workflow.xml", request, headers)
|
||||
response = conn.getresponse()
|
||||
@@ -989,7 +989,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
|
||||
# Extract just the output flags for this step.
|
||||
p = "%s|otag|" % step.id
|
||||
l = len(p)
|
||||
outputs = [k[l:] for (k, v) in kwargs.iteritems() if k.startswith(p)]
|
||||
outputs = [k[l:] for (k, v) in kwargs.items() if k.startswith(p)]
|
||||
if step.workflow_outputs:
|
||||
for existing_output in step.workflow_outputs:
|
||||
if existing_output.output_name not in outputs:
|
||||
@@ -1060,10 +1060,10 @@ def _expand_multiple_inputs(kwargs):
|
||||
input_combos = _extend_with_multiplied_combos(input_combos, multiplied_multi_inputs)
|
||||
|
||||
# Input name that are multiply specified
|
||||
multi_input_keys = matched_multi_inputs.keys() + multiplied_multi_inputs.keys()
|
||||
multi_input_keys = list(matched_multi_inputs.keys()) + list(multiplied_multi_inputs.keys())
|
||||
|
||||
for input_combo in input_combos:
|
||||
for key, value in input_combo.iteritems():
|
||||
for key, value in input_combo.items():
|
||||
kwargs[key] = value
|
||||
yield (kwargs, multi_input_keys)
|
||||
|
||||
@@ -1074,14 +1074,14 @@ def _extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
|
||||
matched_multi_inputs = []
|
||||
|
||||
first_multi_input_key = multi_inputs.keys()[0]
|
||||
first_multi_input_key = next(iter(multi_inputs.keys()))
|
||||
first_multi_value = multi_inputs.get(first_multi_input_key)
|
||||
|
||||
for value in first_multi_value:
|
||||
new_inputs = _copy_and_extend_inputs(single_inputs, first_multi_input_key, value)
|
||||
matched_multi_inputs.append(new_inputs)
|
||||
|
||||
for multi_input_key, multi_input_values in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_values in multi_inputs.items():
|
||||
if multi_input_key == first_multi_input_key:
|
||||
continue
|
||||
if len(multi_input_values) != len(first_multi_value):
|
||||
@@ -1094,7 +1094,7 @@ def _extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
def _extend_with_multiplied_combos(input_combos, multi_inputs):
|
||||
combos = input_combos
|
||||
|
||||
for multi_input_key, multi_input_value in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_value in multi_inputs.items():
|
||||
iter_combos = []
|
||||
|
||||
for combo in combos:
|
||||
@@ -1114,7 +1114,7 @@ def _copy_and_extend_inputs(inputs, key, value):
|
||||
def _split_inputs(kwargs):
|
||||
"""
|
||||
"""
|
||||
input_keys = filter(lambda a: a.endswith('|input'), kwargs)
|
||||
input_keys = [a for a in kwargs if a.endswith('|input')]
|
||||
single_inputs = {}
|
||||
matched_multi_inputs = {}
|
||||
multiplied_multi_inputs = {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import StringIO
|
||||
import tarfile
|
||||
from cgi import FieldStorage
|
||||
from collections import namedtuple
|
||||
from time import strftime
|
||||
|
||||
from six import StringIO
|
||||
from sqlalchemy import and_, false
|
||||
|
||||
from galaxy import (
|
||||
@@ -1075,7 +1075,7 @@ class RepositoriesController(BaseAPIController):
|
||||
file_data = payload.get('file')
|
||||
# Code stolen from gx's upload_common.py
|
||||
if isinstance(file_data, FieldStorage):
|
||||
assert not isinstance(file_data.file, StringIO.StringIO)
|
||||
assert not isinstance(file_data.file, StringIO)
|
||||
assert file_data.file.name != '<fdopen>'
|
||||
local_filename = util.mkstemp_ln(file_data.file.name, 'upload_file_data_')
|
||||
file_data.file.close()
|
||||
|
||||
@@ -46,7 +46,7 @@ class AdminController(BaseUIController, Admin):
|
||||
**kwd))
|
||||
elif operation == "repositories_by_user":
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
if 'user_id' in kwd:
|
||||
@@ -61,7 +61,7 @@ class AdminController(BaseUIController, Admin):
|
||||
kwd['f-email'] = repository.user.email
|
||||
elif operation == "repositories_by_category":
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
category_id = kwd.get('id', None)
|
||||
|
||||
@@ -120,7 +120,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
operation = kwd['operation'].lower()
|
||||
if operation in ["repositories_by_category", "repositories_by_user"]:
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
return trans.response.send_redirect(web.url_for(controller='repository',
|
||||
@@ -274,7 +274,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
def browse_repositories_by_user(self, trans, **kwd):
|
||||
"""Display the list of repositories owned by a specified user."""
|
||||
# Eliminate the current search filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
if 'operation' in kwd:
|
||||
@@ -522,7 +522,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
operation = kwd['operation'].lower()
|
||||
if operation in ["valid_repositories_by_category", "valid_repositories_by_user"]:
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
return trans.response.send_redirect(web.url_for(controller='repository',
|
||||
@@ -560,7 +560,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
changeset_revision=latest_installable_changeset_revision))
|
||||
elif operation == "valid_repositories_by_category":
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
category_id = kwd.get('id', None)
|
||||
|
||||
@@ -32,7 +32,7 @@ class RBACAgent:
|
||||
When getting permitted actions from an untrusted source like a
|
||||
form, ensure that they match our actual permitted actions.
|
||||
"""
|
||||
return filter(lambda x: x is not None, [self.permitted_actions.get(action_string) for action_string in permitted_action_strings])
|
||||
return [x for x in [self.permitted_actions.get(action_string) for action_string in permitted_action_strings] if x is not None]
|
||||
|
||||
def create_private_user_role(self, user):
|
||||
raise Exception("Unimplemented Method")
|
||||
@@ -46,7 +46,7 @@ class RBACAgent:
|
||||
|
||||
def get_actions(self):
|
||||
"""Get all permitted actions as a list of Action objects"""
|
||||
return self.permitted_actions.__dict__.values()
|
||||
return list(self.permitted_actions.__dict__.values())
|
||||
|
||||
def get_item_actions(self, action, item):
|
||||
raise Exception('No valid method of retrieving action (%s) for item %s.' % (action, item))
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import ConfigParser
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import threading
|
||||
from datetime import date
|
||||
|
||||
from six.moves import configparser
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
new_hgweb_config_template = """
|
||||
@@ -60,12 +61,12 @@ class HgWebConfigManager(object):
|
||||
self.read_config()
|
||||
try:
|
||||
entry = self.in_memory_config.get('paths', lhs)
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
try:
|
||||
# We have a multi-threaded front-end, so one of the threads may not have the latest version of the hgweb.config file.
|
||||
self.read_config(force_read=True)
|
||||
entry = self.in_memory_config.get('paths', lhs)
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
raise Exception("Entry for repository %s missing in file %s." % (lhs, self.hgweb_config))
|
||||
return entry
|
||||
|
||||
@@ -92,7 +93,7 @@ class HgWebConfigManager(object):
|
||||
|
||||
def read_config(self, force_read=False):
|
||||
if force_read or self.in_memory_config is None:
|
||||
config = ConfigParser.ConfigParser()
|
||||
config = configparser.ConfigParser()
|
||||
config.read(self.hgweb_config)
|
||||
self.in_memory_config = config
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from ConfigParser import ConfigParser
|
||||
from os import listdir
|
||||
from os.path import join
|
||||
from re import match
|
||||
from sys import argv
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
|
||||
def merge():
|
||||
"""
|
||||
|
||||
@@ -9,13 +9,13 @@ details.
|
||||
Run from the ~/scripts/data_libraries directory:
|
||||
%sh build_lucene_index.sh
|
||||
"""
|
||||
import ConfigParser
|
||||
import csv
|
||||
import os
|
||||
import sys
|
||||
import urllib
|
||||
|
||||
import requests
|
||||
from six.moves.configparser import ConfigParser
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'lib')))
|
||||
|
||||
@@ -39,7 +39,7 @@ def main(ini_file):
|
||||
|
||||
|
||||
def build_index(search_url, dataset_file):
|
||||
url = "%s/index?%s" % (search_url, urllib.urlencode({"docfile": dataset_file}))
|
||||
url = "%s/index?%s" % (search_url, urlencode({"docfile": dataset_file}))
|
||||
requests.put(url)
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ def _get_folder_info(folder):
|
||||
|
||||
|
||||
def get_sa_session(ini_file):
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
kwds = dict()
|
||||
for key, value in conf_parser.items("app:main"):
|
||||
|
||||
+2
-5
@@ -31,10 +31,7 @@ import threading
|
||||
from argparse import ArgumentParser
|
||||
from logging.config import fileConfig
|
||||
|
||||
try:
|
||||
import ConfigParser as configparser
|
||||
except ImportError:
|
||||
import configparser
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
try:
|
||||
from daemonize import Daemonize
|
||||
@@ -219,7 +216,7 @@ class GalaxyConfigBuilder(object):
|
||||
if not self.config_file:
|
||||
return
|
||||
if self.config_is_ini:
|
||||
raw_config = configparser.ConfigParser()
|
||||
raw_config = ConfigParser()
|
||||
raw_config.read([self.config_file])
|
||||
if raw_config.has_section('loggers'):
|
||||
config_file = os.path.abspath(self.config_file)
|
||||
|
||||
+2
-1
@@ -8,9 +8,10 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ConfigParser import ConfigParser
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, 'lib'))
|
||||
|
||||
from galaxy.model import mapping
|
||||
|
||||
@@ -149,18 +149,6 @@ VARIANT_MAP = {'canon': 'Canonical',
|
||||
'male': 'Male'}
|
||||
|
||||
|
||||
# alphabetize ignoring case
|
||||
def caseless_compare(a, b):
|
||||
au = a.upper()
|
||||
bu = b.upper()
|
||||
if au > bu:
|
||||
return 1
|
||||
elif au == bu:
|
||||
return 0
|
||||
elif au < bu:
|
||||
return -1
|
||||
|
||||
|
||||
def __main__():
|
||||
# command line variables
|
||||
parser = optparse.OptionParser()
|
||||
@@ -257,14 +245,13 @@ def __main__():
|
||||
else:
|
||||
unmatching_fasta_paths.append(os.path.join(dirpath, fn))
|
||||
# remove redundant fasta files
|
||||
if variant_exclusions.keys():
|
||||
for k in variant_exclusions.keys():
|
||||
leave_in = '%s%s' % (genome_subdir, k)
|
||||
if leave_in in fasta_locs:
|
||||
to_remove = ['%s%s' % (genome_subdir, k) for k in variant_exclusions[k]]
|
||||
for tr in to_remove:
|
||||
if tr in fasta_locs:
|
||||
del fasta_locs[tr]
|
||||
for k, v in variant_exclusions.items():
|
||||
leave_in = '%s%s' % (genome_subdir, k)
|
||||
if leave_in in fasta_locs:
|
||||
to_remove = ['%s%s' % (genome_subdir, _) for _ in v]
|
||||
for tr in to_remove:
|
||||
if tr in fasta_locs:
|
||||
del fasta_locs[tr]
|
||||
|
||||
# output results
|
||||
print('\nThere were %s fasta files found that were not included because they did not have the expected file names.' % len(unmatching_fasta_paths))
|
||||
@@ -286,8 +273,8 @@ def __main__():
|
||||
else:
|
||||
all_fasta_loc.write('%s\n' % open('%s.sample' % loc_path, 'rb').read().strip())
|
||||
# output list of fasta files in alphabetical order
|
||||
fasta_bases = fasta_locs.keys()
|
||||
fasta_bases.sort(caseless_compare)
|
||||
fasta_bases = list(fasta_locs.keys())
|
||||
fasta_bases.sort(key=str.upper)
|
||||
for fb in fasta_bases:
|
||||
out_line = []
|
||||
for col in col_values:
|
||||
|
||||
@@ -20,25 +20,25 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
for org in organisms:
|
||||
org = organisms[org]
|
||||
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
|
||||
|
||||
@@ -20,32 +20,31 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
|
||||
orgs = organisms.keys()
|
||||
for org in orgs:
|
||||
if 'name' not in organisms[org]:
|
||||
del organisms[org]
|
||||
for org_name, org in list(organisms.items()):
|
||||
if 'name' not in org:
|
||||
del organisms[org_name]
|
||||
|
||||
orgs = organisms.keys()
|
||||
orgs = list(organisms.keys())
|
||||
# need to sort by name
|
||||
swap_test = False
|
||||
for i in range(0, len(orgs) - 1):
|
||||
@@ -58,8 +57,7 @@ def __main__():
|
||||
|
||||
print("||'''Organism'''||'''Kingdom'''||'''Group'''||'''Links to UCSC Archaea Browser'''||")
|
||||
|
||||
for org in orgs:
|
||||
org = organisms[org]
|
||||
for org in organisms.values():
|
||||
at_ucsc = False
|
||||
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
|
||||
try:
|
||||
|
||||
@@ -29,25 +29,25 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
|
||||
for org in organisms:
|
||||
org = organisms[org]
|
||||
|
||||
@@ -20,25 +20,25 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
for org in organisms:
|
||||
org = organisms[org]
|
||||
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
|
||||
|
||||
@@ -12,10 +12,10 @@ import time
|
||||
from ftplib import FTP
|
||||
|
||||
import requests
|
||||
from BeautifulSoup import BeautifulSoup
|
||||
from six.moves.urllib.request import urlretrieve
|
||||
|
||||
from util import ( # noqa: I202
|
||||
from BeautifulSoup import BeautifulSoup # noqa: I100, I202
|
||||
from util import (
|
||||
get_bed_from_genbank,
|
||||
get_bed_from_GeneMark,
|
||||
get_bed_from_GeneMarkHMM,
|
||||
|
||||
@@ -7,10 +7,11 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import urllib
|
||||
from shutil import move
|
||||
from xml.etree import ElementTree
|
||||
|
||||
from six.moves.urllib.request import urlopen
|
||||
|
||||
|
||||
def __main__():
|
||||
base_dir = os.path.join(os.getcwd(), "bacteria")
|
||||
@@ -24,29 +25,29 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
if dict['genome project id'] not in organisms.keys():
|
||||
organisms[dict['genome project id']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[dict['genome project id']][key] = dict[key]
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
if tmp_dict['genome project id'] not in organisms.keys():
|
||||
organisms[tmp_dict['genome project id']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in tmp_dict.keys():
|
||||
organisms[tmp_dict['genome project id']][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
|
||||
# get UCSC data
|
||||
|
||||
URL = "http://archaea.ucsc.edu/cgi-bin/das/dsn"
|
||||
|
||||
try:
|
||||
page = urllib.urlopen(URL)
|
||||
page = urlopen(URL)
|
||||
except Exception:
|
||||
print("#Unable to open " + URL)
|
||||
print("?\tunspecified (?)")
|
||||
@@ -65,7 +66,7 @@ def __main__():
|
||||
for dsn in tree:
|
||||
build = dsn.find("SOURCE").attrib['id']
|
||||
try:
|
||||
org_page = urllib.urlopen("http://archaea.ucsc.edu/cgi-bin/hgGateway?db=" + build).read().replace("\n", "").split("<table border=2 cellspacing=2 cellpadding=2>")[1].split("</table>")[0].split("</tr>")
|
||||
org_page = urlopen("http://archaea.ucsc.edu/cgi-bin/hgGateway?db=" + build).read().replace("\n", "").split("<table border=2 cellspacing=2 cellpadding=2>")[1].split("</table>")[0].split("</tr>")
|
||||
except Exception:
|
||||
print("NO CHROMS FOR", build)
|
||||
continue
|
||||
|
||||
@@ -137,7 +137,7 @@ def get_bed_from_GeneMark(geneMark_filename, chr):
|
||||
for block in orfs.split("\n\n"):
|
||||
if block.startswith("List of Regions of interest"):
|
||||
break
|
||||
best_block = {'start': 0, 'end': 0, 'strand': '+', 'avg_prob': -sys.maxint, 'start_prob': -sys.maxint, 'name': 'DNE'}
|
||||
best_block = {'start': 0, 'end': 0, 'strand': '+', 'avg_prob': -sys.maxsize, 'start_prob': -sys.maxsize, 'name': 'DNE'}
|
||||
ctr += 1
|
||||
ctr2 = 0
|
||||
for line in block.split("\n"):
|
||||
@@ -158,9 +158,8 @@ def get_bed_from_GeneMark(geneMark_filename, chr):
|
||||
except Exception:
|
||||
start_prob = 0
|
||||
name = "orf_" + str(ctr) + "_" + str(ctr2)
|
||||
if avg_prob >= best_block['avg_prob']:
|
||||
if start_prob > best_block['start_prob']:
|
||||
best_block = {'start': start, 'end': end, 'strand': strand, 'avg_prob': avg_prob, 'start_prob': start_prob, 'name': name}
|
||||
if avg_prob >= best_block['avg_prob'] and start_prob > best_block['start_prob']:
|
||||
best_block = {'start': start, 'end': end, 'strand': strand, 'avg_prob': avg_prob, 'start_prob': start_prob, 'name': name}
|
||||
regions.append(chr + "\t" + str(best_block['start']) + "\t" + str(best_block['end']) + "\t" + best_block['name'] + "\t" + str(int(best_block['avg_prob'] * 1000)) + "\t" + best_block['strand'])
|
||||
return regions
|
||||
|
||||
@@ -198,8 +197,8 @@ def get_bed_from_GeneMarkHMM(geneMarkHMM_filename, chr):
|
||||
# converts glimmer3 to bed, doing some linear scaling (probably not correct?) on scores
|
||||
# returns an array of bed regions
|
||||
def get_bed_from_glimmer3(glimmer3_filename, chr):
|
||||
max_score = -sys.maxint
|
||||
min_score = sys.maxint
|
||||
max_score = -sys.maxsize
|
||||
min_score = sys.maxsize
|
||||
orfs = []
|
||||
for line in open(glimmer3_filename).readlines():
|
||||
if line.startswith(">"):
|
||||
|
||||
@@ -5,12 +5,12 @@ wherein the second dataset doesn't have chr, start and end in standard columns 1
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import sqlalchemy as sa
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
import galaxy.app
|
||||
import galaxy.model.mapping
|
||||
@@ -34,7 +34,7 @@ class TestApplication(object):
|
||||
|
||||
def main():
|
||||
ini_file = sys.argv[1]
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
configuration = {}
|
||||
for key, value in conf_parser.items("app:main"):
|
||||
|
||||
@@ -4,12 +4,12 @@ Fetch gops_join wherein the use specified minimum coverage is not 1.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import sqlalchemy as sa
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
import galaxy.app
|
||||
import galaxy.model.mapping
|
||||
@@ -33,7 +33,7 @@ class TestApplication(object):
|
||||
|
||||
def main():
|
||||
ini_file = sys.argv[1]
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
configuration = {}
|
||||
for key, value in conf_parser.items("app:main"):
|
||||
|
||||
+3
-2
@@ -4,14 +4,15 @@ Bootstrap the Galaxy framework.
|
||||
This should not be called directly! Use the run.sh script in Galaxy's
|
||||
top level directly.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
|
||||
|
||||
from galaxy.util.pastescript import serve
|
||||
|
||||
from check_python import check_python # noqa: I100
|
||||
from check_python import check_python # noqa: I100, I201
|
||||
|
||||
# ensure supported version
|
||||
try:
|
||||
|
||||
@@ -3,9 +3,9 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ConfigParser import ConfigParser
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
|
||||
|
||||
|
||||
@@ -3,9 +3,10 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ConfigParser import ConfigParser
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
|
||||
|
||||
import galaxy.config
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from ConfigParser import ConfigParser
|
||||
from sys import argv
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
REPLACE_PROPERTIES = ["file_path", "database_connection", "new_file_path"]
|
||||
MAIN_SECTION = "app:main"
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ def main(options):
|
||||
if latest_revision_only:
|
||||
latest_revision = repository_dict.get('latest_revision', hg_util.INITIAL_CHANGELOG_HASH)
|
||||
if changeset_revision == latest_revision:
|
||||
repository_dicts.append(dict(repository_dict.items() + baseline_repository_dict.items()))
|
||||
repository_dicts.append(dict(list(repository_dict.items()) + list(baseline_repository_dict.items())))
|
||||
else:
|
||||
repository_dicts.append(dict(repository_dict.items() + baseline_repository_dict.items()))
|
||||
repository_dicts.append(dict(list(repository_dict.items()) + list(baseline_repository_dict.items())))
|
||||
print('\n\n', repository_dicts)
|
||||
print('\nThe url:\n\n', api_url, '\n\nreturned ', len(repository_dicts), ' repository dictionaries...')
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/python
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'lib'))
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
from sqlalchemy.exc import OperationalError, ProgrammingError
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'lib'))
|
||||
|
||||
import galaxy.webapps.tool_shed.model.mapping as tool_shed_model
|
||||
from tool_shed.util import xml_util
|
||||
|
||||
@@ -50,7 +50,7 @@ def check_db(config_parser):
|
||||
pass
|
||||
|
||||
if config_parser.has_option('app:main', 'hgweb_config_dir'):
|
||||
hgweb_config_parser = ConfigParser.ConfigParser()
|
||||
hgweb_config_parser = ConfigParser()
|
||||
hgweb_dir = config_parser.get('app:main', 'hgweb_config_dir')
|
||||
hgweb_config_file = os.path.join(hgweb_dir, 'hgweb.config')
|
||||
if not os.path.exists(hgweb_config_file):
|
||||
@@ -104,7 +104,7 @@ def get_local_tool_shed_url(config_parser):
|
||||
|
||||
|
||||
def main(args):
|
||||
config_parser = ConfigParser.ConfigParser()
|
||||
config_parser = ConfigParser()
|
||||
|
||||
if os.path.exists(args.config):
|
||||
config_parser.read(args.config)
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'lib'))
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__)))
|
||||
|
||||
import galaxy.webapps.tool_shed.config as tool_shed_config
|
||||
from galaxy.web import security
|
||||
from galaxy.webapps.tool_shed.model import mapping
|
||||
|
||||
from bootstrap_util import admin_user_info # noqa: I100
|
||||
from bootstrap_util import admin_user_info # noqa: I100,I201
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -124,7 +124,7 @@ if __name__ == "__main__":
|
||||
parser.add_option('-c', dest='config', action='store', help='.ini file to retried toolshed configuration from')
|
||||
(args, options) = parser.parse_args()
|
||||
ini_file = args.config
|
||||
config_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
config_parser = ConfigParser({'here': os.getcwd()})
|
||||
print("Reading ini file: ", ini_file)
|
||||
config_parser.read(ini_file)
|
||||
config_dict = {}
|
||||
|
||||
@@ -5,10 +5,14 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import urllib2
|
||||
import xml.etree.ElementTree as ET
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.urllib.request import (
|
||||
Request,
|
||||
urlopen
|
||||
)
|
||||
|
||||
FILENAMES = ['tool_dependencies.xml']
|
||||
ACTION_TYPES = ['download_by_url', 'download_file']
|
||||
|
||||
@@ -30,7 +34,7 @@ def main():
|
||||
for element in root.findall(".//action[@type='%s']" % action_type):
|
||||
url = element.text.strip()
|
||||
try:
|
||||
urllib2.urlopen(urllib2.Request(url))
|
||||
urlopen(Request(url))
|
||||
except Exception as e:
|
||||
print("Bad URL '%s' in file '%s': %s" % (url, path, e))
|
||||
except Exception as e:
|
||||
|
||||
@@ -20,7 +20,6 @@ To run this script, use "sh migrate_tools_to_repositories.sh" from this director
|
||||
'''
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
@@ -29,6 +28,7 @@ import tempfile
|
||||
from time import strftime
|
||||
|
||||
from mercurial import hg, ui
|
||||
from six.moves import configparser
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'lib')))
|
||||
|
||||
@@ -276,11 +276,11 @@ def main():
|
||||
print("%s - Migrating current tool archives to new tool repositories" % now)
|
||||
# tool_shed_wsgi.ini file
|
||||
ini_file = sys.argv[1]
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = configparser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
try:
|
||||
db_conn_str = conf_parser.get("app:main", "database_connection")
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
db_conn_str = conf_parser.get("app:main", "database_file")
|
||||
print('DB Connection: ', db_conn_str)
|
||||
# Instantiate app
|
||||
|
||||
+13
-10
@@ -4,18 +4,15 @@ Downloads files to temp locations. This script is invoked by the Transfer
|
||||
Manager (galaxy.jobs.transfer_manager) and should not normally be invoked by
|
||||
hand.
|
||||
"""
|
||||
import ConfigParser
|
||||
import json
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
import random
|
||||
import SocketServer
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import urllib2
|
||||
|
||||
try:
|
||||
import pexpect
|
||||
@@ -23,6 +20,12 @@ except ImportError:
|
||||
pexpect = None
|
||||
|
||||
from daemon import DaemonContext
|
||||
from six.moves import (
|
||||
configparser,
|
||||
socketserver
|
||||
)
|
||||
from six.moves.urllib.error import URLError
|
||||
from six.moves.urllib.request import urlopen
|
||||
from sqlalchemy import create_engine, MetaData, Table
|
||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||
|
||||
@@ -82,7 +85,7 @@ class GalaxyApp(object):
|
||||
model/database.
|
||||
"""
|
||||
def __init__(self, config_file):
|
||||
self.config = ConfigParser.ConfigParser(dict(database_file='database/universe.sqlite',
|
||||
self.config = configparser.ConfigParser(dict(database_file='database/universe.sqlite',
|
||||
file_path='database/files',
|
||||
transfer_worker_port_range='12275-12675',
|
||||
transfer_worker_log=None))
|
||||
@@ -95,7 +98,7 @@ class GalaxyApp(object):
|
||||
default_dburl = 'sqlite:///%s?isolation_level=IMMEDIATE' % self.config.get('app:main', 'database_file')
|
||||
try:
|
||||
dburl = self.config.get('app:main', 'database_connection')
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
dburl = default_dburl
|
||||
engine = create_engine(dburl)
|
||||
metadata = MetaData(engine)
|
||||
@@ -107,7 +110,7 @@ class GalaxyApp(object):
|
||||
return self.sa_session.query(self.model.TransferJob).get(int(id))
|
||||
|
||||
|
||||
class ListenerServer(SocketServer.ThreadingTCPServer):
|
||||
class ListenerServer(socketserver.ThreadingTCPServer):
|
||||
"""
|
||||
The listener will accept state requests and new transfers for as long as
|
||||
the manager is running.
|
||||
@@ -118,7 +121,7 @@ class ListenerServer(SocketServer.ThreadingTCPServer):
|
||||
while True:
|
||||
random_port = random.choice(port_range)
|
||||
try:
|
||||
SocketServer.ThreadingTCPServer.__init__(self, ('localhost', random_port), RequestHandlerClass)
|
||||
super(ListenerServer, self).__init__(('localhost', random_port), RequestHandlerClass)
|
||||
log.info('Listening on port %s' % random_port)
|
||||
break
|
||||
except Exception as e:
|
||||
@@ -128,7 +131,7 @@ class ListenerServer(SocketServer.ThreadingTCPServer):
|
||||
app.sa_session.flush()
|
||||
|
||||
|
||||
class ListenerRequestHandler(SocketServer.BaseRequestHandler):
|
||||
class ListenerRequestHandler(socketserver.BaseRequestHandler):
|
||||
"""
|
||||
Handle state or transfer requests received on the socket.
|
||||
"""
|
||||
@@ -217,8 +220,8 @@ def http_transfer(transfer_job):
|
||||
url = transfer_job.params['url']
|
||||
assert url.startswith('http://') or url.startswith('https://')
|
||||
try:
|
||||
f = urllib2.urlopen(url)
|
||||
except urllib2.URLError as e:
|
||||
f = urlopen(url)
|
||||
except URLError as e:
|
||||
yield dict(state=transfer_job.states.ERROR, info='Unable to open URL: %s' % str(e))
|
||||
return
|
||||
size = f.info().getheader('Content-Length')
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import ConfigParser
|
||||
import os
|
||||
import sys
|
||||
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
from sqlalchemy import create_engine, MetaData
|
||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||
|
||||
@@ -27,7 +27,7 @@ def main(opts, session, model):
|
||||
|
||||
|
||||
def create_database(config_file):
|
||||
parser = ConfigParser.SafeConfigParser()
|
||||
parser = SafeConfigParser()
|
||||
parser.read(config_file)
|
||||
# Determine which database connection to use.
|
||||
database_connection = parser.get('app:main', 'install_database_connection')
|
||||
|
||||
@@ -54,7 +54,7 @@ def _prepare_json_param_dict(param_dict):
|
||||
JSON serialization Support functions for exec_before_job hook
|
||||
"""
|
||||
rval = {}
|
||||
for key, value in param_dict.iteritems():
|
||||
for key, value in param_dict.items():
|
||||
if isinstance(value, dict):
|
||||
rval[key] = _prepare_json_param_dict(value)
|
||||
elif isinstance(value, list):
|
||||
@@ -83,7 +83,7 @@ def exec_before_job(app, inp_data, out_data, param_dict=None, tool=None):
|
||||
GALAXY_ROOT_DIR=param_dict.get('GALAXY_ROOT_DIR'),
|
||||
TOOL_PROVIDED_JOB_METADATA_FILE=galaxy.jobs.TOOL_PROVIDED_JOB_METADATA_FILE)
|
||||
json_filename = None
|
||||
for i, (out_name, data) in enumerate(out_data.iteritems()):
|
||||
for i, (out_name, data) in enumerate(out_data.items()):
|
||||
file_name = data.get_file_name()
|
||||
data_dict = dict(out_data_name=out_name,
|
||||
ext=data.ext,
|
||||
|
||||
Reference in New Issue
Block a user