Ticket #3844: sage-3844.patch

File sage-3844.patch, 4.7 KB (added by was, 19 months ago)
  • sage/server/notebook/css.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1218683055 25200
    # Node ID f92bfd1c9ab223cd2fb1f908e728ea28cd196e4b
    # Parent  bb9049584f0cfd09fdc2ac2afef28dd1ab37258c
    trac #3844 -- notebook -- worksheet should call sys.path.append(DATA) when being initalized
    
    diff -r bb9049584f0c -r f92bfd1c9ab2 sage/server/notebook/css.py
    a b  
    14211421    background-color: white; 
    14221422    padding: 3px; 
    14231423    overflow:auto; 
    1424     /* width: 100%; */ 
     1424    width: 98%;  
    14251425    margin-top: 0.5em; 
    14261426} 
    14271427 
     
    16931693blockquote,q { 
    16941694quotes:"" "" 
    16951695} 
    1696 """ 
    1697  No newline at end of file 
     1696""" 
  • sage/server/notebook/notebook.py

    diff -r bb9049584f0c -r f92bfd1c9ab2 sage/server/notebook/notebook.py
    a b  
    17481748        elif ext in ['.txt', '.tex', '.sage', '.spyx', '.py', '.f', '.f90', '.c']: 
    17491749            body += '<form method="post" action="savedatafile" enctype="multipart/form-data">' 
    17501750            body += '<input type="submit" value="Save Changes" name="button_save"> <input type="submit" value="Cancel" name="button_cancel"><br>' 
    1751             body += '<textarea class="edit" name="textfield" rows=17 cols=70 id="textfield">%s</textarea>'%open('%s/%s'%(ws.data_directory(), filename)).read() 
     1751            body += '<textarea class="edit" name="textfield" rows=17 cols=90 id="textfield">%s</textarea>'%open('%s/%s'%(ws.data_directory(), filename)).read() 
    17521752            body += '<input type="hidden" name="filename" value="%s" id="filename">'%filename 
    17531753            body += '</form>' 
    17541754 
  • sage/server/notebook/tutorial.py

    diff -r bb9049584f0c -r f92bfd1c9ab2 sage/server/notebook/tutorial.py
    a b  
    379379                ('Input Rules', "Code is evaluated by exec'ing (after preparsing).  Only the output of the last line of the cell is implicitly printed.  If any line starts with \"sage:\" or \">>>\" the entire block is assumed to contain text and examples, so only lines that begin with a prompt are executed.   Thus you can paste in complete examples from the docs without any editing, and you can write input cells that contains non-evaluated plain text mixed with examples by starting the block with \">>>\" or including an example."), 
    380380                ('Working Directory', 'Each block of code is run from its own directory.  If any images are created as a side effect, they will automatically be displayed.'), 
    381381            ('DIR variable', 'The variable DIR contains the directory from which you started the SAGE notebook.  For example, to open a file in that directory, do "open(DIR+\'filename\')".'), 
    382             ('DATA variable', 'The variable DATA contains the directory with data files that you upload into the worksheet.  For example, to open a file in that directory, do "open(DATA+\'filename\')".'), 
     382            ('Data...', 'Use the Data menu to upload images and other files, and create new files that can be shared between worksheets.  The DATA variable contains the path to the data files.  For example, to open a file in that directory, do "open(DATA+\'filename\')".  If foo.sage is a Sage file that you uploaded, type "load foo.sage"; if foo.py is a Python, you can import it by typing "import foo".'), 
    383383            ('Split and join cells', 'Press ctrl-; in a cell to split it into two cells, and ctrl-backspace to join them.  Press ctrl-enter to split a cell and evaluate both pieces.'), 
    384384#                ('Emacs Keybindings', 'If you are using GNU/Linux, you can change (or create) a <tt>.gtkrc-2.0</tt> file.  Add the line <tt>gtk-key-theme-name = "Emacs"</tt> to it.  See <a target="_blank" href="http://kb.mozillazine.org/Emacs_Keybindings_(Firefox)">this page</a> [mozillazine.org] for more details.'), 
    385385 #               ('More Help', 'Type "help(sage.server.notebook.notebook)" for a detailed discussion of the architecture of the SAGE notebook and a tutorial (or see the SAGE reference manual).'), 
  • sage/server/notebook/worksheet.py

    diff -r bb9049584f0c -r f92bfd1c9ab2 sage/server/notebook/worksheet.py
    a b  
    23982398        S = self.sage() 
    23992399        try: 
    24002400            cmd = '__DIR__="%s/"; DIR=__DIR__; DATA="%s/"; '%(self.DIR(), os.path.abspath(self.data_directory())) 
     2401            cmd += 'sys.path.append(DATA); ' 
    24012402            cmd += '_support_.init(None, globals()); ' 
    24022403            S._send(cmd)   # non blocking 
    24032404        except Exception, msg: