Add debug option
This commit is contained in:
		@@ -389,9 +389,9 @@ class Squirrel(Hazelnut):
 | 
				
			|||||||
    def add_system_message(self, msg: str) -> None:
 | 
					    def add_system_message(self, msg: str) -> None:
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        Add a new system log message.
 | 
					        Add a new system log message.
 | 
				
			||||||
        TODO: Configure logging levels to ignore some messages.
 | 
					 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        return self.add_message(f"system: *{msg}*" if not self.squinnondation.no_markdown else f"system: {msg}")
 | 
					        if self.squinnondation.debug:
 | 
				
			||||||
 | 
					            return self.add_message(f"system: *{msg}*" if not self.squinnondation.no_markdown else f"system: {msg}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def print_markdown(self, pad: Any, y: int, x: int, msg: str,
 | 
					    def print_markdown(self, pad: Any, y: int, x: int, msg: str,
 | 
				
			||||||
                       bold: bool = False, italic: bool = False, underline: bool = False, strike: bool = False) -> int:
 | 
					                       bold: bool = False, italic: bool = False, underline: bool = False, strike: bool = False) -> int:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@ class Squinnondation:
 | 
				
			|||||||
    bind_port: int
 | 
					    bind_port: int
 | 
				
			||||||
    no_emoji: bool
 | 
					    no_emoji: bool
 | 
				
			||||||
    no_markdown: bool
 | 
					    no_markdown: bool
 | 
				
			||||||
 | 
					    debug: bool
 | 
				
			||||||
    screen: Any
 | 
					    screen: Any
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def parse_arguments(self) -> None:
 | 
					    def parse_arguments(self) -> None:
 | 
				
			||||||
@@ -32,6 +33,7 @@ class Squinnondation:
 | 
				
			|||||||
                            help="Don't replace emojis.")
 | 
					                            help="Don't replace emojis.")
 | 
				
			||||||
        parser.add_argument('--no-markdown', '-nm', action='store_true',
 | 
					        parser.add_argument('--no-markdown', '-nm', action='store_true',
 | 
				
			||||||
                            help="Don't replace emojis.")
 | 
					                            help="Don't replace emojis.")
 | 
				
			||||||
 | 
					        parser.add_argument('--debug', '-d', action='store_true', help="Debug mode.")
 | 
				
			||||||
        self.args = parser.parse_args()
 | 
					        self.args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not (1024 <= self.args.bind_port <= 65535) or\
 | 
					        if not (1024 <= self.args.bind_port <= 65535) or\
 | 
				
			||||||
@@ -42,6 +44,7 @@ class Squinnondation:
 | 
				
			|||||||
        self.bind_port = self.args.bind_port
 | 
					        self.bind_port = self.args.bind_port
 | 
				
			||||||
        self.no_emoji = self.args.no_emoji
 | 
					        self.no_emoji = self.args.no_emoji
 | 
				
			||||||
        self.no_markdown = self.args.no_markdown
 | 
					        self.no_markdown = self.args.no_markdown
 | 
				
			||||||
 | 
					        self.debug = self.args.debug
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def main() -> None:  # pragma: no cover
 | 
					    def main() -> None:  # pragma: no cover
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user