(self, now)
Returns True if the lock was acquired by the calling thread,
        False if another thread acquired it first
Returns True if the lock was acquired by the calling thread,
        False if another thread acquired it first
Returns True if the lock was acquired by the calling thread False if another thread acquired it first
def acquire_lock(self, now):
        """
        Returns True if the lock was acquired by the calling thread,
        False if another thread acquired it first
        """
        if (self.lock_date is None) or (now > (self.lock_date + LOCK_EXPIRATION)):
            try:
                self.lock_date = now
                self.save()
                return True
            except ResourceConflict:
                return False
        else:
            return False
def acquire_lock ( self , now ) : if ( self . lock_date is None ) or ( now > ( self . lock_date + LOCK_EXPIRATION ) ) : try : self . lock_date = now self . save ( ) return True except ResourceConflict : return False else : return False