check if todo data entry exists to prevent errors when writing text (text=None)
This commit is contained in:
parent
578d3d9f1f
commit
2914070d65
@ -159,26 +159,28 @@ class Todoist(inkycal_module):
|
|||||||
if cursor < len(line_positions):
|
if cursor < len(line_positions):
|
||||||
line_x, line_y = line_positions[cursor]
|
line_x, line_y = line_positions[cursor]
|
||||||
|
|
||||||
# Add todos project name
|
if todo['project']:
|
||||||
write(
|
# Add todos project name
|
||||||
im_colour, line_positions[cursor],
|
write(
|
||||||
(project_width, line_height),
|
im_colour, line_positions[cursor],
|
||||||
todo['project'], font=self.font, alignment='left')
|
(project_width, line_height),
|
||||||
|
todo['project'], font=self.font, alignment='left')
|
||||||
|
|
||||||
# Add todos due if not empty
|
# Add todos due if not empty
|
||||||
if todo['due'] != "":
|
if todo['due']:
|
||||||
write(
|
write(
|
||||||
im_black,
|
im_black,
|
||||||
(line_x + project_width, line_y),
|
(line_x + project_width, line_y),
|
||||||
(due_width, line_height),
|
(due_width, line_height),
|
||||||
todo['due'], font=self.font, alignment='left')
|
todo['due'], font=self.font, alignment='left')
|
||||||
|
|
||||||
# Add todos name
|
if todo['name']:
|
||||||
write(
|
# Add todos name
|
||||||
im_black,
|
write(
|
||||||
(line_x + project_width + due_width, line_y),
|
im_black,
|
||||||
(im_width - project_width - due_width, line_height),
|
(line_x + project_width + due_width, line_y),
|
||||||
todo['name'], font=self.font, alignment='left')
|
(im_width - project_width - due_width, line_height),
|
||||||
|
todo['name'], font=self.font, alignment='left')
|
||||||
|
|
||||||
cursor += 1
|
cursor += 1
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user