From e1cde9174a5ba42de8daccd7b74ea10093029220 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Thu, 15 Aug 2019 21:19:38 +0200 Subject: :truck: Move package into folder --- in/__init__.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 in/__init__.py (limited to 'in') diff --git a/in/__init__.py b/in/__init__.py deleted file mode 100644 index b886141..0000000 --- a/in/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -class _Getch: - """Gets a single character from standard input. Does not echo to the -screen.""" - def __init__(self): - try: - self.impl = _GetchWindows() - except ImportError: - self.impl = _GetchUnix() - - def __call__(self): return self.impl() - - -class _GetchUnix: - def __init__(self): - import tty, sys - - def __call__(self): - import sys, tty, termios - fd = sys.stdin.fileno() - old_settings = termios.tcgetattr(fd) - try: - tty.setraw(sys.stdin.fileno()) - ch = sys.stdin.read(1) - finally: - termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) - return ch - - -class _GetchWindows: - def __init__(self): - import msvcrt - - def __call__(self): - import msvcrt - return msvcrt.getch() -- cgit v1.2.3