nercone-modern 1.6.0__tar.gz → 1.6.1__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.
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/PKG-INFO +1 -1
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/pyproject.toml +1 -1
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/src/nercone_modern/__main__.py +1 -1
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/src/nercone_modern/logging.py +3 -3
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/README.md +0 -0
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/src/nercone_modern/__init__.py +0 -0
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/src/nercone_modern/color.py +0 -0
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/src/nercone_modern/progressbar.py +0 -0
- {nercone_modern-1.6.0 → nercone_modern-1.6.1}/src/nercone_modern/text.py +0 -0
|
@@ -22,7 +22,7 @@ try:
|
|
|
22
22
|
logger1.log("This is a warning message", "WARNING")
|
|
23
23
|
logger1.log("This is a error message", "ERROR")
|
|
24
24
|
logger1.log("This is a critical error message", "CRITICAL")
|
|
25
|
-
prompt_result = logger1.prompt("Continue demo?", choices=["Y", "n"])
|
|
25
|
+
prompt_result = logger1.prompt("Continue demo?", default="Y", choices=["Y", "n"])
|
|
26
26
|
logger1.log(f"Answer is: {prompt_result}", "INFO")
|
|
27
27
|
if prompt_result == "n":
|
|
28
28
|
print("Exiting demo. See you!")
|
|
@@ -59,11 +59,11 @@ class ModernLogging:
|
|
|
59
59
|
with open(self.filepath, "a") as f:
|
|
60
60
|
f.write(f"{log_line}\n")
|
|
61
61
|
|
|
62
|
-
def prompt(self, message: str = "", level_text: str = "INFO", level_color: str | None = None, ignore_kbdinterrupt: bool = True, default: str | None = None, choices: list[str] | None = None, show_choices: bool = True) -> str:
|
|
62
|
+
def prompt(self, message: str = "", level_text: str = "INFO", level_color: str | None = None, ignore_kbdinterrupt: bool = True, default: str | None = None, show_default: bool = False, choices: list[str] | None = None, show_choices: bool = True) -> str:
|
|
63
63
|
if not is_higher_priority(level_text, self.display_level):
|
|
64
64
|
return
|
|
65
65
|
global _last_process, _last_level
|
|
66
|
-
if default:
|
|
66
|
+
if default and show_default:
|
|
67
67
|
message += f" ({default})"
|
|
68
68
|
if choices and show_choices:
|
|
69
69
|
message += f" [{'/'.join(choices)}]"
|
|
@@ -98,7 +98,7 @@ class ModernLogging:
|
|
|
98
98
|
else:
|
|
99
99
|
while True:
|
|
100
100
|
log_line = self.make(message=f"Invalid selection. Please select from: {'/'.join(choices)}", level_text=level_text, level_color=level_color)
|
|
101
|
-
print(log_line
|
|
101
|
+
print(log_line)
|
|
102
102
|
if self.filepath:
|
|
103
103
|
with open(self.filepath, "a") as f:
|
|
104
104
|
f.write(f"{log_line}{answer}\n")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|