Ejemplo n.º 1
0
 def fix_prompt(self) -> str:
     """Fixes the prompt_start configuration variables."""
     if self.validate_prompt():
         return choose_config(self.prompt)
     CONSOLE.print(
         f"[red]Prompt start invalid. {repr(self.prompt)} contains a new"
         "line character. Using default prompt start instead.[/red]")
     return self.default_prompt
Ejemplo n.º 2
0
 def fix_prompt(self) -> str:
     """Fixes the prompt_continuation configuration variables."""
     if self.validate_prompt():
         return choose_config(self.console, self.prompt)
     self.console.print(
         f"[red]Prompt continuation invalid. {repr(self.prompt)} contains a "
         "newline character. Using default prompt continuation instead.[/red]"
     )
     return self.default_prompt
Ejemplo n.º 3
0
 def fix_box_style(self) -> str:
     """Finds and corrects any errors in a given box or list of boxes, then returns a fixed version."""
     if self.validate_box_style():
         return choose_config(self.box_styles)
     return self.default_box
Ejemplo n.º 4
0
 def fix_theme(self) -> str:
     """Finds and corrects any errors in a given theme or list of themes, then returns a fixed version."""
     if self.validate_theme():
         return choose_config(self.console, self.themes)
     return self.default_theme