Changeset 7480:bfdc4a04b179


Ignore:
Timestamp:
12/01/07 10:01:39 (5 years ago)
Author:
William Stein <wstein@…>
Branch:
default
Message:

trac #1349 -- change default location of sage_notebook; *ALSO* make a command inotebook(...) that runs an insecure version of the notebook just like 'sage -inotebook".

Location:
sage/server/notebook
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sage/server/notebook/all.py

    r6787 r7480  
    1111#from twist import notebook_twisted as notebook 
    1212 
    13 from notebook_object import notebook 
    14  
     13from notebook_object import notebook, inotebook 
    1514 
    1615from sagetex import sagetex 
  • sage/server/notebook/notebook.py

    r7253 r7480  
    4444class Notebook(SageObject): 
    4545    def __init__(self, 
    46                  dir='sage_notebook', 
     46                 dir, 
    4747                 system=None,  
    4848                 show_debug = False, 
  • sage/server/notebook/notebook_object.py

    r7313 r7480  
    2222 
    2323    INPUT: 
    24         directory  -- (default: 'sage_notebook') directory that contains 
    25                       the SAGE notebook files 
     24        directory  -- directory that contains the SAGE notebook files; 
     25                      The default is .sage/sage_notebook, in your home directory. 
    2626        port       -- (default: 8000), port to serve the notebook on 
    2727        address    -- (default: 'localhost'), address to listen on 
     
    141141 
    142142notebook = NotebookObject() 
     143 
     144 
     145def inotebook(*args, **kwds): 
     146    """ 
     147    Exactly the same as notebook(...) but with secure=False. 
     148    """ 
     149    kwds['secure'] = False 
     150    notebook(*args, **kwds) 
  • sage/server/notebook/run_notebook.py

    r6787 r7480  
    4343 
    4444def notebook_twisted(self, 
    45              directory   = 'sage_notebook', 
     45             directory   = None, 
    4646             port        = 8000, 
    4747             address     = 'localhost', 
     
    6060             sagetex_path = "", 
    6161             start_path = ""): 
     62    if directory is None: 
     63        directory = '%s/sage_notebook'%DOT_SAGE 
    6264    if not os.path.exists(directory): 
    6365        os.makedirs(directory) 
     66 
     67    print "The notebook files are stored in:", directory 
     68    # First change to the directory that contains the notebook directory 
     69    wd = os.path.split(directory) 
     70    if wd[0]: os.chdir(wd[0]) 
     71    directory = wd[1] 
     72 
     73 
    6474    port = int(port) 
    6575    conf = '%s/twistedconf.tac'%directory 
     
    135145         
    136146        config = open(conf, 'w') 
     147 
    137148        config.write(""" 
    138149####################################################################         
    139150# WARNING -- Do not edit this file!   It is autogenerated each time 
    140151# the notebook(...) command is executed. 
    141 ####################################################################         
     152#################################################################### 
     153 
     154# Now set things up and start the notebook 
    142155import sage.server.notebook.notebook 
    143156sage.server.notebook.notebook.JSMATH=True 
Note: See TracChangeset for help on using the changeset viewer.