Skip to content

Commit 33ecf72

Browse files
update TODOs
--HG-- branch : scroll-frontend
1 parent ef7234a commit 33ecf72

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

bpython/curtsies.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def main(args=None, locals_=None, banner=None):
4141
assert options, "don't pass in exec_args without options"
4242
try:
4343
# THIS IS NORMAL PYTHON
44-
#TODO replace this so that stdout is properly harvested for display!
44+
#TODO replace this so that stdout is properly harvested for display and rewind works
4545
bpargs.exec_code(repl.interp, exec_args)
4646
except SystemExit, e:
4747
exit_value = e.args
@@ -69,7 +69,8 @@ def main(args=None, locals_=None, banner=None):
6969
array, cursor_pos = repl.paint()
7070
scrolled = term.render_to_terminal(array, cursor_pos)
7171
repl.scroll_offset += scrolled
72-
# Could calculate this in repl?
72+
# Could this be calculated in the repl, avoiding this
73+
# two-way communication?
7374

7475
if __name__ == '__main__':
7576
sys.exit(main())

bpython/curtsiesfrontend/repl.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
#TODO other autocomplete modes (also fix in other bpython implementations)
4040
#TODO figure out what config.flush_output is
4141
#TODO figure out what options.quiet is
42-
#TODO use events instead of length-one queues for interthread communication
43-
42+
#TODO add buffering to stdout to speed up output.
4443

4544
from bpython.keys import cli_key_dispatch as key_dispatch
4645

@@ -58,7 +57,6 @@ def process_event(self, e):
5857
assert self.has_focus
5958
if e in rl_char_sequences:
6059
self.cursor_offset_in_line, self.current_line = rl_char_sequences[e](self.cursor_offset_in_line, self.current_line)
61-
#TODO EOF on ctrl-d
6260
elif isinstance(e, events.SigIntEvent):
6361
self.coderunner.sigint_happened = True
6462
self.has_focus = False
@@ -285,7 +283,7 @@ def process_event(self, e):
285283
raise NotImplementedError()
286284
elif e in key_dispatch[self.config.show_source_key]: #TODO
287285
raise NotImplementedError()
288-
elif e in key_dispatch[self.config.suspend_key]: #TODO
286+
elif e in key_dispatch[self.config.suspend_key]:
289287
raise SystemExit()
290288
elif e in ("",) + key_dispatch[self.config.exit_key]:
291289
if self._current_line == '':
@@ -500,7 +498,7 @@ def run_code_and_maybe_finish(self, for_code=None):
500498

501499
def keyboard_interrupt(self):
502500
#TODO factor out the common cleanup from running a line
503-
#TODO make rewind work properly with ctrl-c somehow
501+
#TODO make rewind work properly with ctrl-c'd infinite loops
504502
self.cursor_offset_in_line = -1
505503
self.unhighlight_paren()
506504
self.display_lines.extend(self.display_buffer_lines)
@@ -680,10 +678,6 @@ def paint(self, about_to_exit=False):
680678
assert cursor_column >= 0, (cursor_column, len(self.current_cursor_line), len(self._current_line), self.cursor_offset_in_line)
681679

682680
if self.list_win_visible:
683-
#infobox not properly expanding window! try reduce( docs about halfway down a 80x24 terminal
684-
#TODO what's the desired behavior here? Currently uses only the space already on screen,
685-
# scrolling down only if there would have been more space above the current line, but being forced to put below
686-
#TODO above description is not accurate - sometimes screen scrolls for docstring message
687681
logging.debug('infobox display code running')
688682
visible_space_above = history.height
689683
visible_space_below = min_height - cursor_row - 1
@@ -803,10 +797,6 @@ def reprint_line(self, lineno, tokens):
803797
self.display_buffer[lineno] = bpythonparse(format(tokens, self.formatter))
804798
def reevaluate(self, insert_into_history=False):
805799
"""bpython.Repl.undo calls this"""
806-
#TODO This almost works, but stdin.readline() doesn't work yet
807-
#TODO other implementations have a enter no-history method, could do
808-
# that instead of clearing history and getting it rewritten
809-
810800
old_logical_lines = self.history
811801
self.history = []
812802
self.display_lines = []

bpython/curtsiesfrontend/replpainter.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def paint_current_line(rows, columns, current_display_line):
4141

4242
def matches_lines(rows, columns, matches, current, config):
4343
highlight_color = func_for_letter(config.color_scheme['operator'].lower())
44-
#TODO ...that's not really what operator is for
4544

4645
if not matches:
4746
return []
@@ -118,7 +117,6 @@ def formatted_argspec(argspec, columns, config):
118117
s += punctuation_color(', ')
119118
s += token_color('*%s' % (_args,))
120119

121-
#TODO what in the world is this about? Just transcribing from bpython/cli for now
122120
if py3 and kwonly:
123121
if not _args:
124122
if args:

0 commit comments

Comments
 (0)