Skip to content

Commit c9eeeb2

Browse files
dependency name change fmtstr -> curtsies
--HG-- branch : scroll-frontend rename : bpython/scroll.py => bpython/curtsies.py rename : bpython/scrollfrontend/__init__.py => bpython/curtsiesfrontend/__init__.py rename : bpython/scrollfrontend/coderunner.py => bpython/curtsiesfrontend/coderunner.py rename : bpython/scrollfrontend/friendly.py => bpython/curtsiesfrontend/friendly.py rename : bpython/scrollfrontend/interaction.py => bpython/curtsiesfrontend/interaction.py rename : bpython/scrollfrontend/manual_readline.py => bpython/curtsiesfrontend/manual_readline.py rename : bpython/scrollfrontend/repl.py => bpython/curtsiesfrontend/repl.py rename : bpython/scrollfrontend/replpainter.py => bpython/curtsiesfrontend/replpainter.py rename : bpython/scrollfrontend/sitefix.py => bpython/curtsiesfrontend/sitefix.py rename : data/bpython-scroll => data/bpython-curtsies
1 parent 98ab118 commit c9eeeb2

File tree

11 files changed

+42
-32
lines changed

11 files changed

+42
-32
lines changed
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
from __future__ import absolute_import
2+
13
import sys
24
from optparse import Option
35

4-
from fmtstr.terminal import Terminal
5-
from fmtstr.terminalcontrol import TerminalController
6+
import curtsies
7+
import curtsies.window
8+
import curtsies.terminal
9+
Window = curtsies.window.Window
10+
Terminal = curtsies.terminal.Terminal
611

7-
from bpython.scrollfrontend.repl import Repl
8-
from bpython.scrollfrontend.coderunner import SystemExitFromCodeThread
12+
from bpython.curtsiesfrontend.repl import Repl
13+
from bpython.curtsiesfrontend.coderunner import SystemExitFromCodeThread
914
from bpython import args as bpargs
1015
from bpython.translations import _
1116

@@ -19,8 +24,10 @@ def main(args=None, locals_=None, banner=None):
1924
import logging
2025
logging.basicConfig(filename='scroll.log', level=logging.DEBUG)
2126

