Pep8 formatting
This commit is contained in:
parent
c64e759b5a
commit
9a83f7117e
@ -11,6 +11,7 @@ from i3pystatus import IntervalModule
|
|||||||
|
|
||||||
|
|
||||||
class Pomodoro(IntervalModule):
|
class Pomodoro(IntervalModule):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This plugin shows Pomodoro timer.
|
This plugin shows Pomodoro timer.
|
||||||
|
|
||||||
@ -19,8 +20,10 @@ class Pomodoro(IntervalModule):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
settings = (
|
settings = (
|
||||||
('sound', 'Path to sound file to play as alarm. Played by "aplay" utility'),
|
('sound',
|
||||||
('pomodoro_duration', 'Working (pomodoro) interval duration in seconds'),
|
'Path to sound file to play as alarm. Played by "aplay" utility'),
|
||||||
|
('pomodoro_duration',
|
||||||
|
'Working (pomodoro) interval duration in seconds'),
|
||||||
('break_duration', 'Short break duration in secods'),
|
('break_duration', 'Short break duration in secods'),
|
||||||
('long_break_duration', 'Long break duration in secods'),
|
('long_break_duration', 'Long break duration in secods'),
|
||||||
('short_break_count', 'Short break count before first long break'),
|
('short_break_count', 'Short break count before first long break'),
|
||||||
@ -47,15 +50,18 @@ class Pomodoro(IntervalModule):
|
|||||||
if self.state == 'running':
|
if self.state == 'running':
|
||||||
self.state = 'break'
|
self.state = 'break'
|
||||||
if self.breaks == self.short_break_count:
|
if self.breaks == self.short_break_count:
|
||||||
self.time = datetime.now() + timedelta(seconds=self.long_break_duration)
|
self.time = datetime.now() + \
|
||||||
|
timedelta(seconds=self.long_break_duration)
|
||||||
self.breaks = 0
|
self.breaks = 0
|
||||||
else:
|
else:
|
||||||
self.time = datetime.now() + timedelta(seconds=self.break_duration)
|
self.time = datetime.now() + \
|
||||||
|
timedelta(seconds=self.break_duration)
|
||||||
text = 'Go for a break!'
|
text = 'Go for a break!'
|
||||||
self.breaks += 1
|
self.breaks += 1
|
||||||
else:
|
else:
|
||||||
self.state = 'running'
|
self.state = 'running'
|
||||||
self.time = datetime.now() + timedelta(seconds=self.pomodoro_duration)
|
self.time = datetime.now() + \
|
||||||
|
timedelta(seconds=self.pomodoro_duration)
|
||||||
text = 'Back to work!'
|
text = 'Back to work!'
|
||||||
self._alarm(text)
|
self._alarm(text)
|
||||||
|
|
||||||
@ -87,4 +93,3 @@ class Pomodoro(IntervalModule):
|
|||||||
subprocess.Popen(['aplay',
|
subprocess.Popen(['aplay',
|
||||||
self.sound,
|
self.sound,
|
||||||
'-q'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
'-q'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user