Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28ea475

Browse files
committed
Store window to avoid implicit dependency on blessing/blessed
1 parente987ad3 commit28ea475

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎bpython/curtsies.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(
6161
self.input_generator=curtsies.input.Input(
6262
keynames="curtsies",sigint_event=True,paste_threshold=None
6363
)
64-
self.window=curtsies.window.CursorAwareWindow(
64+
window=curtsies.window.CursorAwareWindow(
6565
sys.stdout,
6666
sys.stdin,
6767
keep_last_line=True,
@@ -92,6 +92,7 @@ def __init__(
9292

9393
super().__init__(
9494
config,
95+
window,
9596
locals_=locals_,
9697
banner=banner,
9798
interp=interp,

‎bpython/curtsiesfrontend/repl.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
)
2525
from .._typing_compatimportLiteral
2626

27-
importblessings
2827
importgreenlet
2928
fromcurtsiesimport (
3029
FSArray,
@@ -37,6 +36,7 @@
3736
)
3837
fromcurtsies.configfile_keynamesimportkeymapaskey_dispatch
3938
fromcurtsies.inputimportis_main_thread
39+
fromcurtsies.windowimportBaseWindow
4040
fromcwcwidthimportwcswidth
4141
frompygmentsimportformataspygformat
4242
frompygments.formattersimportTerminalFormatter
@@ -326,6 +326,7 @@ class BaseRepl(Repl):
326326
def__init__(
327327
self,
328328
config:Config,
329+
window:BaseWindow,
329330
locals_:Optional[Dict[str,Any]]=None,
330331
banner:Optional[str]=None,
331332
interp:Optional[Interp]=None,
@@ -340,6 +341,7 @@ def __init__(
340341
"""
341342

342343
logger.debug("starting init")
344+
self.window=window
343345

344346
# If creating a new interpreter on undo would be unsafe because initial
345347
# state was passed in
@@ -2077,7 +2079,7 @@ def focus_on_subprocess(self, args):
20772079
try:
20782080
signal.signal(signal.SIGWINCH,self.orig_sigwinch_handler)
20792081
withTermmode(self.orig_stdin,self.orig_tcattrs):
2080-
terminal=blessings.Terminal(stream=sys.__stdout__)
2082+
terminal=self.window.t
20812083
withterminal.fullscreen():
20822084
sys.__stdout__.write(terminal.save)
20832085
sys.__stdout__.write(terminal.move(0,0))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp