Skip to content

Commit 6fb06fc

Browse files
committed
Use the pauses, add section splitting line
1 parent ec5c859 commit 6fb06fc

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

paths_cli/wizard/pause.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
PAUSE_STYLES = {
88
'testing': PauseStyle(0.01, 0.03, 0.05),
9-
'default': PauseStyle(0.1, 0.5, 0.5),
9+
'default': PauseStyle(0.1, 0.5, 0.75),
1010
'nopause': PauseStyle(0.0, 0.0, 0.0),
1111
}
1212

@@ -59,7 +59,7 @@ def section(wizard):
5959
"""Section break (pause and possible visual cue).
6060
"""
6161
time.sleep(_PAUSE_STYLE.section)
62-
# TODO: have the wizard draw a line?
62+
wizard.console.draw_hline()
6363

6464

6565
def long(wizard):

paths_cli/wizard/two_state_tps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
SINGLE_ENGINE_STEP, CVS_STEP, WizardStep
55
)
66
from paths_cli.wizard.wizard import Wizard
7+
from paths_cli.wizard import pause
78

89
volumes = get_category_wizard('volume')
910
from paths_cli.wizard.volumes import _FIRST_STATE, _VOL_DESC
@@ -18,6 +19,7 @@ def two_state_tps(wizard, fixed_length=False):
1819
]
1920
initial_state = volumes(wizard, context={'intro': intro})
2021
wizard.register(initial_state, 'initial state', 'states')
22+
pause.section(wizard)
2123
intro = [
2224
"Next let's define your final state.",
2325
_VOL_DESC

paths_cli/wizard/volumes.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88
from paths_cli.wizard.helper import EvalHelperFunc, Helper
99
from paths_cli.wizard.core import interpret_req
1010
import paths_cli.compiling.volumes
11+
from paths_cli.wizard import pause
1112

1213

1314
def _binary_func_volume(wizard, context, op):
14-
wizard.say("Let's make the first constituent volume:")
15+
wizard.say("Let's make the first constituent volume.")
16+
pause.long(wizard)
1517
new_context = volume_set_context(wizard, context, selected=None)
1618
new_context['part'] = 1
1719
vol1 = VOLUMES_PLUGIN(wizard, new_context)
18-
wizard.say("Let's make the second constituent volume:")
20+
pause.section(wizard)
21+
wizard.say("Let's make the second constituent volume.")
22+
pause.long(wizard)
1923
new_context['part'] = 2
2024
vol2 = VOLUMES_PLUGIN(wizard, new_context)
25+
pause.section(wizard)
2126
wizard.say("Now we'll combine those two constituent volumes...")
2227
vol = op(vol1, vol2)
2328
return vol

paths_cli/wizard/wizard.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
from paths_cli.wizard.helper import Helper, QuitWizard
1313
from paths_cli.compiling.tools import custom_eval
1414

15+
from paths_cli.wizard import pause
16+
1517
import shutil
1618

1719
class Console: # no-cov
@@ -26,6 +28,9 @@ def input(self, content):
2628
def width(self):
2729
return shutil.get_terminal_size((80, 24)).columns
2830

31+
def draw_hline(self):
32+
self.print('═' * self.width)
33+
2934
class Wizard:
3035
def __init__(self, steps):
3136
self.steps = steps
@@ -299,6 +304,7 @@ def _do_one(self, step, req):
299304
self.say("Okay, let's try that again.")
300305
return True
301306
self.register(obj, step.display_name, step.store_name)
307+
pause.section(self)
302308
requires_another, allows_another = self._req_do_another(req)
303309
if requires_another:
304310
do_another = True

0 commit comments

Comments
 (0)