Create folder if config ends with (back)slash (#1492)

* Check config if FolderJournal and treat as so

* Add test for end of path is slash

* Code format correction

* Requested changes PR 1482

* Add info to doc about path of folder.

* Small addition to doc about folder journal
This commit is contained in:
Jonathan van der Steege 2022-06-04 22:20:51 +02:00 committed by GitHub
parent 1c35c6951d
commit e758986985
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 3 deletions

View file

@ -434,6 +434,10 @@ def open_journal(journal_name, config, legacy=False):
if not config["encrypt"]:
if legacy:
return LegacyJournal(journal_name, **config).open()
if config["journal"].endswith(os.sep):
from . import FolderJournal
return FolderJournal.Folder(journal_name, **config).open()
return PlainJournal(journal_name, **config).open()
from . import EncryptedJournal