Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 16, 2024
1 parent 19d36f9 commit a26ab32
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion jupyter_ydoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import sys

from ._version import __version__ as __version__
from .ystdin import add_stdin as add_stdin
from .yblob import YBlob as YBlob
from .yfile import YFile as YFile
from .ynotebook import YNotebook as YNotebook
from .ystdin import add_stdin as add_stdin
from .yunicode import YUnicode as YUnicode

# See compatibility note on `group` keyword in
Expand Down
20 changes: 11 additions & 9 deletions jupyter_ydoc/ystdin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ def add_stdin(cell: Map, prompt: str = "", password: bool = False) -> None:
"input": Text
}
"""
stdin = Map({
"output_type": "stdin",
"state": {
"pending": True,
"password": password,
},
"prompt": prompt,
"input": Text(),
})
stdin = Map(
{
"output_type": "stdin",
"state": {
"pending": True,
"password": password,
},
"prompt": prompt,
"input": Text(),
}
)
outputs = cell.get("outputs")
outputs.append(stdin)
12 changes: 7 additions & 5 deletions tests/test_ydocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ def callback(topic, event):

def test_stdin():
ynotebook = YNotebook()
ynotebook.append_cell({
"cell_type": "code",
"source": "",
})
ynotebook.append_cell(
{
"cell_type": "code",
"source": "",
}
)
ycell = ynotebook.ycells[0]
add_stdin(ycell)
cell = ycell.to_py()
Expand All @@ -44,7 +46,7 @@ def test_stdin():
"state": {
"password": False,
"pending": True,
}
},
}
],
"source": "",
Expand Down

0 comments on commit a26ab32

Please sign in to comment.