Skip to content

Commit 250f4e2

Browse files
committed
a little more work on the wizard
1 parent 7fec891 commit 250f4e2

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎paths_cli/wizard/joke.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
_MISC = [
1212
"Named after its father, perhaps?",
1313
"Isn't '{name}' also the name of a village in Tuscany?",
14-
"Didn't Johnny Cash write a song about {a_an_thing} called '{name}'?",
14+
"Didn't Johnny Cash write a song about {a_an_thing} named '{name}'?",
1515
"I think I'm going to start rapping as 'DJ {name}'.",
16+
"It would also be a good name for a death metal band.",
1617
]
1718

1819
def _joke1(name, obj_type):
@@ -38,12 +39,12 @@ def name_joke(name, obj_type):
3839
rnd = random.random()
3940
if 0 <= rnd < 0.30:
4041
joke = _joke1
41-
elif 0.30 <= rnd < 0.70:
42+
elif 0.30 <= rnd < 0.60:
4243
joke = _joke2
43-
elif 0.70 <= rnd < 0.85:
44-
joke = _joke4
45-
else:
44+
elif 0.60 <= rnd < 0.75:
4645
joke = _joke3
46+
else:
47+
joke = _joke4
4748
return joke(name, obj_type)
4849

4950
if __name__ == "__main__":

‎paths_cli/wizard/wizard.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ def say(self, content, preface="🧙 "):
7979
self._speak(content, preface)
8080
self.console.print() # adds a blank line
8181

82+
def start(self, content):
83+
# eventually, this will tweak so that we preface with a line and use
84+
# green text here
85+
self.say(content)
86+
8287
def bad_input(self, content, preface="👺 "):
8388
# just changes the default preface; maybe print 1st line red?
8489
self.say(content, preface)
@@ -228,7 +233,7 @@ def run_wizard(self):
228233

229234

230235
TPS_WIZARD = Wizard({
231-
# WIZARD_PAGE_NAME: (store_name, num, exact/at least/at most)
236+
# WIZARD_PAGE_NAME: (store_name, min_num, max_num)
232237
'engines': ('engines', 1, 1),
233238
'cvs': ('cvs', 1, float('inf')),
234239
'states': ('states', 2, float('inf')),

0 commit comments

Comments
 (0)