def create_pidlock(pidfile):
 pidlock = PIDFile(pidfile)
 if (pidlock.is_locked() and (not pidlock.remove_if_stale())):
  raise SystemExit(("ERROR: Pidfile (%s) already exists.\nSeems we're already running? (PID: %s)" % (pidfile, pidlock.read_pid())))
 return pidlock

def create_pidlock ( pidfile ) : pidlock = PIDFile ( pidfile ) if ( pidlock . is_locked ( ) and ( not pidlock . remove_if_stale ( ) ) ) : raise SystemExit ( ( "ERROR: Pidfile (%s) already exists.\nSeems we're already running? (PID: %s)" % ( pidfile , pidlock . read_pid ( ) ) ) ) return pidlock
create and verify pid file .