mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 05:26:13 +02:00
Add support for folder base journal.
Adds feature for issue #170 (and #398) where you configure your journal to be a directory and entries are added as sub-directories and files: yyyy/mm/dd.txt. Multiple entries in a day will go in the same file, but a new entry for a specific day will create a new file (and directory structure). Fix failed test scenarios for folder journal.
This commit is contained in:
parent
a3afa112ab
commit
a3c81d46fe
5 changed files with 138 additions and 5 deletions
|
@ -269,6 +269,15 @@ def check_journal_entries(context, number, journal_name="default"):
|
|||
journal = open_journal(journal_name)
|
||||
assert len(journal.entries) == number
|
||||
|
||||
@when('the journal directory is listed')
|
||||
def list_journal_directory(context, journal="default"):
|
||||
files=[]
|
||||
with open(install.CONFIG_FILE_PATH) as config_file:
|
||||
config = yaml.load(config_file, Loader=yaml.FullLoader)
|
||||
journal_path = config['journals'][journal]
|
||||
for root, dirnames, f in os.walk(journal_path):
|
||||
for file in f:
|
||||
print(os.path.join(root,file))
|
||||
|
||||
@then("fail")
|
||||
def debug_fail(context):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue