forked from openlp/openlp
Update remote client
This commit is contained in:
parent
1164ab9beb
commit
5838495bb4
@ -28,7 +28,6 @@ import socket
|
|||||||
import sys
|
import sys
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
|
||||||
def sendData(options, message):
|
def sendData(options, message):
|
||||||
addr = (options.address, options.port)
|
addr = (options.address, options.port)
|
||||||
try:
|
try:
|
||||||
@ -47,34 +46,23 @@ def main():
|
|||||||
parser.add_option("-v", "--verbose",
|
parser.add_option("-v", "--verbose",
|
||||||
action="store_true", dest="verbose", default=True,
|
action="store_true", dest="verbose", default=True,
|
||||||
help="make lots of noise [%default]")
|
help="make lots of noise [%default]")
|
||||||
parser.add_option("-p", "--port",
|
parser.add_option("-p", "--port", default=4316,
|
||||||
default=4316,
|
|
||||||
help="IP Port number %default ")
|
help="IP Port number %default ")
|
||||||
parser.add_option("-a", "--address",
|
parser.add_option("-a", "--address",
|
||||||
help="Recipient address ")
|
help="Recipient address ")
|
||||||
parser.add_option("-e", "--event",
|
|
||||||
default=u'Alert',
|
|
||||||
help="Action to be undertaken")
|
|
||||||
parser.add_option("-m", "--message",
|
parser.add_option("-m", "--message",
|
||||||
help="Message to be passed for the action")
|
help="Message to be passed for the action")
|
||||||
parser.add_option("-n", "--slidenext",
|
|
||||||
help="Trigger the next slide")
|
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
if len(args) > 0:
|
if len(args) > 0:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
parser.error("incorrect number of arguments")
|
parser.error("incorrect number of arguments")
|
||||||
elif options.message is None:
|
|
||||||
parser.print_help()
|
|
||||||
parser.error("No message passed")
|
|
||||||
elif options.address is None:
|
elif options.address is None:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
parser.error("IP address missing")
|
parser.error("IP address missing")
|
||||||
elif options.slidenext:
|
elif options.message is None:
|
||||||
options.event = u'next_slide'
|
parser.print_help()
|
||||||
options.message = u''
|
parser.error("No message passed")
|
||||||
text = format_message(options)
|
|
||||||
sendData(options, text)
|
|
||||||
else:
|
else:
|
||||||
text = format_message(options)
|
text = format_message(options)
|
||||||
sendData(options, text)
|
sendData(options, text)
|
Loading…
Reference in New Issue
Block a user