Skip to content
Merged

Lint #106

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
**WARNING**: the development of jpterm continues at https://codeberg.org/davidbrochart/jpterm

[![Build Status](https://github.com/davidbrochart/jpterm/workflows/test/badge.svg)](https://github.com/davidbrochart/jpterm/actions)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
Expand Down
6 changes: 5 additions & 1 deletion jpterm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def main():
decorators = [
click.option("--logo", is_flag=True, default=False, help="Show the jpterm logo."),
click.option("--server", default="", help="The URL to the Jupyter server."),
click.option("--backend", default="asyncio", help="The name of the event loop to use (asyncio or trio)."),
click.option(
"--backend",
default="asyncio",
help="The name of the event loop to use (asyncio or trio).",
),
click.option(
"--collaborative/--no-collaborative",
default=False,
Expand Down
8 changes: 7 additions & 1 deletion plugins/cell/txl_cell/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,13 @@ async def start(self) -> None:

async with create_task_group() as self.tg:

self.cell_factory = _CellFactory(self.tg, contents, widgets, self.show_execution_count, self.show_border)
self.cell_factory = _CellFactory(
self.tg,
contents,
widgets,
self.show_execution_count,
self.show_border,
)
self.put(self.cell_factory, CellFactory)
self.done()
await sleep(float("inf"))
Expand Down
1 change: 0 additions & 1 deletion plugins/editors/txl_editors/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path
from typing import Callable, Dict, List

from anyio import create_task_group
from fps import Module
from textual.containers import Container

Expand Down
2 changes: 1 addition & 1 deletion plugins/image_viewer/txl_image_viewer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from fps import Module
from PIL import Image
from textual._context import active_app
from textual.widget import Widget
from textual.app import App
from textual.widget import Widget
from textual_imageview.viewer import ImageViewer

from txl.base import Contents, Editor, Editors
Expand Down
12 changes: 10 additions & 2 deletions plugins/kernel/txl_kernel/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def send(self, buffers):
buffers=buffers,
)
self.msg_cnt += 1
create_task(self.send_message(msg, self.shell_channel, change_date_to_str=True), self.task_group)
create_task(
self.send_message(msg, self.shell_channel, change_date_to_str=True), self.task_group
)


class KernelMixin:
Expand Down Expand Up @@ -85,7 +87,13 @@ async def recv(self):
if msg_type == "comm_open":
for comm_handler in self.comm_handlers:
comm_id = msg["content"]["comm_id"]
comm = Comm(comm_id, self.shell_channel, self.session_id, self.send_message, self.task_group)
comm = Comm(
comm_id,
self.shell_channel,
self.session_id,
self.send_message,
self.task_group,
)
comm_handler.comm_open(msg, comm)
elif msg_type == "comm_msg":
for comm_handler in self.comm_handlers:
Expand Down
1 change: 0 additions & 1 deletion plugins/local_kernels/txl_local_kernels/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import uuid
from typing import Any, Dict, List, Optional, cast

from anyio import create_task_group, sleep
from anyioutils import Task, create_task
from txl_kernel.driver import KernelMixin

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from functools import partial

from anyio import to_thread
from anyio import create_task_group, to_thread
from anyioutils import Event, Queue
from textual.widget import Widget
from textual.widgets._header import HeaderTitle
Expand Down
2 changes: 1 addition & 1 deletion plugins/markdown_viewer/txl_markdown_viewer/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from anyio import create_task_group, sleep
from anyioutils import create_task
from fps import Module
from textual._context import active_app
from textual.app import App
from textual.containers import Container
from textual.widgets import MarkdownViewer as TextualMarkdownViewer
from textual._context import active_app

from txl.base import Contents, Editor, Editors

Expand Down
4 changes: 3 additions & 1 deletion plugins/remote_kernels/txl_remote_kernels/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def __init__(
url: str,
kernel_name: str | None,
):
self.kernel = KernelDriver(self.task_group, url, kernel_name, comm_handlers=self.comm_handlers)
self.kernel = KernelDriver(
self.task_group, url, kernel_name, comm_handlers=self.comm_handlers
)

async def execute(self, ycell: Map):
await self.kernel.execute(ycell)
Expand Down
2 changes: 1 addition & 1 deletion plugins/text_editor/txl_text_editor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from anyioutils import Queue
from fps import Module
from textual._context import active_app
from textual.containers import Container
from textual.app import App
from textual.containers import Container
from textual.events import Event
from textual.keys import Keys

Expand Down
2 changes: 1 addition & 1 deletion txl/txl/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import anyio
from fps import Module
from fps.cli._cli import main
from textual.app import App
from textual._context import active_app
from textual.app import App

logging.getLogger("httpx").setLevel(logging.CRITICAL)
logging.getLogger("httpcore").setLevel(logging.CRITICAL)
Expand Down
Loading