From 4c4fae62cfba1d70854cc28fa73b96f79468433a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 17 Aug 2021 14:01:00 -0700 Subject: [PATCH] Delete clipext.py. --- voussoirkit/clipext.py | 44 ------------------------------------------ 1 file changed, 44 deletions(-) delete mode 100644 voussoirkit/clipext.py diff --git a/voussoirkit/clipext.py b/voussoirkit/clipext.py deleted file mode 100644 index 1e5161b..0000000 --- a/voussoirkit/clipext.py +++ /dev/null @@ -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