Remove unused code

This commit is contained in:
Kovid Goyal 2018-02-14 18:50:52 +05:30
parent e4b643fdaf
commit 97b4256ba4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 18 deletions

View File

@ -12,7 +12,7 @@ from gettext import gettext as _
from kitty.cli import parse_args from kitty.cli import parse_args
from kitty.key_encoding import ESCAPE, backspace_key, enter_key from kitty.key_encoding import ESCAPE, backspace_key, enter_key
from kitty.utils import command_for_open, read_with_timeout from kitty.utils import command_for_open
from ..tui.handler import Handler from ..tui.handler import Handler
from ..tui.loop import Loop from ..tui.loop import Loop
@ -143,21 +143,6 @@ class URLHints(Handler):
self.write(self.current_text) self.write(self.current_text)
def read_from_stdin():
buf = []
def more_needed(data):
idx = data.find(b'\x1c')
if idx == -1:
buf.append(data)
return True
buf.append(data[:idx])
return False
read_with_timeout(more_needed)
return b''.join(buf).decode('utf-8')
def regex_finditer(pat, line): def regex_finditer(pat, line):
for m in pat.finditer(line): for m in pat.finditer(line):
s, e = m.span() s, e = m.span()

View File

@ -407,9 +407,9 @@ class Boss:
if '--program' not in cmdline: if '--program' not in cmdline:
args.extend(('--program', self.opts.open_url_with)) args.extend(('--program', self.opts.open_url_with))
if type_of_input in ('text', 'history'): if type_of_input in ('text', 'history'):
data = ((w.buffer_as_text if type_of_input == 'history' else w.as_text)() + '\x1c').encode('utf-8') data = (w.buffer_as_text if type_of_input == 'history' else w.as_text)().encode('utf-8')
elif type_of_input in ('ansi', 'ansi-history'): elif type_of_input in ('ansi', 'ansi-history'):
data = ((w.buffer_as_ansi() if type_of_input == 'ansi-history' else w.as_text(as_ansi=True)) + '\x1c').encode('utf-8') data = (w.buffer_as_ansi() if type_of_input == 'ansi-history' else w.as_text(as_ansi=True)).encode('utf-8')
elif type_of_input == 'none': elif type_of_input == 'none':
data = None data = None
else: else: