Skip to content

Conversation

@minchinweb
Copy link
Contributor

This allows DayOne entries to be edited by jrnl.

It includes a basic test (thanks wren! #989) that makes sure this is possible without errors, but there is still no test that shows that the edits are actually being consumed properly (I'm not sure how to add such a test). That said, this has been testing locally, and appears to be working.

Fixes #955. Closes #955. Closes #989.

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have tested this code locally.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have written new tests for these changes, as needed.
  • All tests pass.

@micahellison
Copy link
Member

I'm running this with poetry shell and it looks like it's erasing the title of the entries that it's editing.

Here's a quick test using the dayone.dayone journal in the features/data folder:

> jrnl -1
2013-07-17 11:38 This entry is starred!

> jrnl --edit -1

Then using my editor, I add a line:

# 422BC895507944A291E6FC44FC6B8BFC
[2013-07-17 11:38] This entry is starred! *
I'm adding a line

Then back to the command line, you can see the title disappearing:

> jrnl -1
2013-07-17 11:38 I'm adding a line

@micahellison micahellison mentioned this pull request Jul 4, 2020
6 tasks
@micahellison
Copy link
Member

I added a test for this issue with PR #993.

@minchinweb
Copy link
Contributor Author

@wren @micahellison So I've been messing with this, but I'm a little confused by the Entry class. In particular, it has members/properties text, fulltext, body, and _body, but it seems to me that these basically refer to the same thing. Are either of you familiar in what the differences between these are meant to be?

@wren
Copy link
Member

wren commented Jul 5, 2020

I haven't really done much work on Entry, but looking at it, here's what I see:

  • text is the user input, before it's parsed out to a proper entry
  • body is a property of the entry parsed out out of text (same as title)
  • _body is the class' internal representation of body (like _title and _tags)
  • fulltext looks like a convenience property to get the title and body at the same time, and seems to not really be in use (only by the xml exporter)

@wren
Copy link
Member

wren commented Jul 12, 2020

Merged into #1001

@wren wren closed this Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DayOne] Editing an entry shows AttributeError

3 participants