Broadcast kitten: Fix --match and also remove a useless print

This commit is contained in:
Kovid Goyal 2021-08-19 21:58:04 +05:30
parent 51244c4388
commit 09c18f474f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -25,7 +25,7 @@ class Broadcast(Handler):
def __init__(self, opts: BroadcastCLIOptions, initial_strings: List[str]) -> None: def __init__(self, opts: BroadcastCLIOptions, initial_strings: List[str]) -> None:
self.opts = opts self.opts = opts
self.initial_strings = initial_strings self.initial_strings = initial_strings
self.payload = {'exclude_active': True, 'data': '', 'match': opts.match_tab, 'match_tab': opts.match_tab} self.payload = {'exclude_active': True, 'data': '', 'match': opts.match, 'match_tab': opts.match_tab}
self.line_edit = LineEdit() self.line_edit = LineEdit()
if not opts.match and not opts.match_tab: if not opts.match and not opts.match_tab:
self.payload['all'] = True self.payload['all'] = True
@ -98,7 +98,6 @@ def main(args: List[str]) -> Optional[Dict[str, Any]]:
input(_('Press Enter to quit')) input(_('Press Enter to quit'))
return None return None
print('Type text to be broadcast below, Ctrl-C to quit:', end='\r\n')
sys.stdout.flush() sys.stdout.flush()
loop = Loop() loop = Loop()
handler = Broadcast(opts, items) handler = Broadcast(opts, items)