Skip to content

Commit

Permalink
renamed ambiguous single letter variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jsyeo committed Jun 20, 2012
1 parent fd26e4a commit 8a6ebd0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sagenb/notebook/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ def plain_text(self, ncols=0, prompts=True, max_out=None):
"""
if ncols == 0:
ncols = self.word_wrap_cols()
s = u''
plaintext_output = u''

self._in = unicode_str(self._in)

Expand All @@ -1072,25 +1072,25 @@ def plain_text(self, ncols=0, prompts=True, max_out=None):
input_lines = input_lines[1:]

if has_prompt:
s += '\n'.join(input_lines) + '\n'
plaintext_output += '\n'.join(input_lines) + '\n'
else:
in_loop = False
for v in input_lines:
if len(v) == 0:
pass
elif len(v.lstrip()) != len(v): # starts with white space
in_loop = True
s += '... ' + v + '\n'
plaintext_output += '... ' + v + '\n'
elif v[:5] == 'else:':
in_loop = True
s += '... ' + v + '\n'
plaintext_output += '... ' + v + '\n'
else:
if in_loop:
s += '...\n'
plaintext_output += '...\n'
in_loop = False
s += pr + v + '\n'
plaintext_output += pr + v + '\n'
else:
s += self._in
plaintext_output += self._in

if prompts:
msg = TRACEBACK
Expand All @@ -1113,13 +1113,13 @@ def plain_text(self, ncols=0, prompts=True, max_out=None):
out = out[:max_out] + '...'

# Get rid of spurious carriage returns
s = s.strip('\n')
plaintext_output = plaintext_output.strip('\n')
out = out.strip('\n').strip('\r').strip('\r\n')
s = s + '\n' + out
plaintext_output = plaintext_output + '\n' + out

if not prompts:
s = s.rstrip('\n')
return s
plaintext_output = plaintext_output.rstrip('\n')
return plaintext_output

def edit_text(self, ncols=0, prompts=False, max_out=None):
ur"""
Expand Down

0 comments on commit 8a6ebd0

Please sign in to comment.