Skip to content

Commit

Permalink
Added prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Drarig29 committed Jun 5, 2021
1 parent 06f4764 commit cfbe274
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions google_keep_tasks/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def edit_note_checkboxes(note):
for item in note.items:
if item.id not in [parts['id'] for parts in current_items]:
item.delete()
print('Deleted "%s"' % item.text)

last_added = None
for parts in current_items:
Expand All @@ -149,23 +150,30 @@ def edit_note_checkboxes(note):
if parts['indented']:
previous.indent(added)
last_added = added
print('Added "%s"' % parts['content'])

# Modification
else:
updated = False
if parts['old'].indented and not parts['indented']:
if previous != None:
previous.dedent(parts['old'])
updated = True
if not parts['old'].indented and parts['indented']:
if previous != None:
previous.indent(parts['old'])

updated = True
if parts['old'].checked and not parts['checked']:
parts['old'].checked = False
updated = True
if not parts['old'].checked and parts['checked']:
parts['old'].checked = True

updated = True
if parts['old'].text != parts['content']:
parts['old'].text = parts['content']
updated = True
if updated:
print('Updated "%s"' % parts['content'])


def get_note_instance(keep, id=None, **kwargs):
Expand Down

0 comments on commit cfbe274

Please sign in to comment.