Delete clipext.py.

This commit is contained in:
voussoir 2021-08-17 14:01:00 -07:00
parent 8ce994a54b
commit 4c4fae62cf
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -1,44 +0,0 @@
import pyperclip
CLIPBOARD_STRINGS = ['!c', '!clip', '!clipboard']
INPUT_STRINGS = ['!i', '!in', '!input', '!stdin']
EOF = '\x1a'
def _input_lines():
while True:
try:
additional = input()
except EOFError:
# If you enter nothing but ctrl-z
additional = EOF
additional = additional.split(EOF)
has_eof = len(additional) > 1
additional = additional[0]
yield additional
if has_eof:
break
def multi_line_input(split_lines=False):
generator = _input_lines()
if split_lines:
return generator
else:
return '\n'.join(generator)
def resolve(arg, split_lines=False):
lowered = arg.lower()
if lowered in INPUT_STRINGS:
return multi_line_input(split_lines=split_lines)
elif lowered in CLIPBOARD_STRINGS:
text = pyperclip.paste()
else:
text = arg
if split_lines:
lines = text.splitlines()
return lines
else:
return text