new method ConsoleApplication.acquire_input() to read stdin friendly
This commit is contained in:
parent
9e3b1a049e
commit
e731f42cb9
4 changed files with 12 additions and 9 deletions
|
|
@ -230,12 +230,7 @@ class Boobmsg(ReplApplication):
|
|||
"""
|
||||
receivers, text = self.parse_command_args(line, 2, 1)
|
||||
if text is None:
|
||||
if self.interactive:
|
||||
print 'Reading message content from stdin... Type ctrl-D ' \
|
||||
'from an empty line to post message.'
|
||||
text = sys.stdin.read()
|
||||
if sys.stdin.encoding:
|
||||
text = text.decode(sys.stdin.encoding)
|
||||
text = self.acquire_input()
|
||||
|
||||
if self.options.skip_empty and not text.strip():
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue