Go to the documentation of this file.
2 Defines the Processor class, which defines how to create targets from their
11 __author__ =
'melliott'
15 Processor contains the data and methods needed to create a single target.
17 __name__ =
"Processor"
19 def __init__(self, sensor, ruleset, program, par_data, out_dir):
30 if 'odir' in par_data:
34 if 'ofile' in par_data:
47 Custom comparator to determine which Processor should come before another.
48 This is based on the order in which they should be processed.
52 print(
'Error! Could not locate {0} target type in {1} rule set.'.format(self.
target_type,
str(self)))
55 other_ndx = other.rule_set.order.index(other.target_type)
57 print(
'Error! Could not locate {0} target type in {1} rule set.'.format(other.target_type,
str(other)))
59 if self_ndx < other_ndx:
61 elif self_ndx > other_ndx:
84 def _find_required_types(self):
88 def _get_applicable_rules(self, ruleset):
93 for targ
in ruleset.order:
97 applicable_rules.append(ruleset.rules[targ])
100 return applicable_rules
104 Return True if the inputs needed for the target output exist,
105 otherwise return False.
110 return os.path.exists(input_file)
113 return "Processor for target_type = {0}".format(self.
target_type)
120 Call the function to run the command for this Processor.
def __init__(self, sensor, ruleset, program, par_data, out_dir)
void print(std::ostream &stream, const char *format)
def requires_batch_processing(self)
def _find_required_types(self)
def _get_applicable_rules(self, ruleset)