replbase 0.0.67__tar.gz → 0.0.69__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.67 → replbase-0.0.69}/PKG-INFO +1 -1
- {replbase-0.0.67 → replbase-0.0.69}/pyproject.toml +1 -1
- {replbase-0.0.67 → replbase-0.0.69}/replbase/cmd_meta.py +16 -13
- {replbase-0.0.67 → replbase-0.0.69}/LICENSE +0 -0
- {replbase-0.0.67 → replbase-0.0.69}/README.md +0 -0
- {replbase-0.0.67 → replbase-0.0.69}/replbase/__init__.py +0 -0
- {replbase-0.0.67 → replbase-0.0.69}/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.69"
|
|
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"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import argparse
|
|
4
4
|
import inspect
|
|
5
5
|
import re
|
|
6
|
+
import traceback
|
|
6
7
|
|
|
7
8
|
from collections import defaultdict
|
|
8
9
|
from collections.abc import Callable
|
|
@@ -285,9 +286,11 @@ class CommandMeta:
|
|
|
285
286
|
|
|
286
287
|
else:
|
|
287
288
|
repl_cmd.parser.add_argument(*flag_names)
|
|
288
|
-
except TypeError
|
|
289
|
+
except TypeError:
|
|
290
|
+
err_details = traceback.format_exc()
|
|
291
|
+
|
|
289
292
|
print(
|
|
290
|
-
f"[ERROR]: {
|
|
293
|
+
f"[ERROR]: {err_details} for:\n{self.func.__name__}.{arg} with {arg_type} and {parm.default}"
|
|
291
294
|
)
|
|
292
295
|
|
|
293
296
|
return repl_cmd
|
|
@@ -317,18 +320,18 @@ class CommandMeta:
|
|
|
317
320
|
return
|
|
318
321
|
|
|
319
322
|
for arg in self.args:
|
|
320
|
-
|
|
323
|
+
flags = [arg]
|
|
321
324
|
if self.is_arg_optional(arg):
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
325
|
+
flags = ["--" + arg.replace("_", "-")]
|
|
326
|
+
char = flags[0]
|
|
327
|
+
if not char.lower() in self.used_flags:
|
|
328
|
+
flags.append(f"-{char.lower()}")
|
|
329
|
+
self.used_flags.add(char.lower())
|
|
330
|
+
elif char.upper() in self.used_flags:
|
|
331
|
+
flags[arg].append(f"-{char.upper()}")
|
|
332
|
+
self.used_flags.add(char.upper())
|
|
333
|
+
|
|
334
|
+
self.flag_names[arg] = flags
|
|
332
335
|
|
|
333
336
|
def parse_lines(self) -> None:
|
|
334
337
|
"""Parse the lines of the docstring into the appropriate sections"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|