Updated to include the optional output of any new entry to the terminal for consumption by other terminal apps.

This commit is contained in:
Adam Perkins 2024-03-22 20:49:36 -04:00
parent 2af05e4008
commit a6d413a2d8
3 changed files with 405 additions and 430 deletions

View file

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

View file

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

829
poetry.lock generated

File diff suppressed because it is too large Load diff