<s> """<STR_LIT>""" <EOL> import ConfigParser , cStringIO , os . path <EOL> class Config : <EOL> _valid = set ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> def __init__ ( self , path ) : <EOL> self . path = path <EOL> if os . path . isfile ( path ) : <EOL> self . c = ConfigParser . SafeConfigParser ( ) <EOL> data = open ( path ) . read ( ) <EOL> io = cStringIO . StringIO ( ) <EOL> io . write ( "<STR_LIT>" ) <EOL> io . write ( data ) <EOL> io . reset ( ) <EOL> self . c . readfp ( io ) <EOL> options = set ( self . c . options ( "<STR_LIT>" ) ) <EOL> if not self . _valid . issuperset ( options ) : <EOL> bad = options - self . _valid <EOL> bad = "<STR_LIT:U+002C>" . join ( list ( bad ) ) <EOL> raise ValueError , "<STR_LIT>" % bad <EOL> items = dict ( self . c . items ( "<STR_LIT>" ) ) <EOL> self . base = items . get ( "<STR_LIT>" , "<STR_LIT:..>" ) . strip ( ) <EOL> self . coverage = items . get ( "<STR_LIT>" , "<STR_LIT:..>" ) . strip ( ) <EOL> if items . has_key ( "<STR_LIT>" ) : <EOL> self . _magic = True <EOL> else : <EOL> self . _magic = False <EOL> ex = items . get ( "<STR_LIT>" , "<STR_LIT:.>" ) <EOL> ex = ex . split ( "<STR_LIT:\n>" ) <EOL> self . exclude = [ i . strip ( ) for i in ex ] <EOL> else : <EOL> self . base = "<STR_LIT:..>" <EOL> self . coverage = "<STR_LIT:..>" <EOL> self . exclude = [ "<STR_LIT:.>" ] <EOL> self . _magic = False </s>
