mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
fix misc linting
This commit is contained in:
parent
fcb8b2203e
commit
59e3477043
3 changed files with 7 additions and 9 deletions
|
@ -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,
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue