示例#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