'Prepare the file locker. Specify the file to lock and optionally
the maximum timeout and the delay between each attempt to lock.'

def __init__(self, file_name, timeout=10, delay=0.05):

    self.is_locked = False
    self.lockfile = os.path.join(os.getcwd(), ('%s.lock' % file_name))
    self.file_name = file_name
    self.timeout = timeout
    self.delay = delay
