Ticket #14188: trac_14188_docfix.patch

File trac_14188_docfix.patch, 1.4 KB (added by vbraun, 8 years ago)

Improved patch

  • sage/interfaces/sage0.py

    # HG changeset patch
    # User Volker Braun <vbraun@stp.dias.ie>
    # Date 1362080002 36000
    # Node ID 146639f9b98662a278732d2c050ec66014ce1577
    # Parent  8d5b47f3219290706989a2749735e47c5b98c8d5
    Switch off color in doctests
    
    diff --git a/sage/interfaces/sage0.py b/sage/interfaces/sage0.py
    a b  
    145145        else:
    146146            # Disable the IPython history (implemented as SQLite database)
    147147            # to avoid problems with locking.
    148             command = "sage-ipython --HistoryManager.hist_file=:memory:"
     148            command = "sage-ipython --HistoryManager.hist_file=:memory: --colors=NoColor"
    149149            prompt = "sage: "
    150150            if init_code is None:
    151                 init_code = ['import cPickle', '%colors NoColor']
     151                init_code = ['import cPickle']
    152152
    153153        Expect.__init__(self,
    154154                        name = 'sage',
  • sage/misc/interpreter.py

    diff --git a/sage/misc/interpreter.py b/sage/misc/interpreter.py
    a b  
    660660        verbose_crash = True),
    661661    TerminalInteractiveShell = Config(
    662662        ast_node_interactivity = 'all',
    663         colors = 'LightBG',
     663        colors = 'LightBG' if sys.stdout.isatty() else 'NoColor',
    664664        confirm_exit = False,
    665665        separate_in = ''),
    666666    # The extension is *always* loaded for SageTerminalApp