<s> try : <EOL> from ConfigParser import SafeConfigParser <EOL> except ImportError : <EOL> from configparser import ConfigParser as SafeConfigParser <EOL> def get_metadata_and_options ( ) : <EOL> config = SafeConfigParser ( ) <EOL> config . read ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> metadata = dict ( config . items ( '<STR_LIT>' ) ) <EOL> options = dict ( config . items ( '<STR_LIT>' ) ) <EOL> metadata [ '<STR_LIT>' ] = list ( filter ( None , metadata [ '<STR_LIT>' ] . split ( '<STR_LIT:\n>' ) ) ) <EOL> metadata [ '<STR_LIT>' ] = list ( filter ( None , metadata [ '<STR_LIT>' ] . split ( '<STR_LIT:\n>' ) ) ) <EOL> return metadata , options <EOL> def enabled ( options , option ) : <EOL> value = options [ option ] <EOL> s = value . lower ( ) <EOL> if s in ( '<STR_LIT:yes>' , '<STR_LIT:true>' , '<STR_LIT:1>' , '<STR_LIT:y>' ) : <EOL> return True <EOL> elif s in ( '<STR_LIT>' , '<STR_LIT:false>' , '<STR_LIT:0>' , '<STR_LIT:n>' ) : <EOL> return False <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" % ( value , option ) ) <EOL> def create_release_file ( metadata ) : <EOL> rel = open ( "<STR_LIT>" , '<STR_LIT:w>' ) <EOL> rel . write ( """<STR_LIT>""" % metadata ) <EOL> rel . close ( ) </s>
