diff --git a/doc/parse_gx_xsd.py b/doc/parse_gx_xsd.py
index 3b5fdb61196..b033608cc5c 100644
--- a/doc/parse_gx_xsd.py
+++ b/doc/parse_gx_xsd.py
@@ -68,7 +68,7 @@ class Tag(object):
@property
def _pretty_title(self):
- return " > ".join(["``%s``" % p for p in self.title.split("|")])
+ return " > ".join("``%s``" % p for p in self.title.split("|"))
def build_toc_entry(self):
return "* [%s](%s)" % (self._pretty_title, self._anchor)
diff --git a/lib/galaxy/config/config_manage.py b/lib/galaxy/config/config_manage.py
index cbd503bdd4a..c3adebbcf59 100644
--- a/lib/galaxy/config/config_manage.py
+++ b/lib/galaxy/config/config_manage.py
@@ -687,7 +687,7 @@ def _build_sample_yaml(args, app_desc):
description = getattr(schema, "description", None)
if description:
description = description.lstrip()
- as_comment = "\n".join(["# %s" % l for l in description.split("\n")]) + "\n"
+ as_comment = "\n".join("# %s" % l for l in description.split("\n")) + "\n"
f.write(as_comment)
_write_sample_section(args, f, 'uwsgi', Schema(UWSGI_OPTIONS), as_comment=False, uwsgi_hack=True)
_write_sample_section(args, f, app_desc.app_name, schema)
@@ -701,7 +701,7 @@ def _write_to_file(args, f, path):
else:
contents = f
if args.dry_run:
- contents_indented = "\n".join([" |%s" % l for l in contents.splitlines()])
+ contents_indented = "\n".join(" |%s" % l for l in contents.splitlines())
print("Overwriting %s with the following contents:\n%s" % (path, contents_indented))
print("... skipping because --dry-run is enabled.")
else:
@@ -756,7 +756,7 @@ def _write_option(args, f, key, option_value, as_comment=False, uwsgi_hack=False
else:
key_val_str = yaml.dump({key: value}, width=float("inf")).lstrip("{").rstrip("\n}")
lines = "%s%s%s" % (comment, as_comment_str, key_val_str)
- lines_idented = "\n".join([(" %s" % l) for l in lines.split("\n")])
+ lines_idented = "\n".join(" %s" % l for l in lines.split("\n"))
f.write("%s\n\n" % lines_idented)
diff --git a/lib/galaxy/containers/__init__.py b/lib/galaxy/containers/__init__.py
index 786e9c56d53..24e17b9951f 100644
--- a/lib/galaxy/containers/__init__.py
+++ b/lib/galaxy/containers/__init__.py
@@ -243,7 +243,7 @@ class ContainerInterface(with_metaclass(ABCMeta, object)):
"""
if isinstance(val, string_types):
return self._stringify_kwopt_string(flag, val)
- return ' '.join(['{flag} {value}'.format(flag=flag, value=shlex_quote(str(v))) for v in val])
+ return ' '.join('{flag} {value}'.format(flag=flag, value=shlex_quote(str(v))) for v in val)
def _stringify_kwopt_list_of_kvpairs(self, flag, val):
"""
diff --git a/lib/galaxy/containers/docker_model.py b/lib/galaxy/containers/docker_model.py
index 06dcc4f2ac8..a91cf2dcaba 100644
--- a/lib/galaxy/containers/docker_model.py
+++ b/lib/galaxy/containers/docker_model.py
@@ -48,7 +48,7 @@ class DockerAttributeContainer(object):
return hash(tuple(sorted([repr(x) for x in self._members])))
def __str__(self):
- return ', '.join([str(x) for x in self._members]) or 'None'
+ return ', '.join(str(x) for x in self._members) or 'None'
def __iter__(self):
return iter(self._members)
diff --git a/lib/galaxy/datatypes/dataproviders/external.py b/lib/galaxy/datatypes/dataproviders/external.py
index 42136db4b3f..87084f06f65 100644
--- a/lib/galaxy/datatypes/dataproviders/external.py
+++ b/lib/galaxy/datatypes/dataproviders/external.py
@@ -58,7 +58,7 @@ class SubprocessDataProvider(base.DataProvider):
except OSError as os_err:
command_str = ' '.join(self.command)
- raise OSError(' '.join([str(os_err), ':', command_str]))
+ raise OSError(' '.join((str(os_err), ':', command_str)))
return popen
diff --git a/lib/galaxy/datatypes/genetics.py b/lib/galaxy/datatypes/genetics.py
index ab57652746e..cbc7a1027b9 100644
--- a/lib/galaxy/datatypes/genetics.py
+++ b/lib/galaxy/datatypes/genetics.py
@@ -146,7 +146,7 @@ class GenomeGraphs(Tabular):
out.append('')
for row in d:
out.append('
')
- out.append(''.join(['| %s | ' % x for x in row.split()]))
+ out.append(''.join('%s | ' % x for x in row.split()))
out.append('
')
out.append('')
out = "".join(out)
diff --git a/lib/galaxy/datatypes/isa.py b/lib/galaxy/datatypes/isa.py
index 793265a471e..8446d7f5638 100644
--- a/lib/galaxy/datatypes/isa.py
+++ b/lib/galaxy/datatypes/isa.py
@@ -287,7 +287,7 @@ class _Isa(data.Data):
html += 'Submitted the %s
' % study.submission_date
html += 'Released on %s
' % study.public_release_date
- html += 'Experimental factors used: %s
' % ', '.join([x.name for x in study.factors])
+ html += 'Experimental factors used: %s
' % ', '.join(x.name for x in study.factors)
# Loop on all assays of this study
for assay in study.assays:
diff --git a/lib/galaxy/job_metrics/__init__.py b/lib/galaxy/job_metrics/__init__.py
index dbc03b4f474..c5da786c9c0 100644
--- a/lib/galaxy/job_metrics/__init__.py
+++ b/lib/galaxy/job_metrics/__init__.py
@@ -100,7 +100,7 @@ class JobInstrumenter(object):
commands.extend(util.listify(plugin_commands))
except Exception:
log.exception("Failed to generate pre-execute commands for plugin %s", plugin)
- return "\n".join([c for c in commands if c])
+ return "\n".join(c for c in commands if c)
def post_execute_commands(self, job_directory):
commands = []
@@ -111,7 +111,7 @@ class JobInstrumenter(object):
commands.extend(util.listify(plugin_commands))
except Exception:
log.exception("Failed to generate post-execute commands for plugin %s", plugin)
- return "\n".join([c for c in commands if c])
+ return "\n".join(c for c in commands if c)
def collect_properties(self, job_id, job_directory):
per_plugin_properties = {}
diff --git a/lib/galaxy/job_metrics/collectl/cli.py b/lib/galaxy/job_metrics/collectl/cli.py
index 0bad1d0f187..547fd234c79 100644
--- a/lib/galaxy/job_metrics/collectl/cli.py
+++ b/lib/galaxy/job_metrics/collectl/cli.py
@@ -92,7 +92,7 @@ class CollectlCli(object):
def __subsystems_arg(self, subsystems):
if subsystems:
- return "-s%s" % "".join([s.command_line_arg for s in subsystems])
+ return "-s%s" % "".join(s.command_line_arg for s in subsystems)
else:
return ""
diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py
index 250b4740504..86acbe17695 100644
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -727,7 +727,7 @@ class JobConfiguration(ConfiguresHandlers):
rval = {}
if handler_id in self.handler_runner_plugins:
plugins_to_load = [rp for rp in self.runner_plugins if rp['id'] in self.handler_runner_plugins[handler_id]]
- log.info("Handler '%s' will load specified runner plugins: %s", handler_id, ', '.join([rp['id'] for rp in plugins_to_load]))
+ log.info("Handler '%s' will load specified runner plugins: %s", handler_id, ', '.join(rp['id'] for rp in plugins_to_load))
else:
plugins_to_load = self.runner_plugins
log.info("Handler '%s' will load all configured runner plugins", handler_id)
diff --git a/lib/galaxy/jobs/handler.py b/lib/galaxy/jobs/handler.py
index 5b089288677..695eb276574 100644
--- a/lib/galaxy/jobs/handler.py
+++ b/lib/galaxy/jobs/handler.py
@@ -121,7 +121,7 @@ class JobHandlerQueue(Monitors):
self.__grab_conn_opts['isolation_level'] = 'SERIALIZABLE'
log.info(
"Handler job grabber initialized with '%s' assignment method for handler '%s', tag(s): %s", method,
- self.app.config.server_name, ', '.join([str(x) for x in self.app.job_config.handler_tags])
+ self.app.config.server_name, ', '.join(str(x) for x in self.app.job_config.handler_tags)
)
def start(self):
@@ -267,7 +267,7 @@ class JobHandlerQueue(Monitors):
try:
rows = conn.execute(self.__grab_query).fetchall()
if rows:
- log.debug('Grabbed job(s): %s', ', '.join([str(row[0]) for row in rows]))
+ log.debug('Grabbed job(s): %s', ', '.join(str(row[0]) for row in rows))
trans.commit()
else:
trans.rollback()
diff --git a/lib/galaxy/jobs/manager.py b/lib/galaxy/jobs/manager.py
index d44707a8720..e82b3286de1 100644
--- a/lib/galaxy/jobs/manager.py
+++ b/lib/galaxy/jobs/manager.py
@@ -35,7 +35,7 @@ class JobManager(object):
if jobs_at_startup:
log.info(
'No handler assigned at startup for the following jobs, will dispatch via message: %s',
- ', '.join([str(j.id) for j in jobs_at_startup]))
+ ', '.join(str(j.id) for j in jobs_at_startup))
for job in jobs_at_startup:
tool = self.app.toolbox.get_tool(job.tool_id, job.tool_version, exact=True)
self.enqueue(job, tool)
diff --git a/lib/galaxy/jobs/transfer_manager.py b/lib/galaxy/jobs/transfer_manager.py
index fedcacf302b..7f27f760452 100644
--- a/lib/galaxy/jobs/transfer_manager.py
+++ b/lib/galaxy/jobs/transfer_manager.py
@@ -63,7 +63,7 @@ class TransferManager(object):
running daemon, so it should be fairly quick to return.
"""
transfer_jobs = listify(transfer_jobs)
- printable_tj_ids = ', '.join([str(tj.id) for tj in transfer_jobs])
+ printable_tj_ids = ', '.join(str(tj.id) for tj in transfer_jobs)
log.debug('Initiating transfer job(s): %s' % printable_tj_ids)
# Set all jobs running before spawning, or else updating the state may
# clobber a state change performed by the worker.
diff --git a/lib/galaxy/managers/base.py b/lib/galaxy/managers/base.py
index 26b0fe2e01b..84e29f06f40 100644
--- a/lib/galaxy/managers/base.py
+++ b/lib/galaxy/managers/base.py
@@ -659,7 +659,7 @@ class ModelSerializer(HasAModelManager):
return None
split = type_id.split(TYPE_ID_SEP, 1)
# Note: it may not be best to encode the id at this layer
- return TYPE_ID_SEP.join([split[0], self.app.security.encode_id(split[1])])
+ return TYPE_ID_SEP.join((split[0], self.app.security.encode_id(split[1])))
# serializing to a view where a view is a predefied list of keys to serialize
def serialize_to_view(self, item, view=None, keys=None, default_view=None, **context):
@@ -1122,7 +1122,7 @@ class ModelFilterParser(HasAModelManager):
match = self.date_string_re.match(date_string)
if match:
- date_string = ' '.join([group for group in match.groups() if group])
+ date_string = ' '.join(group for group in match.groups() if group)
return date_string
raise ValueError('datetime strings must be in the ISO 8601 format and in the UTC')
diff --git a/lib/galaxy/managers/history_contents.py b/lib/galaxy/managers/history_contents.py
index 21199ffd87e..1b9bef760cb 100644
--- a/lib/galaxy/managers/history_contents.py
+++ b/lib/galaxy/managers/history_contents.py
@@ -507,7 +507,7 @@ class HistoryContentsFilters(base.ModelFilterParser,
def decode_type_id(self, type_id):
TYPE_ID_SEP = '-'
split = type_id.split(TYPE_ID_SEP, 1)
- return TYPE_ID_SEP.join([split[0], str(self.app.security.decode_id(split[1]))])
+ return TYPE_ID_SEP.join((split[0], str(self.app.security.decode_id(split[1]))))
def parse_type_id_list(self, type_id_list_string, sep=','):
"""
diff --git a/lib/galaxy/managers/markdown_util.py b/lib/galaxy/managers/markdown_util.py
index 111f053d033..c547353ede2 100644
--- a/lib/galaxy/managers/markdown_util.py
+++ b/lib/galaxy/managers/markdown_util.py
@@ -387,7 +387,7 @@ class ToBasicMarkdownDirectiveHandler(GalaxyInternalMarkdownDirectiveHandler):
markdown += " | "
value = parameter["value"]
if isinstance(value, list):
- markdown += ", ".join(["%s: %s" % (p["hid"], p["name"]) for p in value])
+ markdown += ", ".join("%s: %s" % (p["hid"], p["name"]) for p in value)
else:
markdown += value
markdown += " |\n"
@@ -400,7 +400,7 @@ class MarkdownFormatHelpers(object):
@staticmethod
def literal_via_fence(content):
- return "\n%s\n" % "\n".join([" %s" % l for l in content.splitlines()])
+ return "\n%s\n" % "\n".join(" %s" % l for l in content.splitlines())
@staticmethod
def indicate_data_truncated():
diff --git a/lib/galaxy/managers/users.py b/lib/galaxy/managers/users.py
index 71ff455a74d..45726999916 100644
--- a/lib/galaxy/managers/users.py
+++ b/lib/galaxy/managers/users.py
@@ -68,9 +68,9 @@ class UserManager(base.ModelManager, deletable.PurgableManagerMixin):
return None, message
if not email or not username or not password or not confirm:
return None, "Please provide email, username and password."
- message = "\n".join([validate_email(trans, email),
+ message = "\n".join((validate_email(trans, email),
validate_password(trans, password, confirm),
- validate_publicname(trans, username)]).rstrip()
+ validate_publicname(trans, username))).rstrip()
if message:
return None, message
email = util.restore_text(email)
diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py
index 5296019faca..e731553d22f 100644
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -3253,7 +3253,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
@hybrid.hybrid_property
def type_id(self):
- return u'-'.join([self.content_type, str(self.id)])
+ return u'-'.join((self.content_type, str(self.id)))
@type_id.expression
def type_id(cls):
@@ -3526,7 +3526,7 @@ class LibraryDataset(RepresentById):
if isinstance(val, MetadataFile):
val = val.file_name
elif isinstance(val, list):
- val = ', '.join([str(v) for v in val])
+ val = ', '.join(str(v) for v in val)
rval['metadata_' + name] = val
return rval
@@ -4160,7 +4160,7 @@ class HistoryDatasetCollectionAssociation(DatasetCollectionInstance,
@hybrid.hybrid_property
def type_id(self):
- return u'-'.join([self.content_type, str(self.id)])
+ return u'-'.join((self.content_type, str(self.id)))
@type_id.expression
def type_id(cls):
diff --git a/lib/galaxy/model/metadata.py b/lib/galaxy/model/metadata.py
index 0b93c5eb363..c257e2960e4 100644
--- a/lib/galaxy/model/metadata.py
+++ b/lib/galaxy/model/metadata.py
@@ -473,7 +473,7 @@ class ColumnTypesParameter(MetadataParameter):
class ListParameter(MetadataParameter):
def to_string(self, value):
- return ",".join([str(x) for x in value])
+ return ",".join(str(x) for x in value)
class DictParameter(MetadataParameter):
diff --git a/lib/galaxy/model/security.py b/lib/galaxy/model/security.py
index 6505d60f521..ec728dc6143 100644
--- a/lib/galaxy/model/security.py
+++ b/lib/galaxy/model/security.py
@@ -910,7 +910,7 @@ class GalaxyRBACAgent(RBACAgent):
sharing_role = role
break
if sharing_role is None:
- sharing_role = self.model.Role(name="Sharing role for: " + ", ".join([u.email for u in users]),
+ sharing_role = self.model.Role(name="Sharing role for: " + ", ".join(u.email for u in users),
type=self.model.Role.types.SHARING)
self.sa_session.add(sharing_role)
self.sa_session.flush()
diff --git a/lib/galaxy/selenium/components.py b/lib/galaxy/selenium/components.py
index 2eac23ad8ae..4884ff48c56 100644
--- a/lib/galaxy/selenium/components.py
+++ b/lib/galaxy/selenium/components.py
@@ -73,7 +73,7 @@ class SelectorTemplate(Target):
selector = self._selector
if self.__kwds is not None:
selector = string.Template(selector).substitute(self.__kwds)
- selector = selector + "".join([".%s" % c for c in self.with_classes])
+ selector = selector + "".join(".%s" % c for c in self.with_classes)
return selector
@property
diff --git a/lib/galaxy/tool_shed/galaxy_install/tool_dependencies/recipe/install_environment.py b/lib/galaxy/tool_shed/galaxy_install/tool_dependencies/recipe/install_environment.py
index 5dd7588da73..3221dad2b84 100644
--- a/lib/galaxy/tool_shed/galaxy_install/tool_dependencies/recipe/install_environment.py
+++ b/lib/galaxy/tool_shed/galaxy_install/tool_dependencies/recipe/install_environment.py
@@ -270,7 +270,7 @@ class InstallEnvironment(object):
log.exception(str(e))
def __setup_environment(self):
- return "&&".join([". %s" % file for file in self.__valid_env_shell_file_paths()])
+ return "&&".join(". %s" % _ for _ in self.__valid_env_shell_file_paths())
def __valid_env_shell_file_paths(self):
- return [file for file in self.env_shell_file_paths if os.path.exists(file)]
+ return [_ for _ in self.env_shell_file_paths if os.path.exists(_)]
diff --git a/lib/galaxy/tool_shed/util/repository_util.py b/lib/galaxy/tool_shed/util/repository_util.py
index 12f53e6ca93..6cc746676b4 100644
--- a/lib/galaxy/tool_shed/util/repository_util.py
+++ b/lib/galaxy/tool_shed/util/repository_util.py
@@ -161,7 +161,7 @@ def generate_tool_shed_repository_install_dir(repository_clone_url, changeset_re
tool_shed_url = items[0]
repo_path = items[1]
tool_shed_url = common_util.remove_port_from_tool_shed_url(tool_shed_url)
- return '/'.join([tool_shed_url, 'repos', repo_path, changeset_revision])
+ return '/'.join((tool_shed_url, 'repos', repo_path, changeset_revision))
def get_absolute_path_to_file_in_repository(repo_files_dir, file_name):
diff --git a/lib/galaxy/tool_util/deps/commands.py b/lib/galaxy/tool_util/deps/commands.py
index 86b6a871338..188a640b92e 100644
--- a/lib/galaxy/tool_util/deps/commands.py
+++ b/lib/galaxy/tool_util/deps/commands.py
@@ -107,7 +107,7 @@ def argv_to_str(command_argv, quote=True):
code.
"""
map_func = shlex_quote if quote else lambda x: x
- return " ".join([map_func(c) for c in command_argv if c is not None])
+ return " ".join(map_func(c) for c in command_argv if c is not None)
def _wait(cmds, **popen_kwds):
diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py
index cac93ddd30d..5f589e8de17 100644
--- a/lib/galaxy/tool_util/verify/interactor.py
+++ b/lib/galaxy/tool_util/verify/interactor.py
@@ -542,7 +542,7 @@ class GalaxyInteractorApi(object):
print(ERROR_MESSAGE_DATASET_SEP)
def format_for_summary(self, blob, empty_message, prefix="| "):
- contents = "\n".join(["%s%s" % (prefix, line.strip()) for line in StringIO(blob).readlines() if line.rstrip("\n\r")])
+ contents = "\n".join("%s%s" % (prefix, line.strip()) for line in StringIO(blob).readlines() if line.rstrip("\n\r"))
return contents or "%s*%s*" % (prefix, empty_message)
def _dataset_provenance(self, history_id, id):
diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py
index fca283cb5c6..08ece062900 100644
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -766,7 +766,7 @@ class DefaultToolAction(object):
-
+
"""
diff --git a/lib/galaxy/tools/error_reports/plugins/github.py b/lib/galaxy/tools/error_reports/plugins/github.py
index d8f3b80173b..15060ed0a55 100644
--- a/lib/galaxy/tools/error_reports/plugins/github.py
+++ b/lib/galaxy/tools/error_reports/plugins/github.py
@@ -72,7 +72,7 @@ class GithubPlugin(BaseGitPlugin):
# Determine the GitLab project URL and the issue cache key
github_projecturl = urlparse.urlparse(ts_repourl).path[1:] if (ts_repourl and not self.git_default_repo_only) \
- else "/".join([self.git_default_repo_owner, self.git_default_repo_name])
+ else "/".join((self.git_default_repo_owner, self.git_default_repo_name))
issue_cache_key = self._get_issue_cache_key(job, ts_repourl)
# Connect to the repo
diff --git a/lib/galaxy/tools/error_reports/plugins/gitlab.py b/lib/galaxy/tools/error_reports/plugins/gitlab.py
index bd82690dccf..64f0656a9ba 100644
--- a/lib/galaxy/tools/error_reports/plugins/gitlab.py
+++ b/lib/galaxy/tools/error_reports/plugins/gitlab.py
@@ -109,7 +109,7 @@ class GitLabPlugin(BaseGitPlugin):
# Determine the GitLab project URL and the issue cache key
gitlab_projecturl = urlparse.urlparse(ts_repourl).path[1:] if (ts_repourl and not self.git_default_repo_only)\
- else "/".join([self.git_default_repo_owner, self.git_default_repo_name])
+ else "/".join((self.git_default_repo_owner, self.git_default_repo_name))
issue_cache_key = self._get_issue_cache_key(job, ts_repourl)
gitlab_urlencodedpath = urllib.quote_plus(gitlab_projecturl)
@@ -151,7 +151,7 @@ class GitLabPlugin(BaseGitPlugin):
# Create a new issue.
self._create_issue(issue_cache_key, error_title, error_message, gl_project, gl_userid=gl_userid)
except (gitlab.GitlabOwnershipError, gitlab.GitlabGetError):
- gitlab_projecturl = "/".join([self.git_default_repo_owner, self.git_default_repo_name])
+ gitlab_projecturl = "/".join((self.git_default_repo_owner, self.git_default_repo_name))
gitlab_urlencodedpath = urllib.quote_plus(gitlab_projecturl)
# Make sure we are always logged in, then retrieve the GitLab project if it isn't cached.
self.gitlab = self.gitlab_connect()
@@ -217,7 +217,7 @@ class GitLabPlugin(BaseGitPlugin):
def _append_issue(self, issue_cache_key, error_title, error_message, **kwargs):
# Add a comment to an existing issue
- gl_url = "/".join([
+ gl_url = "/".join((
self.gitlab_base_url,
"api",
"v4",
@@ -226,7 +226,7 @@ class GitLabPlugin(BaseGitPlugin):
"issues",
str(self.issue_cache[issue_cache_key][error_title]),
"notes"
- ])
+ ))
self.gitlab.http_post(gl_url, post_data={'body': error_message})
def _fill_issue_cache(self, git_project, issue_cache_key):
diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py
index 43d65298a36..5fc67474e97 100644
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1845,7 +1845,7 @@ class DataToolParameter(BaseDataToolParameter):
value = [value]
if value:
try:
- return ", ".join(["%s: %s" % (item.hid, item.name) for item in value])
+ return ", ".join("%s: %s" % (item.hid, item.name) for item in value)
except Exception:
pass
return "No dataset."
diff --git a/lib/galaxy/tools/search/__init__.py b/lib/galaxy/tools/search/__init__.py
index ae1432a9468..85afae25702 100644
--- a/lib/galaxy/tools/search/__init__.py
+++ b/lib/galaxy/tools/search/__init__.py
@@ -91,14 +91,14 @@ class ToolBoxSearch(object):
}
if tool.name.find('-') != -1:
# Replace hyphens, since they are wildcards in Whoosh causing false positives
- add_doc_kwds['name'] = (' ').join([token.text for token in self.rex(to_unicode(tool.name))])
+ add_doc_kwds['name'] = (' ').join(token.text for token in self.rex(to_unicode(tool.name)))
else:
add_doc_kwds['name'] = to_unicode(tool.name)
if tool.guid:
# Create a stub consisting of owner, repo, and tool from guid
slash_indexes = [m.start() for m in re.finditer('/', tool.guid)]
id_stub = tool.guid[(slash_indexes[1] + 1): slash_indexes[4]]
- add_doc_kwds['stub'] = (' ').join([token.text for token in self.rex(to_unicode(id_stub))])
+ add_doc_kwds['stub'] = (' ').join(token.text for token in self.rex(to_unicode(id_stub)))
else:
add_doc_kwds['stub'] = to_unicode(id)
if tool.labels:
@@ -143,7 +143,7 @@ class ToolBoxSearch(object):
cleaned_query = q.lower()
# Replace hyphens, since they are wildcards in Whoosh causing false positives
if cleaned_query.find('-') != -1:
- cleaned_query = (' ').join([token.text for token in self.rex(to_unicode(cleaned_query))])
+ cleaned_query = (' ').join(token.text for token in self.rex(to_unicode(cleaned_query)))
if tool_enable_ngram_search is True:
rval = self._search_ngrams(cleaned_query, tool_ngram_minsize, tool_ngram_maxsize, tool_search_limit)
return rval
diff --git a/lib/galaxy/tools/toolbox/integrated_panel.py b/lib/galaxy/tools/toolbox/integrated_panel.py
index 6e8d0fdf7a6..496456d6722 100644
--- a/lib/galaxy/tools/toolbox/integrated_panel.py
+++ b/lib/galaxy/tools/toolbox/integrated_panel.py
@@ -98,7 +98,7 @@ $INTEGRATED_TOOL_PANEL
label_version = section_item.version or ''
integrated_tool_panel.append(' \n' % (label_id, label_text, label_version))
integrated_tool_panel.append(' \n')
- tool_panel_description = '\n '.join([l for l in INTEGRATED_TOOL_PANEL_DESCRIPTION.split("\n") if l])
+ tool_panel_description = '\n '.join(l for l in INTEGRATED_TOOL_PANEL_DESCRIPTION.split("\n") if l)
tp_string = template.substitute(INTEGRATED_TOOL_PANEL_DESCRIPTION=tool_panel_description,
INTEGRATED_TOOL_PANEL='\n'.join(integrated_tool_panel))
with open(filename, "w") as integrated_tool_panel_file:
diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py
index 1dcb20b2303..240d9930277 100644
--- a/lib/galaxy/util/__init__.py
+++ b/lib/galaxy/util/__init__.py
@@ -276,7 +276,7 @@ def xml_to_string(elem, pretty=False):
raise e
if xml_str and pretty:
pretty_string = xml.dom.minidom.parseString(xml_str).toprettyxml(indent=' ')
- return "\n".join([line for line in pretty_string.split('\n') if not re.match(r'^[\s\\nb\']*$', line)])
+ return "\n".join(line for line in pretty_string.split('\n') if not re.match(r'^[\s\\nb\']*$', line))
return xml_str
diff --git a/lib/galaxy/util/json.py b/lib/galaxy/util/json.py
index 80f7779c946..ceef6288acc 100644
--- a/lib/galaxy/util/json.py
+++ b/lib/galaxy/util/json.py
@@ -165,7 +165,7 @@ def jsonrpc_request(method, params=None, id=None, jsonrpc='2.0'):
if params:
request['params'] = params
if id is not None and id is True:
- request['id'] = ''.join([random.choice(string.hexdigits) for i in range(16)])
+ request['id'] = ''.join(random.choice(string.hexdigits) for i in range(16))
elif id is not None:
request['id'] = id
return request
diff --git a/lib/galaxy/util/path/__init__.py b/lib/galaxy/util/path/__init__.py
index d4f770d01f8..417f580bd97 100644
--- a/lib/galaxy/util/path/__init__.py
+++ b/lib/galaxy/util/path/__init__.py
@@ -268,7 +268,7 @@ def joinext(root, ext):
:rtype: string
:returns: ``root`` joined with ``ext`` separated by a single ``os.extsep``
"""
- return extsep.join([root.rstrip(extsep), ext.lstrip(extsep)])
+ return extsep.join((root.rstrip(extsep), ext.lstrip(extsep)))
def has_ext(path, ext, aliases=False, ignore=None):
diff --git a/lib/galaxy/util/rules_dsl.py b/lib/galaxy/util/rules_dsl.py
index 88b762aa9a1..2ab9bd659a7 100644
--- a/lib/galaxy/util/rules_dsl.py
+++ b/lib/galaxy/util/rules_dsl.py
@@ -558,9 +558,9 @@ class RuleSet(object):
@property
def display(self):
message = "Rules:\n"
- message += "".join(["- %s\n" % r for r in self.raw_rules])
+ message += "".join("- %s\n" % r for r in self.raw_rules)
message += "Column Definitions:\n"
- message += "".join(["- %s\n" % m for m in self.raw_mapping])
+ message += "".join("- %s\n" % m for m in self.raw_mapping)
return message
diff --git a/lib/galaxy/visualization/plugins/interactive_environments.py b/lib/galaxy/visualization/plugins/interactive_environments.py
index 505f145c047..1ebce51c994 100644
--- a/lib/galaxy/visualization/plugins/interactive_environments.py
+++ b/lib/galaxy/visualization/plugins/interactive_environments.py
@@ -431,7 +431,7 @@ class InteractiveEnvironmentRequest(object):
log.info("Starting docker container for IE {0} with command [{1}]".format(
self.attr.viz_id,
- ' '.join([shlex_quote(x) for x in redacted_command])
+ ' '.join(shlex_quote(x) for x in redacted_command)
))
p = Popen(raw_cmd, stdout=PIPE, stderr=PIPE, close_fds=True)
stdout, stderr = p.communicate()
@@ -545,7 +545,7 @@ class InteractiveEnvironmentRequest(object):
raw_cmd = self.base_docker_cmd('inspect') + [container_id]
log.info("Inspecting docker container {0} with command [{1}]".format(
container_id,
- ' '.join([shlex_quote(x) for x in raw_cmd])
+ ' '.join(shlex_quote(x) for x in raw_cmd)
))
p = Popen(raw_cmd, stdout=PIPE, stderr=PIPE, close_fds=True)
diff --git a/lib/galaxy/visualization/plugins/plugin.py b/lib/galaxy/visualization/plugins/plugin.py
index 5435f180562..2a0ee87de5e 100644
--- a/lib/galaxy/visualization/plugins/plugin.py
+++ b/lib/galaxy/visualization/plugins/plugin.py
@@ -71,10 +71,10 @@ class VisualizationPlugin(ServesTemplatesPluginMixin):
self.name = name
self.config = config
base_url = context.get('base_url', '')
- self.base_url = '/'.join([base_url, self.name]) if base_url else self.name
+ self.base_url = '/'.join((base_url, self.name)) if base_url else self.name
self.static_path = self._get_static_path(self.path)
if self.static_path and os.path.exists(os.path.join(self.static_path, 'logo.png')):
- self.config['logo'] = '/'.join([self.static_path, 'logo.png'])
+ self.config['logo'] = self.static_path + '/logo.png'
template_cache_dir = context.get('template_cache_dir', None)
additional_template_paths = context.get('additional_template_paths', [])
self._set_up_template_plugin(template_cache_dir, additional_template_paths=additional_template_paths)
diff --git a/lib/galaxy/web/statsd_client.py b/lib/galaxy/web/statsd_client.py
index 0065f3252d5..212b5cee6ca 100644
--- a/lib/galaxy/web/statsd_client.py
+++ b/lib/galaxy/web/statsd_client.py
@@ -33,7 +33,7 @@ class GalaxyStatsdClient(object):
def _effective_infix(self, path, tags):
tags = tags or {}
if self.statsd_influxdb and tags:
- return ',' + ",".join(["%s=%s" % (k, v) for (k, v) in tags.items()]) + ",path="
+ return ',' + ",".join("%s=%s" % (k, v) for (k, v) in tags.items()) + ",path="
if self.statsd_influxdb:
return ',path='
else:
diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py
index d4e8c395c2f..78af5c0dcbc 100644
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -926,7 +926,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
def encode_type_id(self, type_id):
TYPE_ID_SEP = '-'
split = type_id.split(TYPE_ID_SEP, 1)
- return TYPE_ID_SEP.join([split[0], self.app.security.encode_id(split[1])])
+ return TYPE_ID_SEP.join((split[0], self.app.security.encode_id(split[1])))
@expose_api_raw
def archive(self, trans, history_id, filename='', format='tgz', dry_run=True, **kwd):
@@ -1040,7 +1040,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
for file_path, archive_path in paths_and_files:
archive.add(file_path, archive_path)
- archive_name = '.'.join([archive_base_name, archive_ext])
+ archive_name = '.'.join((archive_base_name, archive_ext))
trans.response.set_content_type("application/x-tar")
trans.response.headers["Content-Disposition"] = 'attachment; filename="{}"'.format(archive_name)
archive.wsgi_status = trans.response.wsgi_status()
diff --git a/lib/galaxy/webapps/galaxy/api/users.py b/lib/galaxy/webapps/galaxy/api/users.py
index 3622fa4047e..4f5a5d576af 100644
--- a/lib/galaxy/webapps/galaxy/api/users.py
+++ b/lib/galaxy/webapps/galaxy/api/users.py
@@ -188,9 +188,9 @@ class UserAPIController(BaseAPIController, UsesTagsMixin, CreatesApiKeysMixin, B
username = payload['username']
email = payload['email']
password = payload['password']
- message = "\n".join([validate_email(trans, email),
+ message = "\n".join((validate_email(trans, email),
validate_password(trans, password, password),
- validate_publicname(trans, username)]).rstrip()
+ validate_publicname(trans, username))).rstrip()
if message:
raise exceptions.RequestParameterInvalidException(message)
else:
diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py
index d529e58d54d..c3f097fc52c 100644
--- a/lib/galaxy/webapps/galaxy/api/workflows.py
+++ b/lib/galaxy/webapps/galaxy/api/workflows.py
@@ -196,7 +196,7 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
for tool_id in workflow['missing_tools']:
toolshed, _, owner, name, tool, version = tool_id.split('/')
shed_url = self.__get_full_shed_url(toolshed)
- repo_identifier = '/'.join([toolshed, owner, name])
+ repo_identifier = '/'.join((toolshed, owner, name))
if repo_identifier not in workflows_by_toolshed:
workflows_by_toolshed[repo_identifier] = dict(shed=shed_url.rstrip('/'), repository=name, owner=owner, tools=[tool_id], workflows=[workflow['name']])
else:
diff --git a/lib/galaxy/webapps/galaxy/controllers/dataset.py b/lib/galaxy/webapps/galaxy/controllers/dataset.py
index 708423f3a3b..62e9f7494d3 100644
--- a/lib/galaxy/webapps/galaxy/controllers/dataset.py
+++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py
@@ -1053,10 +1053,10 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
if current_history in target_histories:
refresh_frames = ['history']
trans.sa_session.flush()
- hist_names_str = ", ".join(['%s' %
- (url_for(controller="history", action="switch_to_history",
- hist_id=trans.security.encode_id(hist.id)), escape(hist.name))
- for hist in target_histories])
+ hist_names_str = ", ".join('%s' %
+ (url_for(controller="history", action="switch_to_history",
+ hist_id=trans.security.encode_id(hist.id)), escape(hist.name))
+ for hist in target_histories)
num_source = len(source_content_ids) - invalid_contents
num_target = len(target_histories)
done_msg = "%i %s copied to %i %s: %s." % (num_source, inflector.cond_plural(num_source, "dataset"), num_target, inflector.cond_plural(num_target, "history"), hist_names_str)
diff --git a/lib/galaxy/webapps/galaxy/controllers/root.py b/lib/galaxy/webapps/galaxy/controllers/root.py
index 6140289596b..dd0c1874c78 100644
--- a/lib/galaxy/webapps/galaxy/controllers/root.py
+++ b/lib/galaxy/webapps/galaxy/controllers/root.py
@@ -121,7 +121,7 @@ class RootController(controller.JSAppLauncher, UsesAnnotations):
if tagged_tool.tool_id not in results:
results.append(tagged_tool.tool_id)
if trans.user:
- trans.user.preferences['selected_tool_tags'] = ','.join([tag.name for tag in tags])
+ trans.user.preferences['selected_tool_tags'] = ','.join(tag.name for tag in tags)
trans.sa_session.flush()
elif trans.user:
trans.user.preferences['selected_tool_tags'] = ''
diff --git a/lib/galaxy/webapps/galaxy/controllers/shed_tool_static.py b/lib/galaxy/webapps/galaxy/controllers/shed_tool_static.py
index d938f86c958..2261b5eb10a 100644
--- a/lib/galaxy/webapps/galaxy/controllers/shed_tool_static.py
+++ b/lib/galaxy/webapps/galaxy/controllers/shed_tool_static.py
@@ -24,7 +24,7 @@ class ShedToolStatic(BaseUIController):
.. image:: some_image.jpg
.. image:: /deep/some_image.png
"""
- guid = '/'.join([shed, 'repos', owner, repo, tool, version])
+ guid = '/'.join((shed, 'repos', owner, repo, tool, version))
tool = trans.app.toolbox.get_tool(guid)
repo_path = tool._repository_dir
if 'static/images' not in image_file:
diff --git a/lib/galaxy/webapps/galaxy/controllers/user.py b/lib/galaxy/webapps/galaxy/controllers/user.py
index 2284daae3d6..6b949765621 100644
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -93,8 +93,8 @@ class User(BaseUIController, UsesFormDefinitionsMixin, CreatesApiKeysMixin):
if autoreg["auto_reg"]:
email = autoreg["email"]
username = autoreg["username"]
- message = " ".join([validate_email(trans, email, allow_empty=True),
- validate_publicname(trans, username)]).rstrip()
+ message = " ".join((validate_email(trans, email, allow_empty=True),
+ validate_publicname(trans, username))).rstrip()
if not message:
user = self.user_manager.create(email=email, username=username, password="")
if trans.app.config.user_activation_on:
diff --git a/lib/galaxy/webapps/reports/controllers/tools.py b/lib/galaxy/webapps/reports/controllers/tools.py
index 789685c0cf7..b606321418c 100644
--- a/lib/galaxy/webapps/reports/controllers/tools.py
+++ b/lib/galaxy/webapps/reports/controllers/tools.py
@@ -322,7 +322,7 @@ class Tools(BaseUIController):
spaces = [' ', '\t', ' ']
for key in keys:
- new_key = ''.join([_ for _ in key.split('\n') if _ and _ not in spaces])
+ new_key = ''.join(_ for _ in key.split('\n') if _ and _ not in spaces)
if len(new_key) >= 100:
to_replace = []
words = key.split('\n')
diff --git a/lib/galaxy_test/api/test_tools.py b/lib/galaxy_test/api/test_tools.py
index b29404c3751..24c1817804e 100644
--- a/lib/galaxy_test/api/test_tools.py
+++ b/lib/galaxy_test/api/test_tools.py
@@ -1621,7 +1621,7 @@ class ToolsTestCase(ApiTestCase):
self.assertEqual(len(outputs), 1)
output1 = outputs[0]
output1_content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output1)
- self.assertEqual(output1_content.strip(), '\n'.join([d['name'] for d in element_identifiers]))
+ self.assertEqual(output1_content.strip(), '\n'.join(d['name'] for d in element_identifiers))
@skip_without_tool("identifier_in_actions")
@uses_test_history(require_new=False)
diff --git a/lib/galaxy_test/driver/driver_util.py b/lib/galaxy_test/driver/driver_util.py
index 1475c8669e1..ed06f13cdb2 100644
--- a/lib/galaxy_test/driver/driver_util.py
+++ b/lib/galaxy_test/driver/driver_util.py
@@ -775,7 +775,7 @@ def launch_uwsgi(kwargs, tempdir, prefix=DEFAULT_CONFIG_PREFIX, config_object=No
handle_uwsgi_cli_command(uwsgi_command)
# we don't want to quote every argument but we don't want to print unquoted ones either, so do this
- log.info("Starting uwsgi with command line: %s", ' '.join([shlex_quote(x) for x in uwsgi_command]))
+ log.info("Starting uwsgi with command line: %s", ' '.join(shlex_quote(x) for x in uwsgi_command))
p = subprocess.Popen(
uwsgi_command,
cwd=galaxy_root,
diff --git a/lib/tool_shed/grids/repository_grids.py b/lib/tool_shed/grids/repository_grids.py
index c76b6210ae5..5c212d61448 100644
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -1138,7 +1138,7 @@ class ToolDependenciesGrid(RepositoryMetadataGrid):
if num_env_dicts > 0:
td_str += '' % trans.security.encode_id(repository_metadata.id)
td_str += 'environment: '
- td_str += ', '.join([escape_html(env_dict['name']) for env_dict in env_dicts])
+ td_str += ', '.join(escape_html(env_dict['name']) for env_dict in env_dicts)
td_str += '
'
for index, key in enumerate(sorted_keys):
if key == 'set_environment':
diff --git a/lib/tool_shed/test/base/twilltestcase.py b/lib/tool_shed/test/base/twilltestcase.py
index 8aa315cb93d..e678d6ae21d 100644
--- a/lib/tool_shed/test/base/twilltestcase.py
+++ b/lib/tool_shed/test/base/twilltestcase.py
@@ -183,7 +183,7 @@ class ShedTwillTestCase(FunctionalTestCase):
hdas.append(hda)
json_data = hdas
if show_details:
- params['details'] = ','.join([hda['id'] for hda in json_data])
+ params['details'] = ','.join(hda['id'] for hda in json_data)
api_url = '/api/histories/%s/contents' % encoded_history_id
json_data = self.json_from_url(api_url, params=params)
return json_data
@@ -1151,7 +1151,7 @@ class ShedTwillTestCase(FunctionalTestCase):
def get_tool_panel_section_from_api(self, metadata):
tool_metadata = metadata['tools']
tool_guid = quote_plus(tool_metadata[0]['guid'], safe='')
- api_url = '/%s' % '/'.join(['api', 'tools', tool_guid])
+ api_url = '/api/tools/%s' % tool_guid
self.visit_galaxy_url(api_url)
tool_dict = loads(self.last_page())
tool_panel_section = tool_dict['panel_section_name']
diff --git a/lib/tool_shed/webapp/api/users.py b/lib/tool_shed/webapp/api/users.py
index 1216052904e..d69bbf106d6 100644
--- a/lib/tool_shed/webapp/api/users.py
+++ b/lib/tool_shed/webapp/api/users.py
@@ -125,7 +125,7 @@ class UsersController(BaseAPIController):
def __validate(self, trans, email, password, confirm, username):
if username in ['repos']:
return "The term '%s' is a reserved word in the Tool Shed, so it cannot be used as a public user name." % username
- message = "\n".join([validate_email(trans, email),
+ message = "\n".join((validate_email(trans, email),
validate_password(trans, password, confirm),
- validate_publicname(trans, username)]).rstrip()
+ validate_publicname(trans, username))).rstrip()
return message
diff --git a/lib/tool_shed/webapp/controllers/user.py b/lib/tool_shed/webapp/controllers/user.py
index 6e6f1d8f403..d0f29b5a8f4 100644
--- a/lib/tool_shed/webapp/controllers/user.py
+++ b/lib/tool_shed/webapp/controllers/user.py
@@ -456,7 +456,7 @@ class User(BaseUser):
def __validate(self, trans, email, password, confirm, username):
if username in ['repos']:
return "The term '%s' is a reserved word in the Tool Shed, so it cannot be used as a public user name." % username
- message = "\n".join([validate_email(trans, email),
+ message = "\n".join((validate_email(trans, email),
validate_password(trans, password, confirm),
- validate_publicname(trans, username)]).rstrip()
+ validate_publicname(trans, username))).rstrip()
return message
diff --git a/scripts/api/common.py b/scripts/api/common.py
index 646499cf5f1..eda3fee3e60 100644
--- a/scripts/api/common.py
+++ b/scripts/api/common.py
@@ -24,7 +24,7 @@ def make_url(api_key, url, args=None):
argsep = '?'
if '?key=' not in url and '&key=' not in url:
args.insert(0, ('key', api_key))
- return url + argsep + '&'.join(['='.join(t) for t in args])
+ return url + argsep + '&'.join('='.join(t) for t in args)
def get(api_key, url):
diff --git a/scripts/bootstrap_history.py b/scripts/bootstrap_history.py
index 216595bc6ff..41a170212bb 100644
--- a/scripts/bootstrap_history.py
+++ b/scripts/bootstrap_history.py
@@ -344,8 +344,8 @@ def release_issue(argv):
def do_release(argv):
release_name = argv[2]
release_file = _release_file(release_name + ".rst")
- enhancement_targets = "\n\n".join([".. enhancement_tag_%s" % a for a in GROUPPED_TAGS.values()])
- bug_targets = "\n\n".join([".. bug_tag_%s" % a for a in GROUPPED_TAGS.values()])
+ enhancement_targets = "\n\n".join(".. enhancement_tag_%s" % a for a in GROUPPED_TAGS.values())
+ bug_targets = "\n\n".join(".. bug_tag_%s" % a for a in GROUPPED_TAGS.values())
template = TEMPLATE
template = template.replace(".. enhancement", "%s\n\n.. enhancement" % enhancement_targets)
template = template.replace(".. bug", "%s\n\n.. bug" % bug_targets)
@@ -774,7 +774,7 @@ def wrap(message):
message_lines = message.splitlines()
first_lines = "\n".join(wrapper.wrap(message_lines[0]))
wrapper.initial_indent = " "
- rest_lines = "\n".join(["\n".join(wrapper.wrap(m)) for m in message_lines[1:]])
+ rest_lines = "\n".join("\n".join(wrapper.wrap(m)) for m in message_lines[1:])
return first_lines + ("\n" + rest_lines if rest_lines else "")
diff --git a/scripts/cleanup_datasets/pgcleanup.py b/scripts/cleanup_datasets/pgcleanup.py
index 32fcc6a34fa..a0d012efb71 100755
--- a/scripts/cleanup_datasets/pgcleanup.py
+++ b/scripts/cleanup_datasets/pgcleanup.py
@@ -207,7 +207,7 @@ class Action(object):
self.log.info('%s: %s' % (primary_key, primary))
for causal, s in zip(self.causals, results[primary]):
for r in sorted(s):
- secondaries = ', '.join(['%s: %s' % x for x in zip(causal[1:], r[1:])])
+ secondaries = ', '.join('%s: %s' % x for x in zip(causal[1:], r[1:]))
self.log.info('%s %s caused %s' % (causal[0], r[0], secondaries))
def handle_results(self, cur):
@@ -646,7 +646,7 @@ class PurgeDeletedUsers(PurgesHDAs, RemovesMetadataFiles, Action):
user_ids = sorted(self.__zero_disk_usage_user_ids)
args = {'user_ids': tuple(user_ids)}
self._update(sql, args, add_event=False)
- self.log.info('zero_disk_usage user_ids: %s', ' '.join([str(i) for i in user_ids]))
+ self.log.info('zero_disk_usage user_ids: %s', ' '.join(str(i) for i in user_ids))
class PurgeDeletedHDAs(PurgesHDAs, RemovesMetadataFiles, RequiresDiskUsageRecalculation, Action):
diff --git a/scripts/docker_swarm_manager.py b/scripts/docker_swarm_manager.py
index 56520f91e0b..1cf7155950a 100644
--- a/scripts/docker_swarm_manager.py
+++ b/scripts/docker_swarm_manager.py
@@ -155,7 +155,7 @@ class SwarmManager(object):
cleaned_services = self._docker_interface.services_clean()
if cleaned_services:
self._state.clean_services(cleaned_services)
- log.info("cleaned services: %s", ', '.join([x.id for x in cleaned_services]))
+ log.info("cleaned services: %s", ', '.join(x.id for x in cleaned_services))
@staticmethod
def _env_str(envs, service):
@@ -273,7 +273,7 @@ class SwarmManager(object):
destroyed_slots += node_slots
if destroy_nodes:
command = self._conf.destroy_command.format(
- nodes=' '.join([x.name for x in destroy_nodes]))
+ nodes=' '.join(x.name for x in destroy_nodes))
destroyed_nodes = self._run_command(command)
if not destroyed_nodes:
log.warning('destroy_command returned no destroyed nodes')
diff --git a/scripts/tool_shed/api/common.py b/scripts/tool_shed/api/common.py
index 282d2f6e6bc..557dd4e8739 100644
--- a/scripts/tool_shed/api/common.py
+++ b/scripts/tool_shed/api/common.py
@@ -218,7 +218,7 @@ def make_url(url, api_key=None, args=None):
if api_key:
if '?key=' not in url and '&key=' not in url:
args.insert(0, ('key', api_key))
- return url + argsep + '&'.join(['='.join(t) for t in args])
+ return url + argsep + '&'.join('='.join(t) for t in args)
def post(url, data, api_key=None):
diff --git a/test/integration/test_handler_assignment_methods.py b/test/integration/test_handler_assignment_methods.py
index 08da1e03ef8..45f409119b7 100644
--- a/test/integration/test_handler_assignment_methods.py
+++ b/test/integration/test_handler_assignment_methods.py
@@ -15,11 +15,11 @@ class WritesConfig(object):
template = {
'assign_with': ' assign_with="%s"' % assign_with if assign_with is not None else '',
'default': ' default="%s"' % default if default is not None else '',
- 'handlers': '\n'.join([
+ 'handlers': '\n'.join(
''.format(
id=x['id'],
tags=' tags="%s"' % x['tags'] if 'tags' in x else ''
- ) for x in handlers]),
+ ) for x in handlers),
}
self.__write_config_from(HANDLER_TEMPLATE_JOB_CONFIG_FILE, template=template)
diff --git a/test/unit/datatypes/dataproviders/test_base_dataproviders.py b/test/unit/datatypes/dataproviders/test_base_dataproviders.py
index 58771d375f0..9cf8274910e 100644
--- a/test/unit/datatypes/dataproviders/test_base_dataproviders.py
+++ b/test/unit/datatypes/dataproviders/test_base_dataproviders.py
@@ -259,7 +259,7 @@ class Test_LimitedOffsetDataProvider(Test_FilteredDataProvider):
(3, 2, result_data[2:3], 1, 1, 1),
]
for test in test_data:
- log.debug('limit_offset_combo: %s', ', '.join([str(e) for e in test]))
+ log.debug('limit_offset_combo: %s', ', '.join(str(e) for e in test))
limit_offset_combo(*test)
def test_limit_with_offset_and_filter(self):
@@ -283,7 +283,7 @@ class Test_LimitedOffsetDataProvider(Test_FilteredDataProvider):
(1, 2, result_data[2:3], 0, 0, 0),
]
for test in test_data:
- log.debug('limit_offset_combo: %s', ', '.join([str(e) for e in test]))
+ log.debug('limit_offset_combo: %s', ', '.join(str(e) for e in test))
limit_offset_combo(*test)
diff --git a/test/unit/datatypes/dataproviders/test_line_dataproviders.py b/test/unit/datatypes/dataproviders/test_line_dataproviders.py
index 15962b7888d..c785f120c1b 100644
--- a/test/unit/datatypes/dataproviders/test_line_dataproviders.py
+++ b/test/unit/datatypes/dataproviders/test_line_dataproviders.py
@@ -63,7 +63,7 @@ class Test_FilteredLineDataProvider(test_base_dataproviders.Test_FilteredDataPro
(3, 2, result_data[2:3], 1, 1, 1),
]
for test in test_data:
- log.debug('limit_offset_combo: %s', ', '.join([str(e) for e in test]))
+ log.debug('limit_offset_combo: %s', ', '.join(str(e) for e in test))
limit_offset_combo(*test)
def test_provide_blank(self):
diff --git a/test/unit/jobs/test_job_configuration.py b/test/unit/jobs/test_job_configuration.py
index 0a0959790de..12a5da05a22 100644
--- a/test/unit/jobs/test_job_configuration.py
+++ b/test/unit/jobs/test_job_configuration.py
@@ -84,11 +84,11 @@ class BaseJobConfXmlParserTestCase(unittest.TestCase):
template = {
'assign_with': ' assign_with="%s"' % assign_with if assign_with is not None else '',
'default': ' default="%s"' % default if default is not None else '',
- 'handlers': '\n'.join([
+ 'handlers': '\n'.join(
''.format(
id=x['id'],
tags=' tags="%s"' % x['tags'] if 'tags' in x else ''
- ) for x in handlers]),
+ ) for x in handlers),
}
self._job_configuration_base_pools = base_pools
self._write_config_from(HANDLER_TEMPLATE_JOB_CONF, template=template)
diff --git a/test/unit/managers/test_HDAManager.py b/test/unit/managers/test_HDAManager.py
index 7d4e80c0d8c..fd8e4d9d21f 100644
--- a/test/unit/managers/test_HDAManager.py
+++ b/test/unit/managers/test_HDAManager.py
@@ -638,7 +638,7 @@ class HDAFilterParserTestCase(HDATestCase):
self.log('the following filters should be parsable')
# base
self.assertORMFilter(self.filter_parser.parse_filter('id', 'in', [1, 2]))
- encoded_id_string = ','.join([self.app.security.encode_id(id_) for id_ in [1, 2]])
+ encoded_id_string = ','.join(self.app.security.encode_id(id_) for id_ in [1, 2])
self.assertORMFilter(self.filter_parser.parse_filter('encoded_id', 'in', encoded_id_string))
self.assertORMFilter(self.filter_parser.parse_filter('create_time', 'le', '2015-03-15'))
self.assertORMFilter(self.filter_parser.parse_filter('create_time', 'ge', '2015-03-15'))
diff --git a/test/unit/test_galaxy_mapping.py b/test/unit/test_galaxy_mapping.py
index 4d17c79b1bb..dc94a06d112 100644
--- a/test/unit/test_galaxy_mapping.py
+++ b/test/unit/test_galaxy_mapping.py
@@ -329,7 +329,7 @@ class MappingTests(unittest.TestCase):
task.add_metric("gx", "galaxy_slots", 5)
task.add_metric("system", "system_name", "localhost")
- big_value = ":".join(["%d" % i for i in range(2000)])
+ big_value = ":".join("%d" % i for i in range(2000))
task.add_metric("env", "BIG_PATH", big_value)
self.persist(task)
# Ensure big values truncated
diff --git a/test/unit/tools/test_fill_template.py b/test/unit/tools/test_fill_template.py
index 48d280e27dc..f0d13e38b1e 100644
--- a/test/unit/tools/test_fill_template.py
+++ b/test/unit/tools/test_fill_template.py
@@ -13,8 +13,8 @@ FILLED_SIMPLE_TEMPLATE = """ echo 1
echo 2
"""
LIST_COMPREHENSION_TEMPLATE = """#for $i in [1]:
-#set $v = "".join([str(_) for _ in [1] if _ == $i])
-echo $v
+#set $v = [str(_) for _ in [1] if _ == $i]
+echo $v[0]
#end for
"""
DICT_COMPREHENSION_TEMPLATE = """#for $i in [1]:
@@ -28,7 +28,7 @@ echo $v.pop()
#end for
"""
GEN_EXPR_TEMPLATE = """#for $i in [1]:
-#set $v = list((_ for _ in [1] if _ == $i))
+#set $v = list(_ for _ in [1] if _ == $i)
echo $v[0]
#end for
"""
diff --git a/test/unit/unittest_utils/utility.py b/test/unit/unittest_utils/utility.py
index 5f5085315f4..411ff7367f9 100644
--- a/test/unit/unittest_utils/utility.py
+++ b/test/unit/unittest_utils/utility.py
@@ -15,7 +15,7 @@ def clean_multiline_string(multiline_string, sep='\n'):
if not string_list[-1]:
string_list = string_list[:-1]
# return '\n'.join( docstrings )
- return ''.join([(s + '\n') for s in string_list])
+ return ''.join((s + '\n') for s in string_list)
__all__ = (
diff --git a/test/unit/visualizations/plugins/test_VisualizationsRegistry.py b/test/unit/visualizations/plugins/test_VisualizationsRegistry.py
index 1ce113d7c8f..e212d3dd2b0 100644
--- a/test/unit/visualizations/plugins/test_VisualizationsRegistry.py
+++ b/test/unit/visualizations/plugins/test_VisualizationsRegistry.py
@@ -52,7 +52,7 @@ class VisualizationsRegistry_TestCase(unittest.TestCase):
scatterplot = plugin_mgr.plugins['scatterplot']
self.assertEqual(scatterplot.name, 'scatterplot')
self.assertEqual(scatterplot.path, os.path.join(expected_plugins_path, 'scatterplot'))
- self.assertEqual(scatterplot.base_url, '/'.join([plugin_mgr.base_url, scatterplot.name]))
+ self.assertEqual(scatterplot.base_url, '/'.join((plugin_mgr.base_url, scatterplot.name)))
self.assertTrue(scatterplot.serves_templates)
self.assertEqual(scatterplot.template_path, os.path.join(scatterplot.path, 'templates'))
self.assertEqual(scatterplot.template_lookup.__class__.__name__, 'TemplateLookup')
@@ -60,7 +60,7 @@ class VisualizationsRegistry_TestCase(unittest.TestCase):
trackster = plugin_mgr.plugins['trackster']
self.assertEqual(trackster.name, 'trackster')
self.assertEqual(trackster.path, os.path.join(expected_plugins_path, 'trackster'))
- self.assertEqual(trackster.base_url, '/'.join([plugin_mgr.base_url, trackster.name]))
+ self.assertEqual(trackster.base_url, '/'.join((plugin_mgr.base_url, trackster.name)))
self.assertFalse(trackster.serves_templates)
def test_plugin_load(self):
@@ -115,7 +115,7 @@ class VisualizationsRegistry_TestCase(unittest.TestCase):
vis1 = plugin_mgr.plugins['vis1']
self.assertEqual(vis1.name, 'vis1')
self.assertEqual(vis1.path, os.path.join(expected_plugins_path, 'vis1'))
- self.assertEqual(vis1.base_url, '/'.join([plugin_mgr.base_url, vis1.name]))
+ self.assertEqual(vis1.base_url, '/'.join((plugin_mgr.base_url, vis1.name)))
self.assertTrue(vis1.serves_templates)
self.assertEqual(vis1.template_path, os.path.join(vis1.path, 'templates'))
self.assertEqual(vis1.template_lookup.__class__.__name__, 'TemplateLookup')
@@ -123,7 +123,7 @@ class VisualizationsRegistry_TestCase(unittest.TestCase):
vis2 = plugin_mgr.plugins['vis2']
self.assertEqual(vis2.name, 'vis2')
self.assertEqual(vis2.path, os.path.join(expected_plugins_path, 'vis2'))
- self.assertEqual(vis2.base_url, '/'.join([plugin_mgr.base_url, vis2.name]))
+ self.assertEqual(vis2.base_url, '/'.join((plugin_mgr.base_url, vis2.name)))
self.assertFalse(vis2.serves_templates)
mock_app_dir.remove()
diff --git a/tools/evolution/add_scores.py b/tools/evolution/add_scores.py
index 7232e7ef5f0..a498ce489b6 100755
--- a/tools/evolution/add_scores.py
+++ b/tools/evolution/add_scores.py
@@ -100,7 +100,7 @@ def main():
score_val = 'NA'
else:
die('%s line %d: chrom=%s, start=%d, score_list_len = %d' % (input_filename, line_number, chrom, start, score_list_len))
- print('\t'.join([line, score_val]), file=ofh)
+ print('\t'.join((line, score_val)), file=ofh)
else:
print(line, file=ofh)
diff --git a/tools/filters/random_lines_two_pass.py b/tools/filters/random_lines_two_pass.py
index 3dc8467cb8b..264fe9e74c5 100644
--- a/tools/filters/random_lines_two_pass.py
+++ b/tools/filters/random_lines_two_pass.py
@@ -93,7 +93,7 @@ def __main__():
assert num_lines > 0, "You must select at least one line."
if options.seed is not None:
- seed_int = int("".join([str(ord(_)) for _ in options.seed]))
+ seed_int = int("".join(str(ord(_)) for _ in options.seed))
try:
# Select version 1, which results in the same seed for python 2 and 3
random.seed(seed_int, version=1)
diff --git a/tools/filters/sff_extract.py b/tools/filters/sff_extract.py
index 095beb9898d..151e05df7c0 100644
--- a/tools/filters/sff_extract.py
+++ b/tools/filters/sff_extract.py
@@ -393,13 +393,13 @@ def create_xml_for_unpaired_read(data, fname):
def format_as_fasta(name, seq, qual):
name_line = ''.join(('>', name, '\n'))
seqstring = ''.join((name_line, seq, '\n'))
- qual_line = ' '.join([str(q) for q in qual])
+ qual_line = ' '.join(str(q) for q in qual)
qualstring = ''.join((name_line, qual_line, '\n'))
return seqstring, qualstring
def format_as_fastq(name, seq, qual):
- qual_line = ''.join([chr(q + 33) for q in qual])
+ qual_line = ''.join(chr(q + 33) for q in qual)
seqstring = ''.join(('@', name, '\n', seq, '\n+\n', qual_line, '\n'))
return seqstring
@@ -498,7 +498,7 @@ def reverse_complement(seq):
'N': 'N',
'*': '*'}
- complseq = ''.join([compdict[base] for base in seq])
+ complseq = ''.join(compdict[base] for base in seq)
# python hack to reverse a list/string/etc
complseq = complseq[::-1]
return complseq
diff --git a/tools/maf/maf_to_interval.py b/tools/maf/maf_to_interval.py
index e9e6508b954..00ec5b1b787 100644
--- a/tools/maf/maf_to_interval.py
+++ b/tools/maf/maf_to_interval.py
@@ -55,7 +55,7 @@ def __main__():
sequences[spec] = c.text.replace('-', '')
else:
sequences[spec] = c.text
- sequences = '\t'.join([sequences.get(_, '') for _ in all_species])
+ sequences = '\t'.join(sequences.get(_, '') for _ in all_species)
for spec in species:
c = block.get_component_by_src_start(spec)
if c is not None:
diff --git a/tools/meme/fimo_wrapper.py b/tools/meme/fimo_wrapper.py
index 2e8b51c6d83..8a2d522273a 100644
--- a/tools/meme/fimo_wrapper.py
+++ b/tools/meme/fimo_wrapper.py
@@ -70,7 +70,7 @@ def main():
else:
strand = "+"
start -= 1 # make 0-based start position
- out_file.write("%s\n" % "\t".join([fields[1], str(start), str(end), fields[0], fields[4], strand, sequence, fields[5], fields[6]]))
+ out_file.write("%s\n" % "\t".join((fields[1], str(start), str(end), fields[0], fields[4], strand, sequence, fields[5], fields[6])))
out_file.close()
diff --git a/tools/metag_tools/shrimp_color_wrapper.py b/tools/metag_tools/shrimp_color_wrapper.py
index 257d099c000..fc0b27d1e4d 100644
--- a/tools/metag_tools/shrimp_color_wrapper.py
+++ b/tools/metag_tools/shrimp_color_wrapper.py
@@ -76,7 +76,7 @@ def __main__():
shrimp_log = tempfile.NamedTemporaryFile().name
# SHRiMP command
- command = ' '.join([shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-x', sw_crossover_penalty, '-h', sw_full_hit_threshold, '-v', sw_vector_hit_threshold, input_query_file, input_target_file, '>', shrimp_outfile, '2>', shrimp_log])
+ command = ' '.join((shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-x', sw_crossover_penalty, '-h', sw_full_hit_threshold, '-v', sw_vector_hit_threshold, input_query_file, input_target_file, '>', shrimp_outfile, '2>', shrimp_log))
try:
os.system(command)
diff --git a/tools/metag_tools/shrimp_wrapper.py b/tools/metag_tools/shrimp_wrapper.py
index 15de176c86b..5ad3dc839fe 100644
--- a/tools/metag_tools/shrimp_wrapper.py
+++ b/tools/metag_tools/shrimp_wrapper.py
@@ -315,7 +315,7 @@ def generate_sub_table(result_file, ref_file, score_files, table_outfile, hit_pe
scoreBx = hits_score[readkey][str(x + 1)].split()[read_loc]
# 1-based on chrom_loc and read_loc
- pos_line = pos_line + '\t'.join([end_chrom, str(chrom_loc + 1), readkey + '/' + str(x + 1), str(read_loc + 1), chrAx, chrBx, scoreBx]) + '\n'
+ pos_line = pos_line + '\t'.join((end_chrom, str(chrom_loc + 1), readkey + '/' + str(x + 1), str(read_loc + 1), chrAx, chrBx, scoreBx)) + '\n'
else:
chrom_loc = end_chr_end - match_len + mappingIndex
@@ -330,7 +330,7 @@ def generate_sub_table(result_file, ref_file, score_files, table_outfile, hit_pe
scoreBx = hits_score[readkey][str(x + 1)].split()[read_loc]
# 1-based on chrom_loc and read_loc
- rev_line = '\t'.join([end_chrom, str(chrom_loc + 1), readkey + '/' + str(x + 1), str(read_loc + 1), chrAx, chrBx, scoreBx]) + '\n' + rev_line
+ rev_line = '\t'.join((end_chrom, str(chrom_loc + 1), readkey + '/' + str(x + 1), str(read_loc + 1), chrAx, chrBx, scoreBx)) + '\n' + rev_line
if end_chrom in chrom_cov:
if chrom_loc in chrom_cov[end_chrom]:
@@ -559,7 +559,7 @@ def __main__():
# SHRiMP command
if type_of_reads == 'single':
- command = ' '.join([shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-h', sw_hit_threshold, query_fasta, input_target_file, '>', shrimp_outfile, '2>', shrimp_log])
+ command = ' '.join((shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-h', sw_hit_threshold, query_fasta, input_target_file, '>', shrimp_outfile, '2>', shrimp_log))
try:
os.system(command)
@@ -571,8 +571,8 @@ def __main__():
stop_err(str(e))
else: # paired
- command_end1 = ' '.join([shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-h', sw_hit_threshold, query_fasta_end1, input_target_file, '>', shrimp_outfile, '2>', shrimp_log])
- command_end2 = ' '.join([shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-h', sw_hit_threshold, query_fasta_end2, input_target_file, '>>', shrimp_outfile, '2>>', shrimp_log])
+ command_end1 = ' '.join((shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-h', sw_hit_threshold, query_fasta_end1, input_target_file, '>', shrimp_outfile, '2>', shrimp_log))
+ command_end2 = ' '.join((shrimp, '-s', spaced_seed, '-n', seed_matches_per_window, '-t', seed_hit_taboo_length, '-9', seed_generation_taboo_length, '-w', seed_window_length, '-o', max_hits_per_read, '-r', max_read_length, '-d', kmer, '-m', sw_match_value, '-i', sw_mismatch_value, '-g', sw_gap_open_ref, '-q', sw_gap_open_query, '-e', sw_gap_ext_ref, '-f', sw_gap_ext_query, '-h', sw_hit_threshold, query_fasta_end2, input_target_file, '>>', shrimp_outfile, '2>>', shrimp_log))
try:
os.system(command_end1)
diff --git a/tools/ngs_simulation/ngs_simulation.py b/tools/ngs_simulation/ngs_simulation.py
index be2021709d9..5a49caa1b02 100644
--- a/tools/ngs_simulation/ngs_simulation.py
+++ b/tools/ngs_simulation/ngs_simulation.py
@@ -190,7 +190,7 @@ def __main__():
err=c(%s)
grade = (0:32)/32
hues = rev(gray(grade))
- ''' % (','.join([str(p) for p in polymorphisms]), ','.join([str(d) for d in detection_threshes])))
+ ''' % (','.join(str(p) for p in polymorphisms), ','.join(str(d) for d in detection_threshes)))
# Suppress warnings
r('options(warn=-1)')
diff --git a/tools/stats/gsummary.py b/tools/stats/gsummary.py
index 13865a7b411..d7f887c7a65 100755
--- a/tools/stats/gsummary.py
+++ b/tools/stats/gsummary.py
@@ -110,10 +110,10 @@ def main():
outfile.write("#%s\n" % headings_str)
if type(summary) is dict:
# using rpy
- outfile.write("%s\n" % "\t".join(["%g" % summary[k] for k in headings]))
+ outfile.write("%s\n" % "\t".join("%g" % summary[k] for k in headings))
else:
# using rpy2
- outfile.write("%s\n" % "\t".join(["%g" % k for k in summary]))
+ outfile.write("%s\n" % "\t".join("%g" % k for k in summary))
outfile.close()
if skipped_lines: