mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 11:38:32 +02:00
Tidy up
This commit is contained in:
parent
b61f0daa74
commit
26c79f1377
1 changed files with 4 additions and 7 deletions
|
@ -62,13 +62,10 @@ class TextExporter:
|
||||||
f.write(cls.export_entry(entry))
|
f.write(cls.export_entry(entry))
|
||||||
entry_is_written = True
|
entry_is_written = True
|
||||||
except OSError as oserr:
|
except OSError as oserr:
|
||||||
if oserr.errno == errno.ENAMETOOLONG:
|
title_length = len(str(entry.title))
|
||||||
title_length = len(str(entry.title))
|
if oserr.errno == errno.ENAMETOOLONG and title_length > 1:
|
||||||
if title_length > 1:
|
shorter_file_length = title_length // 2
|
||||||
shorter_file_length = title_length // 2
|
entry.title = str(entry.title)[:shorter_file_length]
|
||||||
entry.title = str(entry.title)[:shorter_file_length]
|
|
||||||
else:
|
|
||||||
raise
|
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
print_msg(
|
print_msg(
|
||||||
|
|
Loading…
Add table
Reference in a new issue