Esempio n. 1
0
def init(object_directory=None, globs={}):
    r"""
    Initialize FEMhub for use with the web notebook interface.
    """
    global sage_globals, globals_at_init, global_names_at_init
    global EMBEDDED_MODE

    os.environ['PAGER'] = 'cat'
    
    sage_globals = globs
    #globals_at_init = set(globs.keys())
    globals_at_init = globs.values()
    global_names_at_init = set(globs.keys())
    EMBEDDED_MODE = True
    sageinspect.EMBEDDED_MODE = True
    
    setup_systems(globs)
    session_init(globs)

    # Ugly cruft.  Initialize the embedded mode of the old FEMhub
    # notebook, which is going to be included in old copies of FEMhub
    # forever.
    try:
        import sage.server.support
        sage.server.support.EMBEDDED_MODE = True
    except ImportError:
        pass
Esempio n. 2
0
def init(object_directory=None, globs={}):
    r"""
    Initialize Sage for use with the web notebook interface.
    """
    global sage_globals, globals_at_init, global_names_at_init
    global EMBEDDED_MODE

    os.environ['PAGER'] = 'cat'

    sage_globals = globs
    #globals_at_init = set(globs.keys())
    globals_at_init = globs.values()
    global_names_at_init = set(globs.keys())
    EMBEDDED_MODE = True

    setup_systems(globs)
    session_init(globs)

    # Ugly cruft.  Initialize the embedded mode of the old Sage
    # notebook, which is going to be included in old copies of Sage
    # forever.
    try:
        import sage.server.support
        sage.server.support.EMBEDDED_MODE = True
    except ImportError:
        pass
    # Also initialize EMBEDDED_MODE in Sage's misc.sageinspect module,
    # which is used to format docstrings in the notebook.
    try:
        import sage.misc.sageinspect
        sage.misc.sageinspect.EMBEDDED_MODE = True
    except ImportError:
        pass
Esempio n. 3
0
def init(object_directory=None, globs={}):
    r"""
    Initialize Sage for use with the web notebook interface.
    """
    global sage_globals, globals_at_init, global_names_at_init
    global EMBEDDED_MODE

    os.environ['PAGER'] = 'cat'
    
    sage_globals = globs
    #globals_at_init = set(globs.keys())
    globals_at_init = globs.values()
    global_names_at_init = set(globs.keys())
    EMBEDDED_MODE = True
    
    setup_systems(globs)
    session_init(globs)

    # Ugly cruft.  Initialize the embedded mode of the old Sage
    # notebook, which is going to be included in old copies of Sage
    # forever.
    try:
        import sage.server.support
        sage.server.support.EMBEDDED_MODE = True
    except ImportError:
        pass
    # Also initialize EMBEDDED_MODE in Sage's misc.sageinspect module,
    # which is used to format docstrings in the notebook.
    try:
        import sage.misc.sageinspect
        sage.misc.sageinspect.EMBEDDED_MODE = True
    except ImportError:
        pass