replbase 0.0.8__tar.gz → 0.0.9__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.8 → replbase-0.0.9}/PKG-INFO +1 -1
- {replbase-0.0.8 → replbase-0.0.9}/pyproject.toml +1 -1
- {replbase-0.0.8 → replbase-0.0.9}/replbase/repl_base.py +8 -0
- {replbase-0.0.8 → replbase-0.0.9}/LICENSE +0 -0
- {replbase-0.0.8 → replbase-0.0.9}/README.md +0 -0
- {replbase-0.0.8 → replbase-0.0.9}/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.9"
|
|
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"
|
|
@@ -204,6 +204,14 @@ class ReplBase:
|
|
|
204
204
|
user_input = self.input(*args)
|
|
205
205
|
return user_input.strip().lower() in true_list
|
|
206
206
|
|
|
207
|
+
def input_prefer_int(self, *args) -> int | str:
|
|
208
|
+
"""Parse input as int if possible, otherwise return the string"""
|
|
209
|
+
|
|
210
|
+
user_input = self.input(*args).strip().split(".")[0].strip()
|
|
211
|
+
if is_num_str(user_input):
|
|
212
|
+
return int(user_input)
|
|
213
|
+
return user_input
|
|
214
|
+
|
|
207
215
|
def debug(self, *args) -> None:
|
|
208
216
|
"""Print only if debug_enabled == True"""
|
|
209
217
|
if self.debug_enabled:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|