Ticket #11733: trac_11733_sagenb_misc_misc_sage.patch

File trac_11733_sagenb_misc_misc_sage.patch, 1.1 KB (added by saraedum, 10 years ago)
  • sage/graphs/graph_editor.py

    exporting patch:
    # HG changeset patch
    # User Julian Rüth <julian.rueth@gmail.com>
    Trac 11733: do not load sagenb.misc.misc on normal startup
    
    diff --git a/sage/graphs/graph_editor.py b/sage/graphs/graph_editor.py
    index fd5cf83..d62c4f6 100644
    a b from graph import Graph 
    1818from graph_generators import graphs
    1919from sage.misc.html import html
    2020
    21 import sagenb.notebook.interact
    22 from sagenb.misc.support import EMBEDDED_MODE
    2321
    2422
    2523def graph_to_js(g):
    def graph_editor(graph=None, graph_name=None, 
    105103    if graph is None:
    106104        graph = graphs.CompleteGraph(2)
    107105       
     106    from sagenb.misc.support import EMBEDDED_MODE
    108107    if not EMBEDDED_MODE:
    109108        return "This graph editor only runs in the Sage notebook."
    110109
    def graph_editor(graph=None, graph_name=None, 
    117116            if id(locs[var]) == id(graph):
    118117                graph_name = var
    119118
     119    import sagenb.notebook.interact
    120120    cell_id = sagenb.notebook.interact.SAGE_CELL_ID
    121121
    122122    # TODO: Put reasonable checks for large graphs, before disaster