def _parseRecordC(self, line, event): """ Parses the 'general comment' record C """ try: comment = event.comments[0] comment.text += line[2:60] except IndexError: comment = Comment() comment.resource_id = ResourceIdentifier(prefix=res_id_prefix) event.comments.append(comment) comment.text = line[2:60] # strip non printable-characters comment.text = "".join(x for x in comment.text if x in s.printable)
def _parseRecordC(self, line, event): """ Parses the 'general comment' record C """ try: comment = event.comments[0] comment.text += line[2:60] except IndexError: comment = Comment() comment.resource_id = ResourceIdentifier(prefix=res_id_prefix) event.comments.append(comment) comment.text = line[2:60] # strip non printable-characters comment.text =\ filter(lambda x: x in s.printable, comment.text)
def _parseRecordDc(self, line, focal_mechanism): """ Parses the 'source parameter data - comment' record Dc """ try: comment = focal_mechanism.comments[0] comment.text += line[2:60] except IndexError: comment = Comment() comment.resource_id = ResourceIdentifier(prefix=res_id_prefix) focal_mechanism.comments.append(comment) comment.text = line[2:60]
def _parse_record_dc(self, line, focal_mechanism): """ Parses the 'source parameter data - comment' record Dc """ try: comment = focal_mechanism.comments[0] comment.text += line[2:60] except IndexError: comment = Comment() comment.resource_id = ResourceIdentifier(prefix=res_id_prefix) focal_mechanism.comments.append(comment) comment.text = line[2:60]
def _comment(self, text): comment = Comment() comment.text = text comment.resource_id = ResourceIdentifier(prefix=self.res_id_prefix) return comment