Replace if in then ... else ... with .get()
This commit is contained in:
parent
6b487bbe81
commit
6292f4b3f0
@ -80,8 +80,7 @@ class Taskwarrior(IntervalModule):
|
|||||||
|
|
||||||
if self.next_task is not None:
|
if self.next_task is not None:
|
||||||
format_values['next'] = self.next_task['description']
|
format_values['next'] = self.next_task['description']
|
||||||
format_values['project'] = (self.next_task['project'] if 'project' in self.next_task
|
format_values['project'] = self.next_task.get('project', '')
|
||||||
else '')
|
|
||||||
|
|
||||||
self.output = {
|
self.output = {
|
||||||
'full_text': self.format.format(**format_values),
|
'full_text': self.format.format(**format_values),
|
||||||
|
Loading…
Reference in New Issue
Block a user