# HG changeset patch # User Mitesh Patel # 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/sage/server/notebook/all.py +++ b/sage/server/notebook/all.py @@ -14,9 +14,9 @@ #from interact import interact, input_box, slider, range_slider, selector, checkbox, input_grid, text_control # We import the following two only for doctesting purposes -import sage.server.notebook.notebook -import sage.server.notebook.interact -import sage.server.notebook.sage_email +#import sage.server.notebook.notebook +#import sage.server.notebook.interact +#import sage.server.notebook.sage_email # Import the new separated Sage notebook. from sagenb.notebook.all import * diff --git a/sage/server/notebook/cell.py b/sage/server/notebook/cell.py --- a/sage/server/notebook/cell.py +++ b/sage/server/notebook/cell.py @@ -61,8 +61,7 @@ else: # Introspection. The cache directory is a module-scope variable set # in the first call to Cell.set_introspect_html(). -import errno, hashlib, time -from sphinx.application import Sphinx +Sphinx = None _SAGE_INTROSPECT = None class Cell_generic: @@ -1638,7 +1637,10 @@ class Cell(Cell_generic): # latter is exclusive to a worksheet's process. The Sage # cleaner should delete the temporary directory (or # directories) after the notebook server exits. - global _SAGE_INTROSPECT + import errno, hashlib + global Sphinx, _SAGE_INTROSPECT + if not Sphinx: + from sphinx.application import Sphinx if _SAGE_INTROSPECT is None: from sage.misc.misc import DOT_SAGE, tmp_dir diff --git a/sage/server/support.py b/sage/server/support.py --- a/sage/server/support.py +++ b/sage/server/support.py @@ -8,7 +8,6 @@ AUTHORS: - Nick Alexander """ -import inspect import os import string from cPickle import PicklingError @@ -22,8 +21,6 @@ import sage.misc.sageinspect as sageinsp from sage.misc.preparser import preparse -import pydoc - ###################################################################### # Initialization ###################################################################### @@ -98,7 +95,6 @@ def help(obj): sage: os.chdir(current_dir) """ from pydoc import resolve, html, describe - import sage.server.notebook.interact as interact print '
' object, name = resolve(obj)