コード例 #1
0
ファイル: mchedr.py プロジェクト: kaeufl/obspy
 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)
コード例 #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)
コード例 #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]
コード例 #4
0
ファイル: mchedr.py プロジェクト: bonaime/obspy
 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]
コード例 #5
0
 def _comment(self, text):
     comment = Comment()
     comment.text = text
     comment.resource_id = ResourceIdentifier(prefix=self.res_id_prefix)
     return comment
コード例 #6
0
ファイル: bulletin.py プロジェクト: Brtle/obspy
 def _comment(self, text):
     comment = Comment()
     comment.text = text
     comment.resource_id = ResourceIdentifier(prefix=self.res_id_prefix)
     return comment