mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
fix behavior that was confusing pytest
This commit is contained in:
parent
f5e6705e76
commit
c41f4fd2a1
1 changed files with 5 additions and 9 deletions
|
@ -39,22 +39,18 @@ def list_journals(configuration):
|
|||
return result
|
||||
|
||||
|
||||
MessageProps = namedtuple("MessageProps", ["value", "color", "pipe"])
|
||||
MessageProps = namedtuple("MessageProps", ["value", "color"])
|
||||
|
||||
|
||||
class Message(Enum):
|
||||
NORMAL = MessageProps(0, "cyan", sys.stderr)
|
||||
WARNING = MessageProps(1, "yellow", sys.stderr)
|
||||
ERROR = MessageProps(2, "red", sys.stderr)
|
||||
NORMAL = MessageProps(0, "cyan")
|
||||
WARNING = MessageProps(1, "yellow")
|
||||
ERROR = MessageProps(2, "red")
|
||||
|
||||
@property
|
||||
def color(self):
|
||||
return self.value.color
|
||||
|
||||
@property
|
||||
def pipe(self):
|
||||
return self.value.pipe
|
||||
|
||||
|
||||
def print_msg(title: str, body: str = "", msg: Message = Message.NORMAL):
|
||||
|
||||
|
@ -64,4 +60,4 @@ def print_msg(title: str, body: str = "", msg: Message = Message.NORMAL):
|
|||
if body:
|
||||
result += f"\n{body}"
|
||||
|
||||
print(result, file=msg.pipe)
|
||||
print(result, file=sys.stderr)
|
||||
|
|
Loading…
Add table
Reference in a new issue