Dropping webbrowser hack until a better implementation is found.

This commit is contained in:
Michael Lazar
2015-03-08 23:25:13 -07:00
parent f1fc9e1d4c
commit 7c5ff238d4

View File

@@ -3,14 +3,10 @@ import sys
import curses import curses
import time import time
import threading import threading
import subprocess
from curses import textpad, ascii from curses import textpad, ascii
from contextlib import contextmanager from contextlib import contextmanager
from functools import partial
from types import MethodType
from six.moves import configparser from six.moves import configparser
from six import create_bound_method
from .errors import EscapePressed from .errors import EscapePressed
@@ -83,17 +79,6 @@ def load_config():
return defaults return defaults
def hide_stderr():
"""
Redirect all stderr output to null. This is a hack to stop the webbrowser
from spewing errors in firefox.
"""
# http://www.thecodingforums.com/threads/how-to-change-redirect-stderr.355342/#post-1868822
sys.stderr.flush()
err = open(os.devnull, 'ab+', 0)
os.dup2(err.fileno(), sys.stderr.fileno())
def text_input(window): def text_input(window):
""" """
Transform a window into a text box that will accept user input and loop Transform a window into a text box that will accept user input and loop
@@ -276,14 +261,11 @@ def curses_session():
# Hide blinking cursor # Hide blinking cursor
curses.curs_set(0) curses.curs_set(0)
# hide_stderr()
yield stdscr yield stdscr
finally: finally:
if stdscr is not None: if stdscr is not None:
stdscr.keypad(0) stdscr.keypad(0)
curses.echo() curses.echo()
curses.nocbreak() curses.nocbreak()
curses.endwin() curses.endwin()