コード例 #1
0
 def ensure_files(self, job, job_dir):
     """
     Download remote files and find secondary files according to annotations
     """
     inputs = job.app.inputs
     self.input_collector = InputCollector(job_dir)
     input_values = job.inputs
     self._resolve(inputs, input_values, job.inputs)
コード例 #2
0
ファイル: cli_app.py プロジェクト: haijohn/rabix
 def ensure_files(self, job, job_dir):
     '''
     Resolve paths of all input files
     '''
     inputs = job.app.inputs.io
     self.input_collector = InputCollector(job_dir)
     input_values = job.inputs
     self._resolve(inputs, input_values, job.inputs)
コード例 #3
0
class Container(object):
    def __init__(self):
        self.input_collector = None

    def install(self, job):
        pass

    def get_mapping(self, paths):
        return {}

    def ensure_files(self, job, job_dir):
        """
        Download remote files and find secondary files according to annotations
        """
        inputs = job.app.inputs
        self.input_collector = InputCollector(job_dir)
        input_values = job.inputs
        self._resolve(inputs, input_values, job.inputs)

    def _resolve(self, inputs, input_values, job):

        if inputs:
            file_ins = [
                i for i in inputs if isinstance(i.validator, NamedSchema)
                and i.validator.name == 'File'
            ]
            for f in file_ins:
                val = input_values.get(f.id)
                if val:
                    job[f.id] = map_or_apply(
                        lambda e: self.input_collector.download(
                            e.url,
                            f.input_binding.get('secondaryFiles')
                            if f.input_binding is not None else None), val)
コード例 #4
0
ファイル: cli_app.py プロジェクト: lowks/rabix
class Container(object):

    def __init__(self):
        self.input_collector = None

    def install(self, job):
        pass

    def get_mapping(self, paths):
        return {}

    def ensure_files(self, job, job_dir):
        """
        Download remote files and find secondary files according to annotations
        """
        inputs = job.app.inputs
        self.input_collector = InputCollector(job_dir)
        input_values = job.inputs
        self._resolve(inputs, input_values, job.inputs)

    def _resolve(self, inputs, input_values, job):

        if inputs:
            file_ins = [i for i in inputs
                        if isinstance(i.validator, NamedSchema) and
                        i.validator.name == 'File']
            for f in file_ins:
                val = input_values.get(f.id)
                if val:
                    job[f.id] = map_or_apply(
                        lambda e: self.input_collector.download(
                            e.url, f.input_binding.get('secondaryFiles')
                            if f.input_binding is not None else None
                        ),
                        val)
コード例 #5
0
ファイル: cli_app.py プロジェクト: haijohn/rabix
class Container(object):
    def __init__(self):
        self.input_collector = None

    def install(self, job):
        pass

    def set_config(self, *args, **kwargs):
        pass

    def ensure_files(self, job, job_dir):
        '''
        Resolve paths of all input files
        '''
        inputs = job.app.inputs.io
        self.input_collector = InputCollector(job_dir)
        input_values = job.inputs
        self._resolve(inputs, input_values, job.inputs)

    def _resolve(self, inputs, input_values, job):

        if inputs:
            file_ins = [
                i for i in inputs if isinstance(i.constructor, FileConstructor)
            ]
            for f in file_ins:
                val = input_values.get(f.id)
                if val:
                    job[f.id] = map_or_apply(
                        lambda e: self.input_collector.download(
                            e.url,
                            f.annotations.get('secondaryFiles')
                            if f.annotations is not None else None), val)
コード例 #6
0
ファイル: cli_app.py プロジェクト: lowks/rabix
 def ensure_files(self, job, job_dir):
     """
     Download remote files and find secondary files according to annotations
     """
     inputs = job.app.inputs
     self.input_collector = InputCollector(job_dir)
     input_values = job.inputs
     self._resolve(inputs, input_values, job.inputs)