Refactor.
This commit is contained in:
parent
7ec7739055
commit
d4f209bfe9
@ -75,22 +75,21 @@ class Pomodoro(IntervalModule):
|
|||||||
if self.state == RUNNING or self.state == BREAK:
|
if self.state == RUNNING or self.state == BREAK:
|
||||||
min, sec = divmod((self.time - datetime.utcnow()).total_seconds(), 60)
|
min, sec = divmod((self.time - datetime.utcnow()).total_seconds(), 60)
|
||||||
text = '{:02}:{:02}'.format(int(min), int(sec))
|
text = '{:02}:{:02}'.format(int(min), int(sec))
|
||||||
color = self.color_running if self.state == RUNNING else self.color_break
|
sdict = {
|
||||||
else:
|
'time': text,
|
||||||
self.output = {
|
'current_pomodoro': self.breaks + 1,
|
||||||
'full_text': 'Start pomodoro',
|
'total_pomodoro': self.short_break_count + 1,
|
||||||
'color': self.color_stopped
|
|
||||||
}
|
}
|
||||||
return
|
|
||||||
|
|
||||||
sdict = {
|
color = self.color_running if self.state == RUNNING else self.color_break
|
||||||
'time': text,
|
text = self.format.format(**sdict)
|
||||||
'current_pomodoro': self.breaks + 1,
|
else:
|
||||||
'total_pomodoro': self.short_break_count + 1,
|
text = 'Start pomodoro',
|
||||||
}
|
color = self.color_stopped
|
||||||
self.data = sdict
|
|
||||||
|
|
||||||
self.output = {
|
self.output = {
|
||||||
'full_text': self.format.format(**sdict),
|
'full_text': text,
|
||||||
'color': color
|
'color': color
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user