kopia lustrzana https://github.com/Yakifo/amqtt
support -l and -s arguments
rodzic
c4e58669e9
commit
ddab6ff576
|
@ -74,10 +74,17 @@ def _get_message(arguments):
|
||||||
yield line.encode(encoding='utf-8')
|
yield line.encode(encoding='utf-8')
|
||||||
except:
|
except:
|
||||||
logger.error("%s Failed to read file '%s'" % (client.client_id, arguments['-f']))
|
logger.error("%s Failed to read file '%s'" % (client.client_id, arguments['-f']))
|
||||||
if arguments['-s']:
|
if arguments['-l']:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
yield line.encode(encoding='utf-8')
|
if line:
|
||||||
|
yield line.encode(encoding='utf-8')
|
||||||
|
if arguments['-s']:
|
||||||
|
import sys
|
||||||
|
message = bytearray()
|
||||||
|
for line in sys.stdin:
|
||||||
|
message.extend(line.encode(encoding='utf-8'))
|
||||||
|
yield message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue