X Tutup
Skip to content

Commit 26eccbd

Browse files
rename 'stuff_a_refresh_request' to request_refresh
1 parent 11cfe84 commit 26eccbd

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

bpython/curtsies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def mainloop(config, locals_, banner, interp=None, paste=None):
5555
with Window(tc, keep_last_line=True, hide_cursor=False) as term:
5656
with Repl(config=config,
5757
locals_=locals_,
58-
stuff_a_refresh_request=tc.stuff_a_refresh_request,
58+
request_refresh=tc.stuff_a_refresh_request,
5959
banner=banner,
6060
interp=interp) as repl:
6161
rows, columns = tc.get_screen_size()

bpython/curtsiesfrontend/interaction.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class StatusBar(BpythonInteraction):
1919
functionality in a evented or callback style, but trying to integrate
2020
bpython.Repl code.
2121
"""
22-
def __init__(self, initial_message='', permanent_text="", stuff_a_refresh_request=lambda: None):
22+
def __init__(self, initial_message='', permanent_text="", refresh_request=lambda: None):
2323
self._current_line = ''
2424
self.cursor_offset_in_line = 0
2525
self.in_prompt = False
@@ -32,7 +32,7 @@ def __init__(self, initial_message='', permanent_text="", stuff_a_refresh_reques
3232
self.permanent_text = permanent_text
3333
self.main_greenlet = greenlet.getcurrent()
3434
self.request_greenlet = None
35-
self.stuff_a_refresh_request = stuff_a_refresh_request
35+
self.refresh_request = refresh_request
3636

3737
@property
3838
def has_focus(self):
@@ -107,7 +107,7 @@ def notify(self, msg, n=3):
107107
self.message_time = n
108108
self.message(msg)
109109
self.waiting_for_refresh = True
110-
self.stuff_a_refresh_request()
110+
self.refresh_request()
111111
self.main_greenlet.switch(msg)
112112

113113
# below Really ought to be called from greenlets other than main because they block

bpython/curtsiesfrontend/repl.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ class Repl(BpythonRepl):
142142
"""
143143

144144
## initialization, cleanup
145-
def __init__(self, locals_=None, config=None, stuff_a_refresh_request=lambda: None, banner=None, interp=None):
145+
def __init__(self, locals_=None, config=None, request_refresh=lambda: None, banner=None, interp=None):
146146
"""
147147
locals_ is a mapping of locals to pass into the interpreter
148148
config is a bpython config.Struct with config attributes
149-
stuff_a_refresh_request is a function that will be called when the Repl
149+
request_refresh is a function that will be called when the Repl
150150
wants to refresh the display, but wants control returned to it afterwards
151151
banner is a string to display briefly in the status bar
152152
interp is an interpreter to use
@@ -173,17 +173,17 @@ def __init__(self, locals_=None, config=None, stuff_a_refresh_request=lambda: No
173173

174174
self.reevaluating = False
175175
self.fake_refresh_requested = False
176-
def request_refresh():
176+
def smarter_request_refresh():
177177
if self.reevaluating or self.paste_mode:
178178
self.fake_refresh_requested = True
179179
else:
180-
stuff_a_refresh_request()
181-
self.stuff_a_refresh_request = request_refresh
180+
request_refresh()
181+
self.request_refresh = smarter_request_refresh
182182

183183
self.status_bar = StatusBar(banner if config.curtsies_fill_terminal else '', _(
184184
" <%s> Rewind <%s> Save <%s> Pastebin <%s> Editor"
185185
) % (config.undo_key, config.save_key, config.pastebin_key, config.external_editor_key),
186-
stuff_a_refresh_request=self.stuff_a_refresh_request
186+
refresh_request=self.request_refresh
187187
)
188188
self.rl_char_sequences = get_updated_char_sequences(key_dispatch, config)
189189
logging.debug("starting parent init")
@@ -920,7 +920,7 @@ def simple_repl():
920920
refreshes = []
921921
def request_refresh():
922922
refreshes.append(1)
923-
with Repl(stuff_a_refresh_request=request_refresh) as r:
923+
with Repl(refresh_request=request_refresh) as r:
924924
r.width = 50
925925
r.height = 10
926926
while True:

0 commit comments

Comments
 (0)
X Tutup