mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 11:38:32 +02:00
clean up linting and format
This commit is contained in:
parent
4b9fe0cd4f
commit
253b80740a
2 changed files with 6 additions and 12 deletions
|
@ -300,7 +300,7 @@ def _print_edited_summary(journal, old_stats, **kwargs):
|
|||
if stats["deleted"] > 0:
|
||||
my_msg = (
|
||||
MsgText.JournalCountDeletedSingular
|
||||
if stats["added"] == 1
|
||||
if stats["deleted"] == 1
|
||||
else MsgText.JournalCountDeletedPlural
|
||||
)
|
||||
msgs.append(Message(my_msg, MsgType.NORMAL, {"num": stats["deleted"]}))
|
||||
|
@ -308,7 +308,7 @@ def _print_edited_summary(journal, old_stats, **kwargs):
|
|||
if stats["modified"] > 0:
|
||||
my_msg = (
|
||||
MsgText.JournalCountModifiedSingular
|
||||
if stats["added"] == 1
|
||||
if stats["modified"] == 1
|
||||
else MsgText.JournalCountModifiedPlural
|
||||
)
|
||||
msgs.append(Message(my_msg, MsgType.NORMAL, {"num": stats["modified"]}))
|
||||
|
|
|
@ -4,18 +4,12 @@
|
|||
import logging
|
||||
import sys
|
||||
import textwrap
|
||||
from typing import Tuple
|
||||
|
||||
from rich import print
|
||||
import rich
|
||||
from rich.panel import Panel
|
||||
from rich.padding import Padding
|
||||
from rich.text import Text
|
||||
from rich.measure import Measurement
|
||||
from rich.console import Group
|
||||
from rich import box
|
||||
|
||||
from jrnl.color import colorize
|
||||
from jrnl.color import RESET_COLOR
|
||||
from jrnl.color import WARNING_COLOR
|
||||
from jrnl.messages import Message
|
||||
|
@ -61,9 +55,9 @@ def print_msgs(msgs: list[Message], delimiter: str = "\n") -> None:
|
|||
kwargs = {
|
||||
"expand": False,
|
||||
"border_style": None,
|
||||
"padding": (0,2),
|
||||
"padding": (0, 2),
|
||||
"title_align": "left",
|
||||
"box": box.HEAVY
|
||||
"box": box.HEAVY,
|
||||
}
|
||||
|
||||
for msg in msgs:
|
||||
|
@ -85,10 +79,10 @@ def print_msgs(msgs: list[Message], delimiter: str = "\n") -> None:
|
|||
def is_keyboard_int(msg: Message) -> bool:
|
||||
return msg.text == MsgText.KeyboardInterruptMsg
|
||||
|
||||
|
||||
def format_msg(msg: Message) -> Text:
|
||||
text = (
|
||||
textwrap.dedent(msg.text.value.format(**msg.params))
|
||||
.strip()
|
||||
textwrap.dedent(msg.text.value.format(**msg.params)).strip()
|
||||
# .splitlines(keepends=True)
|
||||
)
|
||||
result = Text(text)
|
||||
|
|
Loading…
Add table
Reference in a new issue