diff --git a/jrnl/DayOneJournal.py b/jrnl/DayOneJournal.py index 4cab0b09..9808ed7f 100644 --- a/jrnl/DayOneJournal.py +++ b/jrnl/DayOneJournal.py @@ -57,6 +57,7 @@ class DayOne(Journal.Journal): entry = Entry.Entry(self, date, title, body, starred=dict_entry["Starred"]) entry.uuid = dict_entry["UUID"] entry.tags = [self.config['tagsymbols'][0] + tag for tag in dict_entry.get("Tags", [])] + """Extended DayOne attributes""" try: entry.creator_device_agent = dict_entry['Creator']['Device Agent'] @@ -87,7 +88,6 @@ class DayOne(Journal.Journal): for entry in self.entries: if entry.modified: utc_time = datetime.utcfromtimestamp(time.mktime(entry.date.timetuple())) - filename = os.path.join(self.config['journal'], "entries", entry.uuid.upper() + ".doentry") if not hasattr(entry, "uuid"): entry.uuid = uuid.uuid1().hex @@ -98,9 +98,11 @@ class DayOne(Journal.Journal): if not hasattr(entry, "creator_host_name"): entry.creator_host_name = socket.gethostname() if not hasattr(entry, "creator_os_agent"): - entry.creator_os_agent = '{} {}'.format(platform.system(), platform.release()) + entry.creator_os_agent = '{}/{}'.format(platform.system(), platform.release()) if not hasattr(entry, "creator_software_agent"): - entry.creator_software_agent = '{} {}'.format(__title__, __version__) + entry.creator_software_agent = '{}/{}'.format(__title__, __version__) + + filename = os.path.join(self.config['journal'], "entries", entry.uuid.upper() + ".doentry") entry_plist = { 'Creation Date': utc_time, diff --git a/jrnl/plugins/yaml_exporter.py b/jrnl/plugins/yaml_exporter.py index 8c3475c2..86a1ace7 100644 --- a/jrnl/plugins/yaml_exporter.py +++ b/jrnl/plugins/yaml_exporter.py @@ -68,15 +68,15 @@ class YAMLExporter(TextExporter): hasattr(entry, 'creator_software_agent'): dayone_attributes += 'creator:\n' if hasattr(entry, 'creator_device_agent'): - dayone_attributes += ' device agent: ' + entry.creator_device_agent + '\n' + dayone_attributes += ' device agent: {}\n'.format(entry.creator_device_agent) if hasattr(entry, 'creator_generation_date'): - dayone_attributes += ' generation date: ' + str(entry.creator_generation_date) + '\n' + dayone_attributes += ' generation date: {}\n'.format(str(entry.creator_generation_date)) if hasattr(entry, 'creator_host_name'): - dayone_attributes += ' host name: ' + entry.creator_host_name + '\n' + dayone_attributes += ' host name: {}\n'.format(entry.creator_host_name) if hasattr(entry, 'creator_os_agent'): - dayone_attributes += ' os agent: ' + entry.creator_os_agent + '\n' + dayone_attributes += ' os agent: {}\n'.format(entry.creator_os_agent) if hasattr(entry, 'creator_software_agent'): - dayone_attributes += ' software agent: ' + entry.creator_software_agent + '\n' + dayone_attributes += ' software agent: {}\n'.format(entry.creator_software_agent) return "title: {title}\ndate: {date}\nstared: {stared}\ntags: {tags}\n{dayone} {body} {space}".format( date = date_str,