<s> '''<STR_LIT>''' <EOL> import sys <EOL> class anygui : <EOL> __all__ = [ '<STR_LIT>' ] <EOL> def __init__ ( self ) : <EOL> self . __backend = None <EOL> self . __backends = [ '<STR_LIT>' , '<STR_LIT:x>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def __try_to_get ( self , modulename ) : <EOL> import imp <EOL> try : <EOL> module = imp . find_module ( modulename ) <EOL> except ( IOError , ImportError , AttributeError , AssertionError ) : <EOL> return None <EOL> else : <EOL> return module <EOL> def __import_backend ( self , wishlist ) : <EOL> candidates = self . __backends [ : ] <EOL> for wish in wishlist : <EOL> if wish in candidates : <EOL> candidates . remove ( wish ) <EOL> else : <EOL> wishlist . remove ( wish ) <EOL> candidates = wishlist + candidates <EOL> for name in candidates : <EOL> backend = self . __try_to_get ( '<STR_LIT>' % name ) <EOL> if not backend : <EOL> raise Exception , '<STR_LIT>' <EOL> self . __backend = backend <EOL> def __getattr__ ( self , name ) : <EOL> if not self . __backend : <EOL> self . __import_backend ( self . __dict__ . get ( '<STR_LIT>' , [ ] ) ) <EOL> return self . __backend . __dict__ [ name ] <EOL> sys . modules [ __name__ ] = anygui ( ) </s>
