fix misc linting

This commit is contained in:
Jonathan Wren 2022-05-16 12:05:38 -07:00
parent fcb8b2203e
commit 59e3477043
3 changed files with 7 additions and 9 deletions

View file

@ -17,13 +17,13 @@ class _MsgColor(NamedTuple):
class MsgDecoration(Enum): class MsgDecoration(Enum):
NONE = { NONE = {
"callback": lambda x, **kwargs: x, "callback": lambda x, **_: x,
"args": {} "args": {},
} }
BRACKET = { BRACKET = {
# @todo this should be a more robust function # @todo this should be a more robust function
"callback": lambda x, **kwargs: f"[ {x} ]", "callback": lambda x, **_: f"[ {x} ]",
"args": {} "args": {},
} }
BOX = { BOX = {
"callback": Panel, "callback": Panel,

View file

@ -2,10 +2,8 @@
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging
import sys
import textwrap import textwrap
from rich import print
from rich.text import Text from rich.text import Text
from rich.console import Console from rich.console import Console
@ -45,7 +43,9 @@ def print_msg(msg: Message) -> None:
def print_msgs( def print_msgs(
msgs: list[Message], delimiter: str = "\n", style: MsgStyle = MsgStyle.NORMAL msgs: list[Message],
delimiter: str = "\n",
style: MsgStyle = MsgStyle.NORMAL,
) -> None: ) -> None:
# Same as print_msg, but for a list # Same as print_msg, but for a list
text = Text("") text = Text("")
@ -93,4 +93,3 @@ def is_keyboard_int(msg: Message) -> bool:
def format_msg(msg: Message) -> Text: def format_msg(msg: Message) -> Text:
text = textwrap.dedent(msg.text.value.format(**msg.params)).strip() text = textwrap.dedent(msg.text.value.format(**msg.params)).strip()
return Text(text) return Text(text)

View file

@ -2,7 +2,6 @@
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import getpass import getpass
import sys
from jrnl.messages import Message from jrnl.messages import Message
from jrnl.messages import MsgText from jrnl.messages import MsgText