From 96017ef227b28901579dba6df12eb008b55a767f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 23 Nov 2012 19:23:53 +0530 Subject: [PATCH] Remove the superseeded --redirect-console-output option from the calibre gui launcher --- src/calibre/gui2/main_window.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/calibre/gui2/main_window.py b/src/calibre/gui2/main_window.py index 88827fe646..088ea53ad0 100644 --- a/src/calibre/gui2/main_window.py +++ b/src/calibre/gui2/main_window.py @@ -20,26 +20,8 @@ Usage: %prog [options] Launch the Graphical User Interface '''): parser = OptionParser(usage) - # The b is required because of a regression in optparse.py in python 2.7.0 - parser.add_option(b'--redirect-console-output', default=False, action='store_true', dest='redirect', - help=_('Redirect console output to a dialog window (both stdout and stderr). Useful on windows where GUI apps do not have a output streams.')) return parser -class DebugWindow(ConversionErrorDialog): - - def __init__(self, parent): - ConversionErrorDialog.__init__(self, parent, 'Console output', '') - self.setModal(Qt.NonModal) - font = QFont() - font.setStyleHint(QFont.TypeWriter) - self.text.setFont(font) - - def write(self, msg): - self.text.setPlainText(self.text.toPlainText()+QString(msg)) - - def flush(self): - pass - class GarbageCollector(QObject): ''' @@ -120,10 +102,6 @@ class MainWindow(QMainWindow): QMainWindow.__init__(self, parent) if disable_automatic_gc: self._gc = GarbageCollector(self, debug=False) - if getattr(opts, 'redirect', False): - self.__console_redirect = DebugWindow(self) - sys.stdout = sys.stderr = self.__console_redirect - self.__console_redirect.show() def unhandled_exception(self, type, value, tb): if type == KeyboardInterrupt: