#NEWLINE# def lock( self , name ) : #NEWLINE# #INDENT# if ( name not in self . locks ) : #NEWLINE# #INDENT# self . locks [ name ] = Lock ( ) #NEWLINE# #UNINDENT# if ( not self . locks [ name ] . acquire ( False ) ) : #NEWLINE# #INDENT# raise LockError ( ( 'Could not lock %r' % self ) ) #NEWLINE# #UNINDENT# return True