Skip to content

Commit ab89794

Browse files
Fix typo and consolidate curtsies.py
1 parent cf5f8d7 commit ab89794

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

bpython/curtsies.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,6 @@ def after_suspend():
107107
after_suspend=after_suspend) as repl:
108108
repl.height, repl.width = window.t.height, window.t.width
109109

110-
if interactive:
111-
# Add custom help command
112-
# TODO: add methods to run the code
113-
repl.coderunner.interp.locals['_repl'] = repl
114-
115-
repl.coderunner.interp.runsource(
116-
'from bpython.curtsiesfrontend._internal import _Helper')
117-
repl.coderunner.interp.runsource('help = _Helper(_repl)\n')
118-
119-
del repl.coderunner.interp.locals['_repl']
120-
del repl.coderunner.interp.locals['_Helper']
121-
122110
def process_event(e):
123111
"""If None is passed in, just paint the screen"""
124112
try:
@@ -134,8 +122,19 @@ def process_event(e):
134122
scrolled = window.render_to_terminal(array, cursor_pos)
135123
repl.scroll_offset += scrolled
136124

137-
# run startup file
138125
if interactive:
126+
# Add custom help command
127+
# TODO: add methods to run the code
128+
repl.coderunner.interp.locals['_repl'] = repl
129+
130+
repl.coderunner.interp.runsource(
131+
'from bpython.curtsiesfrontend._internal import _Helper')
132+
repl.coderunner.interp.runsource('help = _Helper(_repl)\n')
133+
134+
del repl.coderunner.interp.locals['_repl']
135+
del repl.coderunner.interp.locals['_Helper']
136+
137+
# run startup file
139138
process_event(bpythonevents.RunStartupFileEvent())
140139

141140
# handle paste

bpython/curtsiesfrontend/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ def __repr__(self):
3636
(self.who, self.when - time.time()))
3737

3838
class RunStartupFileEvent(curtsies.events.Event):
39-
"""Reqeust to run the startup file."""
39+
"""Request to run the startup file."""

0 commit comments

Comments
 (0)