def execute(self): with io.open(self.in_file_path, "rb") as i_file: # open as append, since query results are appended with io.open(self.out_file_path, "ab") as o_file: # reference path for post-query column building o_file.write("%s\n" % os.path.abspath(self.in_file_path)) # counter for line number line_id = 0 # iterate the column for line in i_file: if self.query_expression.evaluate(resolve_type(line, VALID_TYPES)): o_file.write("%s\n" % str(line_id)) line_id += 1
def _parse_r_value(self): self.r_value = resolve_type(self._r_value, VALID_TYPES)