diff options
author | Baruch Sterin <baruchs@gmail.com> | 2015-11-05 01:24:26 -0800 |
---|---|---|
committer | Baruch Sterin <baruchs@gmail.com> | 2015-11-05 01:24:26 -0800 |
commit | c610c036616d0b06e9036c4d17be6168619a6332 (patch) | |
tree | d7229e7967e086585e7575ae9e3476d80d2e34ff /src/python/getch.py | |
parent | aa62165a1cbd40740eb4ef5237d3a2259c40fb1d (diff) | |
download | abc-c610c036616d0b06e9036c4d17be6168619a6332.tar.gz abc-c610c036616d0b06e9036c4d17be6168619a6332.tar.bz2 abc-c610c036616d0b06e9036c4d17be6168619a6332.zip |
pyabc: remove python integration from abc, it is moved to a separate extension
Diffstat (limited to 'src/python/getch.py')
-rw-r--r-- | src/python/getch.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/python/getch.py b/src/python/getch.py deleted file mode 100644 index 89e13078..00000000 --- a/src/python/getch.py +++ /dev/null @@ -1,37 +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() - -getch = _Getch() |