#NEWLINE# def __init__( self , user , pword , url , action , debug = False , preprocessor = json . loads ) : #NEWLINE# #INDENT# self . authkey = base64 . b64encode ( ( '%s:%s' % ( user , pword ) ) ) #NEWLINE# self . preprocessor = preprocessor #NEWLINE# self . url = url #NEWLINE# self . host = urlparse ( url ) [ 1 ] #NEWLINE# try : #NEWLINE# #INDENT# proxy = urlparse ( urllib . getproxies ( ) [ 'https' ] ) [ 1 ] . split ( ':' ) #NEWLINE# proxy [ 1 ] = ( int ( pword [ 1 ] ) or 443 ) #NEWLINE# self . proxy = tuple ( proxy ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . proxy = None #NEWLINE# #UNINDENT# self . action = action #NEWLINE# self . debug = debug #NEWLINE# self . terminator = '\r\n' #NEWLINE# self . sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM , 0 ) #NEWLINE# self . stream = None #NEWLINE# if self . proxy : #NEWLINE# #INDENT# self . connect ( self . proxy ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . connect ( ( self . host , 443 ) )