#NEWLINE# def _ParseManifestSection( section , jar_file_name ) : #NEWLINE# #INDENT# "Parse a dict out of the given manifest section string.\n\n  Args:\n    section: a str or unicode that is the manifest section. It looks something\n      like this (without the >):\n      > Name: section-name\n      > Some-Attribute: some value\n      > Another-Attribute: another value\n    jar_file_name: a str that is the path of the jar, for use in exception\n      messages.\n\n  Returns:\n    A dict where the keys are the attributes (here, 'Name', 'Some-Attribute',\n    'Another-Attribute'), and the values are the corresponding attribute values.\n\n  Raises:\n    InvalidJarError: if the manifest section is not well-formed.\n  " #NEWLINE# section = section . replace ( '\n ' , '' ) . rstrip ( '\n' ) #NEWLINE# if ( not line ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return dict ( ( line . split ( ': ' , 1 ) for line in section . split ( '\n' ) ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise InvalidJarError ( ( '%s: Invalid manifest %r' % ( jar_file_name , section ) ) )