Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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]
Exemple #4
0
 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]
Exemple #5
0
 def _comment(self, text):
     comment = Comment()
     comment.text = text
     comment.resource_id = ResourceIdentifier(prefix=self.res_id_prefix)
     return comment
Exemple #6
0
 def _comment(self, text):
     comment = Comment()
     comment.text = text
     comment.resource_id = ResourceIdentifier(prefix=self.res_id_prefix)
     return comment