Dropping webbrowser hack until a better implementation is found.
This commit is contained in:
18
rtv/utils.py
18
rtv/utils.py
@@ -3,14 +3,10 @@ import sys
|
||||
import curses
|
||||
import time
|
||||
import threading
|
||||
import subprocess
|
||||
from curses import textpad, ascii
|
||||
from contextlib import contextmanager
|
||||
from functools import partial
|
||||
from types import MethodType
|
||||
|
||||
from six.moves import configparser
|
||||
from six import create_bound_method
|
||||
|
||||
from .errors import EscapePressed
|
||||
|
||||
@@ -83,17 +79,6 @@ def load_config():
|
||||
|
||||
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):
|
||||
"""
|
||||
Transform a window into a text box that will accept user input and loop
|
||||
@@ -276,12 +261,9 @@ def curses_session():
|
||||
# Hide blinking cursor
|
||||
curses.curs_set(0)
|
||||
|
||||
# hide_stderr()
|
||||
|
||||
yield stdscr
|
||||
|
||||
finally:
|
||||
|
||||
if stdscr is not None:
|
||||
stdscr.keypad(0)
|
||||
curses.echo()
|
||||
|
||||
Reference in New Issue
Block a user