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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nercone-modern
3
- Version: 1.6.0
3
+ Version: 1.6.1
4
4
  Summary: Modern CLI Library
5
5
  Author: Nercone
6
6
  Author-email: Nercone <nercone@diamondgotcat.net>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "nercone-modern"
7
- version = "1.6.0"
7
+ version = "1.6.1"
8
8
  description = "Modern CLI Library"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  authors = [
@@ -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, end="")
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