replbase 0.0.66__tar.gz → 0.0.68__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.66 → replbase-0.0.68}/PKG-INFO +1 -1
- {replbase-0.0.66 → replbase-0.0.68}/pyproject.toml +1 -1
- {replbase-0.0.66 → replbase-0.0.68}/replbase/cmd_meta.py +14 -14
- {replbase-0.0.66 → replbase-0.0.68}/LICENSE +0 -0
- {replbase-0.0.66 → replbase-0.0.68}/README.md +0 -0
- {replbase-0.0.66 → replbase-0.0.68}/replbase/__init__.py +0 -0
- {replbase-0.0.66 → replbase-0.0.68}/replbase/repl_base.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.68"
|
|
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"
|
|
@@ -256,7 +256,7 @@ class CommandMeta:
|
|
|
256
256
|
try:
|
|
257
257
|
arg_type = self.type_hints.get(arg, str)
|
|
258
258
|
|
|
259
|
-
flag_names =
|
|
259
|
+
flag_names = self.flag_names.get(arg)
|
|
260
260
|
|
|
261
261
|
cmd_init = {"help": self.args.get(arg)}
|
|
262
262
|
|
|
@@ -281,10 +281,10 @@ class CommandMeta:
|
|
|
281
281
|
cmd_init["default"] = parm.default
|
|
282
282
|
|
|
283
283
|
if cmd_init:
|
|
284
|
-
repl_cmd.parser.add_argument(flag_names, **cmd_init)
|
|
284
|
+
repl_cmd.parser.add_argument(*flag_names, **cmd_init)
|
|
285
285
|
|
|
286
286
|
else:
|
|
287
|
-
repl_cmd.parser.add_argument(flag_names)
|
|
287
|
+
repl_cmd.parser.add_argument(*flag_names)
|
|
288
288
|
except TypeError as e:
|
|
289
289
|
print(
|
|
290
290
|
f"[ERROR]: {e} for:\n{self.func.__name__}.{arg} with {arg_type} and {parm.default}"
|
|
@@ -317,18 +317,18 @@ class CommandMeta:
|
|
|
317
317
|
return
|
|
318
318
|
|
|
319
319
|
for arg in self.args:
|
|
320
|
-
|
|
320
|
+
flags = [arg]
|
|
321
321
|
if self.is_arg_optional(arg):
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
322
|
+
flags = ["--" + arg.replace("_", "-")]
|
|
323
|
+
char = flags[0]
|
|
324
|
+
if not char.lower() in self.used_flags:
|
|
325
|
+
flags.append(f"-{char.lower()}")
|
|
326
|
+
self.used_flags.add(char.lower())
|
|
327
|
+
elif char.upper() in self.used_flags:
|
|
328
|
+
flags[arg].append(f"-{char.upper()}")
|
|
329
|
+
self.used_flags.add(char.upper())
|
|
330
|
+
|
|
331
|
+
self.flag_names[arg] = [flags]
|
|
332
332
|
|
|
333
333
|
def parse_lines(self) -> None:
|
|
334
334
|
"""Parse the lines of the docstring into the appropriate sections"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|