Ticket #7514: sagenb-7514-rebase-part3.2.patch

File sagenb-7514-rebase-part3.2.patch, 2.1 KB (added by mpatel, 11 years ago)

Trivial docstring tweaks. Replaces previous.

  • sagenb/notebook/cell.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1262324176 28800
    # Node ID 4581c4cb69348e86f83863378af8e3ae4671905f
    # Parent  d5c94309582791ac3c3585d5edb5102c1bdd42c4
    trac 7514 -- (part 3) -- rewrite load/attach
    
    diff --git a/sagenb/notebook/cell.py b/sagenb/notebook/cell.py
    a b class Cell(Cell_generic): 
    20822082            return ''
    20832083        images = []
    20842084        files  = []
     2085
     2086        from worksheet import CODE_PY
    20852087        # The question mark trick here is so that images will be reloaded when
    20862088        # the async request requests the output text for a computation.
    20872089        # This is inspired by http://www.irt.org/script/416.htm/.
    20882090        for F in D:
    2089             if 'cell://%s'%F in out:
     2091            if os.path.split(F)[-1] == CODE_PY or 'cell://%s'%F in out:
    20902092                continue
    20912093            url = os.path.join(self.url_to_self(), F)
    20922094            if F.endswith('.png') or F.endswith('.bmp') or \
  • sagenb/notebook/worksheet.py

    diff --git a/sagenb/notebook/worksheet.py b/sagenb/notebook/worksheet.py
    a b from sagenb.notebook.all import * 
    36393639        return support.get_rightmost_identifier(s)
    36403640
    36413641    def preparse(self, s):
    3642         return 'open("%s","w").write(_support_.preparse_worksheet_cell(base64.b64decode("%s"),globals())); execfile(os.path.abspath("%s"))'%(CODE_PY, base64.b64encode(s), CODE_PY)
     3642        """
     3643        Return preparsed version of input code ``s``, ready to be sent
     3644        to the Sage process for evaluation.  The output is a "safe
     3645        string" (no funny characters).
     3646
     3647        INPUT:
     3648
     3649            - ``s`` -- a string
     3650
     3651        OUTPUT:
     3652
     3653            - a string
     3654        """
     3655        # The extra newline below is necessary, since otherwise source
     3656        # code introspection doesn't include the last line.
     3657        return 'open("%s","w").write(_support_.preparse_worksheet_cell(base64.b64decode("%s"),globals())+"\\n"); execfile(os.path.abspath("%s"))'%(CODE_PY, base64.b64encode(s), CODE_PY)
    36433658
    36443659    ##########################################################
    36453660    # Loading and attaching files