File: cleanup.py

package info (click to toggle)
python-sysv-ipc 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 540 kB
  • sloc: ansic: 3,140; python: 1,960; makefile: 8; sh: 4
file content (16 lines) | stat: -rw-r--r-- 334 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sysv_ipc
import utils

params = utils.read_params()

key = params["KEY"]

try:
    mq = sysv_ipc.MessageQueue(key)
except sysv_ipc.ExistentialError:
    print('''Message queue with key "{}" doesn't exist.'''.format(key))
else:
    mq.remove()
    print('Message queue with key "{}" removed'.format(key))

print("\nAll clean!")