def file2jobs(self, targetfile):
    rules = self.output_index.match(targetfile)
    jobs = []
    exceptions = list()
    for rule in rules:
        if rule.is_producer(targetfile):
            try:
                jobs.append(self.new_job(rule, targetfile=targetfile))
            except InputFunctionException as e:
                exceptions.append(e)
    if (not jobs):
        if exceptions:
            raise exceptions[0]
        raise MissingRuleException(targetfile)
    return jobs
def file2jobs(self, targetfile):
    rules = self.output_index.match(targetfile)
    jobs = []
    exceptions = list()
    for rule in rules:
        if rule.is_producer(targetfile):
            try:
                jobs.append(self.new_job(rule, targetfile=targetfile))
            except InputFunctionException as e:
                exceptions.append(e)
    if (not jobs):
        if exceptions:
            raise exceptions[0]
        raise MissingRuleException(targetfile)
    return jobs