#NEWLINE# def acquire( self , request ) : #NEWLINE# #INDENT# 'Acquire lock for the request, or enqueue request upon failure.' #NEWLINE# assert isinstance ( request , WebdriverRequest ) , 'Only a WebdriverRequest can use the webdriver instance.' #NEWLINE# if self . _lock . acquire ( False ) : #NEWLINE# #INDENT# request . manager = self #NEWLINE# return request #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( request , WebdriverActionRequest ) : #NEWLINE# #INDENT# queue = self . _wait_inpage_queue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# queue = self . _wait_queue #NEWLINE# #UNINDENT# queue . append ( request )