creole/bin/CreoleLock

17 lines
437 B
Python
Executable File

#!/usr/bin/env python
from sys import argv
from os import getppid
from importlib import import_module
from pyeole.command_line import ArgumentParser
from pyeole.ihm import only_root
only_root()
allowed_functions = ('acquire', 'release', 'is_locked')
module = import_module('pyeole.lock')
module.PID = getppid()
arguments = ArgumentParser(module, allowed_functions, argv[0])
arguments.parse_args(argv[1:])
arguments.trigger_callback()