-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance test client #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я б ещё сразу подумал в сторону подключения через UNIX-сокет по умолчанию, как тут: https://github.com/wirenboard/wb-diag-collect/blob/master/wb/diag/rpc_server.py
bin/mqtt-rpc-client
Outdated
try: | ||
import mosquitto | ||
except ImportError: | ||
import paho.mqtt.client as mosquitto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно сразу избавляться от mosquitto
, всё равно пользоваться им больше не стоит
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убрал
bin/mqtt-rpc-client
Outdated
dest="driver", | ||
type=str, | ||
help="Driver name", | ||
default="db_logger", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы не стал тут делать допущения насчёт значений по умолчанию
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убрал дефолты
bin/mqtt-rpc-client
Outdated
default="get_channels", | ||
) | ||
parser.add_argument( | ||
"-a", "--args", dest="args", type=str, help="Method arguments", default="{}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут можно сделать магию, написав type=json.loads
, тогда оно сразу распарсится
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Заменил на одну опцию
|
Usage example: