<s> from MobileDevice import * <EOL> from plistservice import * <EOL> class WIRService ( PlistService ) : <EOL> def __init__ ( self , amdevice , servicenames , format = kCFPropertyListBinaryFormat_v1_0 ) : <EOL> PlistService . __init__ ( self , amdevice , servicenames , format ) <EOL> def _sendmsg ( self , selector , args ) : <EOL> wi = dict_to_plist_encoding ( { <EOL> u'<STR_LIT>' : selector , <EOL> u'<STR_LIT>' : args <EOL> } ) <EOL> step = <NUM_LIT> <EOL> start = <NUM_LIT:0> <EOL> end = step <EOL> while end < len ( wi ) : <EOL> PlistService . _sendmsg ( self , { <EOL> u'<STR_LIT>' : wi [ start : end ] <EOL> } ) <EOL> start = end <EOL> end += step <EOL> PlistService . _sendmsg ( self , { <EOL> u'<STR_LIT>' : wi [ start : end ] <EOL> } ) <EOL> def _recvmsg ( self ) : <EOL> wi = '<STR_LIT>' <EOL> wimsg = PlistService . _recvmsg ( self ) <EOL> while wimsg and u'<STR_LIT>' in wimsg : <EOL> wi += wimsg [ u'<STR_LIT>' ] <EOL> wimsg = PlistService . _recvmsg ( self ) <EOL> wi += wimsg [ u'<STR_LIT>' ] <EOL> rpc = dict_from_plist_encoding ( wi ) <EOL> return ( rpc [ u'<STR_LIT>' ] , rpc [ u'<STR_LIT>' ] ) </s>
