<s> import boto <EOL> def get_manager ( cls ) : <EOL> """<STR_LIT>""" <EOL> db_user = boto . config . get ( '<STR_LIT>' , '<STR_LIT>' , None ) <EOL> db_passwd = boto . config . get ( '<STR_LIT>' , '<STR_LIT>' , None ) <EOL> db_type = boto . config . get ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> db_name = boto . config . get ( '<STR_LIT>' , '<STR_LIT>' , None ) <EOL> db_table = boto . config . get ( '<STR_LIT>' , '<STR_LIT>' , None ) <EOL> db_host = boto . config . get ( '<STR_LIT>' , '<STR_LIT>' , "<STR_LIT>" ) <EOL> db_port = boto . config . getint ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT> ) <EOL> enable_ssl = boto . config . getbool ( '<STR_LIT>' , '<STR_LIT>' , True ) <EOL> sql_dir = boto . config . get ( '<STR_LIT>' , '<STR_LIT>' , None ) <EOL> debug = boto . config . getint ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:0> ) <EOL> module_name = cls . __module__ . replace ( '<STR_LIT:.>' , '<STR_LIT:_>' ) <EOL> db_section = '<STR_LIT>' + module_name + '<STR_LIT:_>' + cls . __name__ <EOL> if not boto . config . has_section ( db_section ) : <EOL> db_section = '<STR_LIT>' + cls . __name__ <EOL> if boto . config . has_section ( db_section ) : <EOL> db_user = boto . config . get ( db_section , '<STR_LIT>' , db_user ) <EOL> db_passwd = boto . config . get ( db_section , '<STR_LIT>' , db_passwd ) <EOL> db_type = boto . config . get ( db_section , '<STR_LIT>' , db_type ) <EOL> db_name = boto . config . get ( db_section , '<STR_LIT>' , db_name ) <EOL> db_table = boto . config . get ( db_section , '<STR_LIT>' , db_table ) <EOL> db_host = boto . config . get ( db_section , '<STR_LIT>' , db_host ) <EOL> db_port = boto . config . getint ( db_section , '<STR_LIT>' , db_port ) <EOL> enable_ssl = boto . config . getint ( db_section , '<STR_LIT>' , enable_ssl ) <EOL> debug = boto . config . getint ( db_section , '<STR_LIT>' , debug ) <EOL> elif hasattr ( cls , "<STR_LIT>" ) and cls . _db_name is not None : <EOL> db_name = cls . _db_name <EOL> elif hasattr ( cls . __bases__ [ <NUM_LIT:0> ] , "<STR_LIT>" ) : <EOL> return cls . __bases__ [ <NUM_LIT:0> ] . _manager <EOL> if db_type == '<STR_LIT>' : <EOL> from boto . sdb . db . manager . sdbmanager import SDBManager <EOL> return SDBManager ( cls , db_name , db_user , db_passwd , <EOL> db_host , db_port , db_table , sql_dir , enable_ssl ) <EOL> elif db_type == '<STR_LIT>' : <EOL> from boto . sdb . db . manager . xmlmanager import XMLManager <EOL> return XMLManager ( cls , db_name , db_user , db_passwd , <EOL> db_host , db_port , db_table , sql_dir , enable_ssl ) <EOL> else : <EOL> raise ValueError ( '<STR_LIT>' % db_type ) </s>
