#NEWLINE# def __init__( self , url , user = None , password = None ) : #NEWLINE# #INDENT# self . url = url #NEWLINE# auth_encoded = base64 . encodestring ( ( '%s:%s' % ( url , password ) ) ) [ : ( - 1 ) ] #NEWLINE# self . req = urllib2 . Request ( self . url ) #NEWLINE# self . req . add_header ( 'Authorization' , ( 'Basic %s' % auth_encoded ) )