This commit is contained in:
Adam Perkins 2024-03-22 21:07:10 -04:00 committed by GitHub
commit 302f033252
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 405 additions and 430 deletions

View file

@ -89,6 +89,7 @@ def get_default_config() -> dict[str, Any]:
"tags": "none", "tags": "none",
"title": "none", "title": "none",
}, },
"output_new_entry": False,
} }

View file

@ -5,6 +5,7 @@ import datetime
import logging import logging
import os import os
import re import re
import sys
from jrnl import time from jrnl import time
from jrnl.config import validate_journal_name from jrnl.config import validate_journal_name
@ -378,6 +379,10 @@ class Journal:
self.entries.append(entry) self.entries.append(entry)
if sort: if sort:
self.sort() self.sort()
if self.config["output_new_entry"]:
sys.stdout.write(entry.pprint())
sys.stdout.write("\n")
return entry return entry
def editable_str(self) -> str: def editable_str(self) -> str:

829
poetry.lock generated

File diff suppressed because it is too large Load diff