22-
with TerminalController() as tc:
23-
with Terminal(tc, keep_last_line=True, hide_cursor=False) as term:
27+
# do parsing before doing any frontend stuff
28+
with Terminal() as tc:
29+
with Window(tc, keep_last_line=True, hide_cursor=False) as term:
30+
#TODO why need to make repl first
2431
with Repl(config=config,
2532
locals_=locals_,
2633
stuff_a_refresh_request=tc.stuff_a_refresh_request,
@@ -33,6 +40,7 @@ def main(args=None, locals_=None, banner=None):
3340
if exec_args:
3441
assert options, "don't pass in exec_args without options"
3542
try:
43+
# THIS IS NORMAL PYTHON
3644
#TODO replace this so that stdout is properly harvested for display!
3745
bpargs.exec_code(repl.interp, exec_args)
3846
except SystemExit, e:
@@ -49,6 +57,7 @@ def main(args=None, locals_=None, banner=None):
4957
try:
5058
repl.process_event(tc.get_event())
5159
except SystemExitFromCodeThread:
60+
#Get rid of nasty constant
5261
array, cursor_pos = repl.paint(about_to_exit=2)
5362
term.render_to_terminal(array, cursor_pos)
5463
raise
@@ -60,6 +69,7 @@ def main(args=None, locals_=None, banner=None):
6069
array, cursor_pos = repl.paint()
6170
scrolled = term.render_to_terminal(array, cursor_pos)
6271
repl.scroll_offset += scrolled
72+
# Could calculate this in repl?
6373

6474
if __name__ == '__main__':
6575
sys.exit(main())
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def run_code(self, for_code=None):
7474
signal.signal(signal.SIGINT, self.orig_sigint_handler)
7575
self.orig_sigint_handler = None
7676
return request
77-
elif request in ['SystemExit']:
77+
elif request in ['SystemExit']: #use the object?
7878
self._unload_code()
7979
raise SystemExitFromCodeThread()
8080
else:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from bpython.repl import Interaction as BpythonInteraction
55

6-
from bpython.scrollfrontend.manual_readline import char_sequences as rl_char_sequences
6+
from bpython.curtsiesfrontend.manual_readline import char_sequences as rl_char_sequences
77

88
class StatusBar(BpythonInteraction):
99
"""StatusBar and Interaction for Repl

bpython/scrollfrontend/manual_readline.py renamed to bpython/curtsiesfrontend/manual_readline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
and the cursor location
55
in the order of description at http://www.bigsmoke.us/readline/shortcuts"""
66

7-
from bpython.scrollfrontend.friendly import NotImplementedError
7+
from bpython.curtsiesfrontend.friendly import NotImplementedError
88
import re
99
char_sequences = {}
1010

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
from bpython.translations import _
1919
from bpython._py3compat import py3
2020

21-
from fmtstr.fsarray import FSArray
22-
from fmtstr.fmtstr import fmtstr, FmtStr
23-
from fmtstr.bpythonparse import parse as bpythonparse
24-
from fmtstr.bpythonparse import func_for_letter, color_for_letter
25-
26-
from bpython.scrollfrontend.manual_readline import char_sequences as rl_char_sequences
27-
from bpython.scrollfrontend.manual_readline import get_updated_char_sequences
28-
from bpython.scrollfrontend.interaction import StatusBar
29-
from bpython.scrollfrontend import sitefix; sitefix.monkeypatch_quit()
30-
import bpython.scrollfrontend.replpainter as paint
31-
import fmtstr.events as events
32-
from bpython.scrollfrontend.friendly import NotImplementedError
33-
from bpython.scrollfrontend.coderunner import CodeRunner, FakeOutput
21+
from curtsies.fsarray import FSArray
22+
from curtsies.fmtstr import fmtstr, FmtStr
23+
from curtsies.bpythonparse import parse as bpythonparse
24+
from curtsies.bpythonparse import func_for_letter, color_for_letter
25+
26+
from bpython.curtsiesfrontend.manual_readline import char_sequences as rl_char_sequences
27+
from bpython.curtsiesfrontend.manual_readline import get_updated_char_sequences
28+
from bpython.curtsiesfrontend.interaction import StatusBar
29+
from bpython.curtsiesfrontend import sitefix; sitefix.monkeypatch_quit()
30+
import bpython.curtsiesfrontend.replpainter as paint
31+
import curtsies.events as events
32+
from bpython.curtsiesfrontend.friendly import NotImplementedError
33+
from bpython.curtsiesfrontend.coderunner import CodeRunner, FakeOutput
3434

3535
#TODO implement paste mode and figure out what the deal with config.paste_time is
3636
#TODO figure out how config.auto_display_list=False behaves and implement it
@@ -217,7 +217,7 @@ def clean_up_current_line_for_exit(self):
217217
def process_event(self, e):
218218
"""Returns True if shutting down, otherwise mutates state of Repl object"""
219219
# event names uses here are curses compatible, or the full names
220-
# for a full list of what should have pretty names, see fmtstr.events.CURSES_TABLE
220+
# for a full list of what should have pretty names, see curtsies.events.CURSES_TABLE
221221

222222
if not isinstance(e, events.Event):
223223
self.last_events.append(e)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22
import logging
33

4-
from fmtstr.fmtfuncs import bold
5-
from fmtstr.fsarray import fsarray
6-
from fmtstr.bpythonparse import func_for_letter
7-
from fmtstr.fmtstr import fmtstr, linesplit
4+
from curtsies.fmtfuncs import bold
5+
from curtsies.fsarray import fsarray
6+
from curtsies.bpythonparse import func_for_letter
7+
from curtsies.fmtstr import fmtstr, linesplit
88

99
from bpython._py3compat import py3
1010
if not py3:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

33
import sys
4-
from bpython.scroll import main
4+
from bpython.curtsies import main
55

66
sys.exit(main())

0 commit comments

Comments
 (0)