From 1ac96ae698686c38fcc0b6c40a09eb3ff9807ea0 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Sat, 14 Dec 2019 15:22:12 -0700 Subject: [PATCH] [YAML Exporter] switch to f-strings --- jrnl/plugins/yaml_exporter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jrnl/plugins/yaml_exporter.py b/jrnl/plugins/yaml_exporter.py index 6ef791c7..9ebc1229 100644 --- a/jrnl/plugins/yaml_exporter.py +++ b/jrnl/plugins/yaml_exporter.py @@ -27,7 +27,7 @@ class YAMLExporter(TextExporter): tagsymbols = entry.journal.config['tagsymbols'] # see also Entry.Entry.rag_regex - multi_tag_regex = re.compile(r'(?u)^\s*([{tags}][-+*#/\w]+\s*)+$'.format(tags=tagsymbols)) + multi_tag_regex = re.compile(fr'(?u)^\s*([{tagsymbols}][-+*#/\w]+\s*)+$') """Increase heading levels in body text""" newbody = '' @@ -71,15 +71,15 @@ class YAMLExporter(TextExporter): hasattr(entry, 'creator_software_agent'): dayone_attributes += 'creator:\n' if hasattr(entry, 'creator_device_agent'): - dayone_attributes += ' device agent: {}\n'.format(entry.creator_device_agent) + dayone_attributes += f' device agent: {entry.creator_device_agent}\n' if hasattr(entry, 'creator_generation_date'): dayone_attributes += ' generation date: {}\n'.format(str(entry.creator_generation_date)) if hasattr(entry, 'creator_host_name'): - dayone_attributes += ' host name: {}\n'.format(entry.creator_host_name) + dayone_attributes += f' host name: {entry.creator_host_name}\n' if hasattr(entry, 'creator_os_agent'): - dayone_attributes += ' os agent: {}\n'.format(entry.creator_os_agent) + dayone_attributes += f' os agent: {entry.creator_os_agent}\n' if hasattr(entry, 'creator_software_agent'): - dayone_attributes += ' software agent: {}\n'.format(entry.creator_software_agent) + dayone_attributes += f' software agent: {entry.creator_software_agent}\n' # TODO: copy over pictures, if present # source directory is entry.journal.config['journal']