Ticket #8107: trac_8107-server_imports.patch

File trac_8107-server_imports.patch, 2.7 KB (added by mpatel, 12 years ago)

sage repo.

  • sage/server/notebook/all.py

    # HG changeset patch
    # User Mitesh Patel <qed777@gmail.com>
    # Date 1264652995 28800
    # Node ID 049a8be084a157d87668c8ebf0f5cc7f736d1933
    # Parent  91c7fc04fde06744ada83d7f0f125cf175ea098c
    #8107/notebook: Fewer unnecessary imports from sage/server
    
    diff --git a/sage/server/notebook/all.py b/sage/server/notebook/all.py
    a b  
    1414#from interact import interact, input_box, slider, range_slider, selector, checkbox, input_grid, text_control
    1515
    1616# We import the following two only for doctesting purposes
    17 import sage.server.notebook.notebook
    18 import sage.server.notebook.interact
    19 import sage.server.notebook.sage_email
     17#import sage.server.notebook.notebook
     18#import sage.server.notebook.interact
     19#import sage.server.notebook.sage_email
    2020
    2121# Import the new separated Sage notebook.
    2222from sagenb.notebook.all import *
  • sage/server/notebook/cell.py

    diff --git a/sage/server/notebook/cell.py b/sage/server/notebook/cell.py
    a b else: 
    6161
    6262# Introspection.  The cache directory is a module-scope variable set
    6363# in the first call to Cell.set_introspect_html().
    64 import errno, hashlib, time
    65 from sphinx.application import Sphinx
     64Sphinx = None
    6665_SAGE_INTROSPECT = None
    6766
    6867class Cell_generic:
    class Cell(Cell_generic): 
    16381637            # latter is exclusive to a worksheet's process.  The Sage
    16391638            # cleaner should delete the temporary directory (or
    16401639            # directories) after the notebook server exits.
    1641             global _SAGE_INTROSPECT
     1640            import errno, hashlib
     1641            global Sphinx, _SAGE_INTROSPECT
     1642            if not Sphinx:
     1643                from sphinx.application import Sphinx
    16421644
    16431645            if _SAGE_INTROSPECT is None:
    16441646                from sage.misc.misc import DOT_SAGE, tmp_dir
  • sage/server/support.py

    diff --git a/sage/server/support.py b/sage/server/support.py
    a b AUTHORS: 
    88- Nick Alexander
    99"""
    1010
    11 import inspect
    1211import os
    1312import string
    1413from cPickle import PicklingError
    import sage.misc.sageinspect as sageinsp 
    2221
    2322from sage.misc.preparser import preparse
    2423
    25 import pydoc
    26 
    2724######################################################################
    2825# Initialization
    2926######################################################################
    def help(obj): 
    9895        sage: os.chdir(current_dir)
    9996    """
    10097    from pydoc import resolve, html, describe
    101     import sage.server.notebook.interact as interact
    10298
    10399    print '<html><table notracebacks bgcolor="#386074" cellpadding=10 cellspacing=10><tr><td bgcolor="#f5f5f5"><font color="#37546d">'
    104100    object, name = resolve(obj)