parameters: (self, fileob)
docstring: Read the metadata values from a file object.
docstring_summary: Read the metadata values from a file object.
docstring_tokens: Read the metadata values from a file object .
function: def read_file(self, fileob):
          """Read the metadata values from a file object."""
          msg = message_from_file(fileob)
          self._fields['Metadata-Version'] = msg['metadata-version']
  
          # When reading, get all the fields we can
          for field in _ALL_FIELDS:
              if field not in msg:
                  continue
              if field in _LISTFIELDS:
                  # we can have multiple lines
                  values = msg.get_all(field)
                  if field in _LISTTUPLEFIELDS and values is not None:
                      values = [tuple(value.split(',')) for value in values]
                  self.set(field, values)
              else:
                  # single line
                  value = msg[field]
                  if value is not None and value != 'UNKNOWN':
                      self.set(field, value)
          self.set_metadata_version()
function_tokens: def read_file ( self , fileob ) : msg = message_from_file ( fileob ) self . _fields [ 'Metadata-Version' ] = msg [ 'metadata-version' ] # When reading, get all the fields we can for field in _ALL_FIELDS : if field not in msg : continue if field in _LISTFIELDS : # we can have multiple lines values = msg . get_all ( field ) if field in _LISTTUPLEFIELDS and values is not None : values = [ tuple ( value . split ( ',' ) ) for value in values ] self . set ( field , values ) else : # single line value = msg [ field ] if value is not None and value != 'UNKNOWN' : self . set ( field , value ) self . set_metadata_version ( )