'Read the values from the lock file. Returns None if there is no current lock file.'

def _read_lock(self):

    if (self.lockfile and os.path.exists(self.lockfile)):
        result = {}
        with io.open(self.lockfile, encoding=u'utf-8') as f:
            lines = [l for l in f.readlines() if l]
        for line in lines:
            try:
                (key, value) = line.split(u':', 1)
            except ValueError:
                log.debug((u'Invalid    line    in    lock    file:    %s' % line))
                continue
            result[key.strip().lower()] = value.strip()
        for key in result:
            if result[key].isdigit():
                result[key] = native_int(result[key])
        result.setdefault(u'pid', None)
        if (not result[u'pid']):
            log.error(u'Invalid    lock    file.    Make    sure    FlexGet    is    not    running,    then    delete    it.')
        elif (not pid_exists(result[u'pid'])):
            return None
        return result
    return None
