David Glick
2015-02-13 a1d053cfb9818d9a24fbd78b649c8112aa2a3e81
Add workaround to make sure echo is enabled after reload (refs #689)

Also add myself to CONTRIBUTORS.txt
3 files modified
20 ■■■■■ changed files
CHANGES.txt 4 ●●●● patch | view | raw | blame | history
CONTRIBUTORS.txt 2 ●●●●● patch | view | raw | blame | history
pyramid/scripts/pserve.py 14 ●●●●● patch | view | raw | blame | history
CHANGES.txt
@@ -1,6 +1,10 @@
Next release
============
- Work around an issue where ``pserve --reload`` would leave terminal echo
  disabled if it reloaded during a pdb session.
  Backported from https://github.com/Pylons/pyramid/pull/1577
- Fixed a failing unittest caused by differing mimetypes on various
  OS platforms. See https://github.com/Pylons/pyramid/issues/1405
CONTRIBUTORS.txt
@@ -234,3 +234,5 @@
- Fenton Travers, 2014/05/06
- Geoffrey T. Dairiki, 2015/02/06
- David Glick, 2015/02/12
pyramid/scripts/pserve.py
@@ -34,6 +34,11 @@
MAXFD = 1024
try:
    import termios
except ImportError: # pragma: no cover
    termios = None
if WIN and not hasattr(os, 'kill'): # pragma: no cover
    # py 2.6 on windows
    def kill(pid, sig=None):
@@ -691,6 +696,14 @@
        raise SystemExit
    signal.signal(signal.SIGTERM, handle_term)
def ensure_echo_on(): # pragma: no cover
    if termios:
        fd = sys.stdin.fileno()
        attr_list = termios.tcgetattr(fd)
        if not attr_list[3] & termios.ECHO:
            attr_list[3] |= termios.ECHO
            termios.tcsetattr(fd, termios.TCSANOW, attr_list)
def install_reloader(poll_interval=1, extra_files=None): # pragma: no cover
    """
    Install the reloading monitor.
@@ -700,6 +713,7 @@
    ``raise_keyboard_interrupt`` option creates a unignorable signal
    which causes the whole application to shut-down (rudely).
    """
    ensure_echo_on()
    mon = Monitor(poll_interval=poll_interval)
    if extra_files is None:
        extra_files = []