def _handle_locks(self):
    curpid = os.getpid()
    adccdir = get_adcc_dir()
    lockf = os.path.join(adccdir, self.racefile)
    lfile = (True if os.path.exists(lockf) else False)
    pids = self._check_adcc(curpid)
    msgs = {'lockrun': 'adcclib: adcc running and lockfile detected.', 'portrun': 'adcclib: adcc running on port {}', 'norun': 'adcclib: No adcc running but lockfile found.', 'rupted': 'adcclib: adcc config appears corrupted. Clearing ...'}
    if (pids and lfile):
        sys.exit(msgs['lockrun'])
    elif (pids and (not lfile)):
        sys.exit(msgs['portrun'].format(self.http_port))
    elif (lfile and (not pids)):
        print(msgs['norun'])
        print(msgs['rupted'])
        os.unlink(lockf)
    return
def _handle_locks(self):
    curpid = os.getpid()
    adccdir = get_adcc_dir()
    lockf = os.path.join(adccdir, self.racefile)
    lfile = (True if os.path.exists(lockf) else False)
    pids = self._check_adcc(curpid)
    msgs = {'lockrun': 'adcclib: adcc running and lockfile detected.', 'portrun': 'adcclib: adcc running on port {}', 'norun': 'adcclib: No adcc running but lockfile found.', 'rupted': 'adcclib: adcc config appears corrupted. Clearing ...'}
    if (pids and lfile):
        sys.exit(msgs['lockrun'])
    elif (pids and (not lfile)):
        sys.exit(msgs['portrun'].format(self.http_port))
    elif (lfile and (not pids)):
        print(msgs['norun'])
        print(msgs['rupted'])
        os.unlink(lockf)
    return