Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook: issue with indentation of first line being wrong #7648

Closed
williamstein opened this issue Dec 10, 2009 · 7 comments
Closed

notebook: issue with indentation of first line being wrong #7648

williamstein opened this issue Dec 10, 2009 · 7 comments

Comments

@williamstein
Copy link
Contributor

On 11/27/2009 05:47 AM, Minh Nguyen wrote:
> On Fri, Nov 27, 2009 at 9:10 PM, Yotam Avital <> wrote:
>> for i in range (1,5):
>>     print '%6s %6s %6s'%(i, i^2, i^3)

I think *part* of the problem could be line 294 of sagenb.interfaces.expect:

       s = s.strip().rstrip(self._prompt)


Replacing this with

       s = s.rstrip(self._prompt)

appears to restore the expected spacing.  But quitting and reopening the
worksheet puts

1      1      1
    2      4      8
    3      9     27
    4     16     64

in the output cell.  I think the problem here is line 910 (or so) of
sagenb.notebook.cell:

           out = '///\n' + out.strip()


Replacing this with

           out = '///\n' + out.strip('\n')

seems to solve this problem.  It also makes the text representation of
the worksheet more compact.

Note: I haven't tested these changes extensively.

Component: notebook

Author: Mitesh Patel

Reviewer: Tim Dumol

Merged: sagenb-0.6

Issue created by migration from https://trac.sagemath.org/ticket/7648

@qed777
Copy link
Mannequin

qed777 mannequin commented Dec 10, 2009

Attachment: trac_7648-missing_indent.patch.gz

Make the changes in the ticket description. sagenb repo.

@qed777
Copy link
Mannequin

qed777 mannequin commented Dec 10, 2009

Author: Mitesh Patel

@qed777
Copy link
Mannequin

qed777 mannequin commented Dec 10, 2009

comment:1

The Se tests pass. Unfortunately, sage -t sagenb/notebook yields several

A mysterious error (perhaps a memory error?) occurred, which may have crashed doctest.

Please see #7650.

@qed777 qed777 mannequin added the s: needs review label Dec 10, 2009
@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 15, 2010

comment:2

The patch for #7663 (and #7924) clashes with this one. Reconciling them should be easy.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 17, 2010

comment:3

Good job.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

Reviewer: Tim Dumol

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

Merged: sagenb-0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant