mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-02 06:56:12 +02:00
Updated to include the optional output of any new entry to the terminal for consumption by other terminal apps.
This commit is contained in:
parent
2af05e4008
commit
a6d413a2d8
3 changed files with 405 additions and 430 deletions
|
@ -89,6 +89,7 @@ def get_default_config() -> dict[str, Any]:
|
|||
"tags": "none",
|
||||
"title": "none",
|
||||
},
|
||||
"output_new_entry": False,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
829
poetry.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue