@@ -191,8 +191,8 @@ def readline(self, size=-1):
191191 (len (key ) > 1 or unicodedata .category (key ) == 'Cc' )):
192192 continue
193193 sys .stdout .write (key )
194- # Include the \n in the buffer - raw_input() seems to deal with trailing
195- # linebreaks and will break if it gets an empty string.
194+ # Include the \n in the buffer - raw_input() seems to deal with trailing
195+ # linebreaks and will break if it gets an empty string.
196196 buffer += key
197197 finally :
198198 curses .raw (False )
@@ -371,7 +371,7 @@ def bs(self, delete_tabs=True):
371371 self .clear_wrapped_lines ()
372372
373373 if not self .cpos :
374- # I know the nested if blocks look nasty. :(
374+ # I know the nested if blocks look nasty. :(
375375 if self .atbol () and delete_tabs :
376376 n = len (self .s ) % self .config .tab_length
377377 if not n :
@@ -389,11 +389,11 @@ def bs_word(self):
389389 self .rl_history .reset ()
390390 pos = len (self .s ) - self .cpos - 1
391391 deleted = []
392- # First we delete any space to the left of the cursor.
392+ # First we delete any space to the left of the cursor.
393393 while pos >= 0 and self .s [pos ] == ' ' :
394394 deleted .append (self .s [pos ])
395395 pos -= self .bs ()
396- # Then we delete a full word.
396+ # Then we delete a full word.
397397 while pos >= 0 and self .s [pos ] != ' ' :
398398 deleted .append (self .s [pos ])
399399 pos -= self .bs ()
@@ -484,8 +484,8 @@ def cw(self):
484484 left of the cursor"""
485485
486486 if self .cpos :
487- # I don't know if autocomplete should be disabled if the cursor
488- # isn't at the end of the line, but that's what this does for now.
487+ # I don't know if autocomplete should be disabled if the cursor
488+ # isn't at the end of the line, but that's what this does for now.
489489 return
490490
491491 l = len (self .s )
@@ -618,16 +618,16 @@ def get_key(self):
618618 key = key .decode (getpreferredencoding ())
619619 self .scr .nodelay (False )
620620 except UnicodeDecodeError :
621- # Yes, that actually kind of sucks, but I don't see another way to get
622- # input right
621+ # Yes, that actually kind of sucks, but I don't see another way to get
622+ # input right
623623 self .scr .nodelay (True )
624624 except curses .error :
625- # I'm quite annoyed with the ambiguity of this exception handler. I previously
626- # caught "curses.error, x" and accessed x.message and checked that it was "no
627- # input", which seemed a crappy way of doing it. But then I ran it on a
628- # different computer and the exception seems to have entirely different
629- # attributes. So let's hope getkey() doesn't raise any other crazy curses
630- # exceptions. :)
625+ # I'm quite annoyed with the ambiguity of this exception handler. I previously
626+ # caught "curses.error, x" and accessed x.message and checked that it was "no
627+ # input", which seemed a crappy way of doing it. But then I ran it on a
628+ # different computer and the exception seems to have entirely different
629+ # attributes. So let's hope getkey() doesn't raise any other crazy curses
630+ # exceptions. :)
631631 self .scr .nodelay (False )
632632 # XXX What to do here? Raise an exception?
633633 if key :
@@ -1094,8 +1094,8 @@ def repl(self):
10941094 up/down to go back and forth (which has to be separate to the
10951095 evaluation history, which will be truncated when undoing."""
10961096
1097- # Use our own helper function because Python's will use real stdin and
1098- # stdout instead of our wrapped
1097+ # Use our own helper function because Python's will use real stdin and
1098+ # stdout instead of our wrapped
10991099 self .push ('from bpython._internal import _help as help\n ' , False )
11001100
11011101 self .iy , self .ix = self .scr .getyx ()
@@ -1190,8 +1190,8 @@ def reevaluate(self):
11901190 self .stdout_hist += line .encode (getpreferredencoding ()) + '\n '
11911191 self .print_line (line )
11921192 self .s_hist [- 1 ] += self .f_string
1193- # I decided it was easier to just do this manually
1194- # than to make the print_line and history stuff more flexible.
1193+ # I decided it was easier to just do this manually
1194+ # than to make the print_line and history stuff more flexible.
11951195 self .scr .addstr ('\n ' )
11961196 more = self .push (line )
11971197 self .prompt (more )
@@ -1282,7 +1282,7 @@ def lsize():
12821282 return True
12831283
12841284 if items :
1285- # visible items (we'll append until we can't fit any more in)
1285+ # visible items (we'll append until we can't fit any more in)
12861286 v_items = [items [0 ][:max_w - 3 ]]
12871287 lsize ()
12881288 else :
@@ -1355,9 +1355,9 @@ def lsize():
13551355 docstring_string = docstring_string .encode (encoding , 'ignore' )
13561356 self .list_win .addstr ('\n ' + docstring_string ,
13571357 get_colpair (self .config , 'comment' ))
1358- # XXX: After all the trouble I had with sizing the list box (I'm not very good
1359- # at that type of thing) I decided to do this bit of tidying up here just to
1360- # make sure there's no unnececessary blank lines, it makes things look nicer.
1358+ # XXX: After all the trouble I had with sizing the list box (I'm not very good
1359+ # at that type of thing) I decided to do this bit of tidying up here just to
1360+ # make sure there's no unnececessary blank lines, it makes things look nicer.
13611361
13621362 y = self .list_win .getyx ()[0 ]
13631363 self .list_win .resize (y + 2 , w )
@@ -1370,8 +1370,8 @@ def lsize():
13701370 self .scr .cursyncup ()
13711371 self .scr .noutrefresh ()
13721372
1373- # This looks a little odd, but I can't figure a better way to stick the cursor
1374- # back where it belongs (refreshing the window hides the list_win)
1373+ # This looks a little odd, but I can't figure a better way to stick the cursor
1374+ # back where it belongs (refreshing the window hides the list_win)
13751375
13761376 self .scr .move (* self .scr .getyx ())
13771377 self .list_win .refresh ()
@@ -1626,16 +1626,16 @@ def clear(self):
16261626def init_wins (scr , config ):
16271627 """Initialise the two windows (the main repl interface and the little
16281628 status bar at the bottom with some stuff in it)"""
1629- #TODO: Document better what stuff is on the status bar.
1629+ #TODO: Document better what stuff is on the status bar.
16301630
16311631 background = get_colpair (config , 'background' )
16321632 h , w = gethw ()
16331633
16341634 main_win = newwin (background , h - 1 , w , 0 , 0 )
16351635 main_win .scrollok (True )
16361636 main_win .keypad (1 )
1637- # Thanks to Angus Gibson for pointing out this missing line which was causing
1638- # problems that needed dirty hackery to fix. :)
1637+ # Thanks to Angus Gibson for pointing out this missing line which was causing
1638+ # problems that needed dirty hackery to fix. :)
16391639
16401640 statusbar = Statusbar (scr , main_win , background , config ,
16411641 _ (" <%s> Rewind <%s> Save <%s> Pastebin "
@@ -1727,7 +1727,7 @@ def do_resize(caller):
17271727 global DO_RESIZE
17281728 h , w = gethw ()
17291729 if not h :
1730- # Hopefully this shouldn't happen. :)
1730+ # Hopefully this shouldn't happen. :)
17311731 return
17321732
17331733 curses .endwin ()
@@ -1737,7 +1737,7 @@ def do_resize(caller):
17371737 DO_RESIZE = False
17381738
17391739 caller .resize ()
1740- # The list win resizes itself every time it appears so no need to do it here.
1740+ # The list win resizes itself every time it appears so no need to do it here.
17411741
17421742
17431743class FakeDict (object ):
@@ -1882,7 +1882,7 @@ def main(args=None, locals_=None, banner=None):
18821882 sys .stderr = orig_stderr
18831883 sys .stdout = orig_stdout
18841884
1885- # Fake stdout data so everything's still visible after exiting
1885+ # Fake stdout data so everything's still visible after exiting
18861886 if config .flush_output and not options .quiet :
18871887 sys .stdout .write (o )
18881888 sys .stdout .flush ()
0 commit comments