parameters: (self, key)
return_statement: return msg
docstring: Return a Message representation or raise a KeyError.
docstring_summary: Return a Message representation or raise a KeyError.
docstring_tokens: Return a Message representation or raise a KeyError .
function: def get_message(self, key):
          """Return a Message representation or raise a KeyError."""
          start, stop = self._lookup(key)
          self._file.seek(start)
          self._file.readline()   # Skip '1,' line specifying labels.
          original_headers = StringIO.StringIO()
          while True:
              line = self._file.readline()
              if line == '*** EOOH ***' + os.linesep or line == '':
                  break
              original_headers.write(line.replace(os.linesep, '\n'))
          visible_headers = StringIO.StringIO()
          while True:
              line = self._file.readline()
              if line == os.linesep or line == '':
                  break
              visible_headers.write(line.replace(os.linesep, '\n'))
          body = self._file.read(stop - self._file.tell()).replace(os.linesep,
                                                                   '\n')
          msg = BabylMessage(original_headers.getvalue() + body)
          msg.set_visible(visible_headers.getvalue())
          if key in self._labels:
              msg.set_labels(self._labels[key])
          return msg
function_tokens: def get_message ( self , key ) : start , stop = self . _lookup ( key ) self . _file . seek ( start ) self . _file . readline ( ) # Skip '1,' line specifying labels. original_headers = StringIO . StringIO ( ) while True : line = self . _file . readline ( ) if line == '*** EOOH ***' + os . linesep or line == '' : break original_headers . write ( line . replace ( os . linesep , '\n' ) ) visible_headers = StringIO . StringIO ( ) while True : line = self . _file . readline ( ) if line == os . linesep or line == '' : break visible_headers . write ( line . replace ( os . linesep , '\n' ) ) body = self . _file . read ( stop - self . _file . tell ( ) ) . replace ( os . linesep , '\n' ) msg = BabylMessage ( original_headers . getvalue ( ) + body ) msg . set_visible ( visible_headers . getvalue ( ) ) if key in self . _labels : msg . set_labels ( self . _labels [ key ] ) return msg