platypush/platypush/pusher/__main__.py

16 lines
368 B
Python
Raw Normal View History

2018-01-02 00:48:41 +01:00
import sys
from . import Pusher
2018-01-04 02:45:23 +01:00
opts = Pusher.parse_build_args(sys.argv[1:])
pusher = Pusher(config_file=opts.config, backend=opts.backend)
2018-01-02 00:48:41 +01:00
2018-01-04 02:45:23 +01:00
if opts.type == 'event':
pusher.send_event(target=opts.target, type=opts.event, **opts.args)
else:
pusher.send_request(target=opts.target, action=opts.action, timeout=opts.timeout, **opts.args)
2018-01-02 00:48:41 +01:00
# vim:sw=4:ts=4:et: