mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Simplify code
This commit is contained in:
@@ -82,15 +82,13 @@ class CliInterface:
|
||||
return self.active_cli_shells[requested_shell_settings]
|
||||
|
||||
def get_job_interface(self, job_params):
|
||||
job_plugin = job_params.get('plugin', None)
|
||||
job_plugin = job_params.get('plugin')
|
||||
if not job_plugin:
|
||||
raise ValueError(ERROR_MESSAGE_NO_JOB_PLUGIN)
|
||||
job_plugin_class = self.cli_job_interfaces.get(job_plugin, None)
|
||||
job_plugin_class = self.cli_job_interfaces.get(job_plugin)
|
||||
if not job_plugin_class:
|
||||
raise ValueError(ERROR_MESSAGE_NO_SUCH_JOB_PLUGIN % (job_plugin, list(self.cli_job_interfaces.keys())))
|
||||
job_interface = job_plugin_class(**job_params)
|
||||
|
||||
return job_interface
|
||||
return job_plugin_class(**job_params)
|
||||
|
||||
|
||||
def split_params(params):
|
||||
|
||||
@@ -22,11 +22,11 @@ except ImportError:
|
||||
|
||||
class BaseJobExec(metaclass=ABCMeta):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, **params):
|
||||
"""
|
||||
Constructor for CLI job executor.
|
||||
"""
|
||||
self.params = params.copy()
|
||||
|
||||
def job_script_kwargs(self, ofile, efile, job_name):
|
||||
""" Return extra keyword argument for consumption by job script
|
||||
|
||||
@@ -19,11 +19,6 @@ argmap = {
|
||||
|
||||
class LSF(BaseJobExec):
|
||||
|
||||
def __init__(self, **params):
|
||||
self.params = {}
|
||||
for k, v in params.items():
|
||||
self.params[k] = v
|
||||
|
||||
def job_script_kwargs(self, ofile, efile, job_name):
|
||||
scriptargs = {'-o': ofile,
|
||||
'-e': efile,
|
||||
|
||||
@@ -15,11 +15,6 @@ argmap = {
|
||||
|
||||
class Slurm(BaseJobExec):
|
||||
|
||||
def __init__(self, **params):
|
||||
self.params = {}
|
||||
for k, v in params.items():
|
||||
self.params[k] = v
|
||||
|
||||
def job_script_kwargs(self, ofile, efile, job_name):
|
||||
scriptargs = {'-o': ofile,
|
||||
'-e': efile,
|
||||
|
||||
@@ -31,11 +31,6 @@ argmap = {'destination': '-q',
|
||||
|
||||
class Torque(BaseJobExec):
|
||||
|
||||
def __init__(self, **params):
|
||||
self.params = {}
|
||||
for k, v in params.items():
|
||||
self.params[k] = v
|
||||
|
||||
def job_script_kwargs(self, ofile, efile, job_name):
|
||||
pbsargs = {'-o': ofile,
|
||||
'-e': efile,
|
||||
|
||||
Reference in New Issue
Block a user