allow trailing \ for DayOne journals

https://github.com/maebert/jrnl#dayone-integration
sort of infers that it in the .jrnl_config it should end in a /

but prior to this, if there was a trailing / then jrnl thought it was
looking at a text type journal.
This commit is contained in:
Alex Apolloni 2013-04-15 14:05:04 +02:00
parent f79f7cf849
commit 06e664d78a

View file

@ -159,7 +159,10 @@ def cli():
mode_compose, mode_export = guess_mode(args, config) mode_compose, mode_export = guess_mode(args, config)
# open journal file or folder # open journal file or folder
if os.path.isdir(config['journal']) and config['journal'].endswith(".dayone"):
if os.path.isdir(config['journal']) and ( config['journal'].endswith(".dayone") or \
config['journal'].endswith(".dayone/")):
journal = Journal.DayOne(**config) journal = Journal.DayOne(**config)
else: else:
journal = Journal.Journal(**config) journal = Journal.Journal(**config)