Allow Start to restart a finished Sud from the beginning
start() only allowed a fresh run from IDLE, so once a brew reached DONE, clicking Start again (the GUI correctly re-enables it once not running) was silently a no-op. DONE now restarts the same way IDLE does.
This commit is contained in:
+4
-3
@@ -140,13 +140,14 @@ class Sud(AttributeChange):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
"""Starts a fresh run from IDLE, or resumes a paused one - whichever
|
"""Starts a fresh run from IDLE or DONE (i.e. restarts from the
|
||||||
applies. No-op otherwise."""
|
beginning once a previous run has finished), or resumes a paused
|
||||||
|
one - whichever applies. No-op otherwise."""
|
||||||
if self.state == SudState.PAUSED:
|
if self.state == SudState.PAUSED:
|
||||||
self.state = self._paused_from
|
self.state = self._paused_from
|
||||||
self._paused_from = None
|
self._paused_from = None
|
||||||
return
|
return
|
||||||
if self.state != SudState.IDLE:
|
if self.state not in (SudState.IDLE, SudState.DONE):
|
||||||
return
|
return
|
||||||
self.index = -1
|
self.index = -1
|
||||||
self._advance()
|
self._advance()
|
||||||
|
|||||||
Reference in New Issue
Block a user