replbase 0.0.9__tar.gz → 0.0.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {replbase-0.0.9 → replbase-0.0.10}/PKG-INFO +1 -1
- {replbase-0.0.9 → replbase-0.0.10}/pyproject.toml +1 -1
- {replbase-0.0.9 → replbase-0.0.10}/replbase/repl_base.py +8 -0
- {replbase-0.0.9 → replbase-0.0.10}/LICENSE +0 -0
- {replbase-0.0.9 → replbase-0.0.10}/README.md +0 -0
- {replbase-0.0.9 → replbase-0.0.10}/replbase/__init__.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "replbase"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.10"
|
|
8
8
|
description = "\"Combination of other REPL tools into a reusable class that generates a REPL\""
|
|
9
9
|
authors = [ "Joseph Bochinski <stirgejr@gmail.com>",]
|
|
10
10
|
license = "MIT"
|
|
@@ -212,6 +212,14 @@ class ReplBase:
|
|
|
212
212
|
return int(user_input)
|
|
213
213
|
return user_input
|
|
214
214
|
|
|
215
|
+
def input_choice(self, *args, choices: list[str]) -> str:
|
|
216
|
+
"""Prompt for a choice from a list of options"""
|
|
217
|
+
for idx, choice in enumerate(choices):
|
|
218
|
+
self.print(f"[{idx+1}]: {choice}")
|
|
219
|
+
choice = self.input_int(*args)
|
|
220
|
+
if choice and choice > 0 and choice <= len(choices):
|
|
221
|
+
return choices[choice - 1]
|
|
222
|
+
|
|
215
223
|
def debug(self, *args) -> None:
|
|
216
224
|
"""Print only if debug_enabled == True"""
|
|
217
225
|
if self.debug_enabled:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|