# -*- coding: utf-8 -*-
"""
Подсистема наcтройки компонент через ком.строку
"""
import optparse
import sys
PORT = {
'switches': ("-p", "--port"),
'dest': "port",
'type': "int",
'help': "port"
}
HOST = {
'switches': ("-H", "--host"),
'dest': "host",
'type': "str",
'help': "host"
}
QUIET = {
'switches': ("-q", "--quiet"),
'dest': "quiet",
'action': "store_true",
'default': False,
'help': "be quiet"
}
QUEUE_HOST = {
'switches': ("-m", "--mq-host"),
'dest': "queue_host",
'type': "str",
'default': "localhost",
'help': "message queue host"
}
QUEUE_PORT = {
'switches': ("-P", "--mq-port"),
'dest': "queue_port",
'type': "int",
'help': "message queue port"
}
QUEUE_BACKEND = {
'switches': ("-B", "--mq-backend"),
'dest': "queue_backend",
'type': "str",
'help': "message queue backend name"
}
LISTENER_OPTIONS = (HOST, PORT)
MQ_OPTIONS = (QUEUE_BACKEND, QUEUE_HOST, QUEUE_PORT)
ALL_OPTIONS = (QUIET,) + LISTENER_OPTIONS + MQ_OPTIONS