<s> from openob . logger import LoggerFactory <EOL> class AudioInterface ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , node_name , interface_name = '<STR_LIT:default>' ) : <EOL> self . interface_name = interface_name <EOL> self . node_name = node_name <EOL> self . logger_factory = LoggerFactory ( ) <EOL> self . logger = self . logger_factory . getLogger ( '<STR_LIT>' <EOL> % ( self . node_name , self . interface_name ) ) <EOL> self . config = dict ( ) <EOL> def set ( self , key , value ) : <EOL> """<STR_LIT>""" <EOL> self . logger . debug ( "<STR_LIT>" % ( key , value ) ) <EOL> self . config [ key ] = value <EOL> def get ( self , key ) : <EOL> """<STR_LIT>""" <EOL> value = self . config [ key ] <EOL> self . logger . debug ( "<STR_LIT>" % ( key , value ) ) <EOL> return value <EOL> def __getattr__ ( self , key ) : <EOL> """<STR_LIT>""" <EOL> return self . get ( key ) <EOL> def set_from_argparse ( self , opts ) : <EOL> """<STR_LIT>""" <EOL> self . set ( "<STR_LIT>" , opts . mode ) <EOL> if opts . mode == "<STR_LIT>" : <EOL> self . set ( "<STR_LIT:type>" , opts . audio_input ) <EOL> self . set ( "<STR_LIT>" , opts . samplerate ) <EOL> elif opts . mode == "<STR_LIT>" : <EOL> self . set ( "<STR_LIT:type>" , opts . audio_output ) <EOL> if self . get ( "<STR_LIT:type>" ) == "<STR_LIT>" : <EOL> self . set ( "<STR_LIT>" , opts . alsa_device ) <EOL> elif self . get ( "<STR_LIT:type>" ) == "<STR_LIT>" : <EOL> self . set ( "<STR_LIT>" , opts . jack_auto ) <EOL> if opts . jack_name is not None : <EOL> self . set ( "<STR_LIT>" , opts . jack_name ) <EOL> else : <EOL> self . set ( "<STR_LIT>" , "<STR_LIT>" ) </s>
