<s> """<STR_LIT>""" <EOL> from google_voice . main import GoogleVoice <EOL> from africa_talking . main import AfricaTalking <EOL> import config <EOL> '''<STR_LIT>''' <EOL> class VoiceXTransport : <EOL> def __init__ ( self , auth ) : <EOL> if ( auth [ '<STR_LIT:type>' ] == config . GV ) : <EOL> self . client = GoogleVoice ( auth [ '<STR_LIT:username>' ] , auth [ '<STR_LIT:password>' ] , d = False ) <EOL> elif ( auth [ '<STR_LIT:type>' ] == config . AT ) : <EOL> self . client = AfricaTalking ( auth [ '<STR_LIT:username>' ] , auth [ '<STR_LIT>' ] ) <EOL> else : <EOL> raise NotImplementedError ( transport + "<STR_LIT>" ) <EOL> def set_callback ( self , callback ) : <EOL> self . client . set_callback ( callback ) <EOL> def sms ( self , to , text ) : <EOL> self . client . sms ( to , text ) <EOL> def mark_read ( self , msg ) : <EOL> self . client . mark_read ( msg ) <EOL> def mark_unread ( self , msg ) : <EOL> self . client . mark_unread ( msg ) <EOL> def delete ( self , msg ) : <EOL> self . client . delete ( msg ) <EOL> def fetch_unread_sms ( ) : <EOL> self . client . fetch_unread_sms ( ) <EOL> def fetch_all_sms ( self ) : <EOL> self . client . fetch_all_sms ( ) <EOL> class Test ( ) : <EOL> def __init__ ( self ) : <EOL> self . client = VoiceXTransport ( username = config . GV_VOICEX [ '<STR_LIT:username>' ] , password = config . GV_VOICEX [ '<STR_LIT:password>' ] ) <EOL> self . client . set_callback ( callback = self . msg_new ) <EOL> def msg_new ( self , msg ) : <EOL> print "<STR_LIT>" % ( msg [ '<STR_LIT:text>' ] , msg [ '<STR_LIT>' ] ) <EOL> print self . client . mark_read ( msg ) <EOL> print self . client . sms ( msg [ '<STR_LIT>' ] , "<STR_LIT>" + msg [ '<STR_LIT:text>' ] ) <EOL> print self . client . delete ( msg ) <EOL> def main ( ) : <EOL> Test ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
