@@ -177,7 +177,7 @@ def cat_decorator(func):
177177
178178
179179def with_argument_list (func : Callable [[Statement ], Optional [bool ]],
180- preserve_quotes : bool = False ) -> Callable [[List ], Optional [bool ]]:
180+ preserve_quotes : bool = False ) -> Callable [[List ], Optional [bool ]]:
181181 """A decorator to alter the arguments passed to a do_* cmd2 method. Default passes a string of whatever the user
182182 typed. With this decorator, the decorated method will receive a list of arguments parsed from user input using
183183 shlex.split().
@@ -197,7 +197,7 @@ def cmd_wrapper(self, cmdline):
197197 return cmd_wrapper
198198
199199
200- def with_argparser_and_unknown_args (argparser : argparse .ArgumentParser , preserve_quotes : bool = False ) -> \
200+ def with_argparser_and_unknown_args (argparser : argparse .ArgumentParser , preserve_quotes : bool = False ) -> \
201201 Callable [[argparse .Namespace , List ], Optional [bool ]]:
202202 """A decorator to alter a cmd2 method to populate its ``args`` argument by parsing arguments with the given
203203 instance of argparse.ArgumentParser, but also returning unknown args as a list.
@@ -240,7 +240,7 @@ def cmd_wrapper(instance, cmdline):
240240
241241
242242def with_argparser (argparser : argparse .ArgumentParser ,
243- preserve_quotes : bool = False ) -> Callable [[argparse .Namespace ], Optional [bool ]]:
243+ preserve_quotes : bool = False ) -> Callable [[argparse .Namespace ], Optional [bool ]]:
244244 """A decorator to alter a cmd2 method to populate its ``args`` argument by parsing arguments
245245 with the given instance of argparse.ArgumentParser.
246246
@@ -342,9 +342,9 @@ class Cmd(cmd.Cmd):
342342 'quiet' : "Don't print nonessential feedback" ,
343343 'timing' : 'Report execution times' }
344344
345- def __init__ (self , completekey : str = 'tab' , stdin = None , stdout = None , persistent_history_file : str = '' ,
346- persistent_history_length : int = 1000 , startup_script : Optional [str ]= None , use_ipython : bool = False ,
347- transcript_files : Optional [List [str ]]= None ) -> None :
345+ def __init__ (self , completekey : str = 'tab' , stdin = None , stdout = None , persistent_history_file : str = '' ,
346+ persistent_history_length : int = 1000 , startup_script : Optional [str ] = None , use_ipython : bool = False ,
347+ transcript_files : Optional [List [str ]] = None ) -> None :
348348 """An easy but powerful framework for writing line-oriented command interpreters, extends Python's cmd package.
349349
350350 :param completekey: (optional) readline name of a completion key, default to Tab
@@ -562,7 +562,7 @@ def decolorized_write(self, fileobj: IO, msg: str) -> None:
562562 msg = utils .strip_ansi (msg )
563563 fileobj .write (msg )
564564
565- def poutput (self , msg : Any , end : str = '\n ' , color : str = '' ) -> None :
565+ def poutput (self , msg : Any , end : str = '\n ' , color : str = '' ) -> None :
566566 """Smarter self.stdout.write(); color aware and adds newline of not present.
567567
568568 Also handles BrokenPipeError exceptions for when a commands's output has
@@ -590,8 +590,8 @@ def poutput(self, msg: Any, end: str='\n', color: str='') -> None:
590590 if self .broken_pipe_warning :
591591 sys .stderr .write (self .broken_pipe_warning )
592592
593- def perror (self , err : Union [str , Exception ], traceback_war : bool = True , err_color : str = Fore .LIGHTRED_EX ,
594- war_color : str = Fore .LIGHTYELLOW_EX ) -> None :
593+ def perror (self , err : Union [str , Exception ], traceback_war : bool = True , err_color : str = Fore .LIGHTRED_EX ,
594+ war_color : str = Fore .LIGHTYELLOW_EX ) -> None :
595595 """ Print error message to sys.stderr and if debug is true, print an exception Traceback if one exists.
596596
597597 :param err: an Exception or error message to print out
@@ -624,7 +624,7 @@ def pfeedback(self, msg: str) -> None:
624624 else :
625625 self .decolorized_write (sys .stderr , "{}\n " .format (msg ))
626626
627- def ppaged (self , msg : str , end : str = '\n ' , chop : bool = False ) -> None :
627+ def ppaged (self , msg : str , end : str = '\n ' , chop : bool = False ) -> None :
628628 """Print output using a pager if it would go off screen and stdout isn't currently being redirected.
629629
630630 Never uses a pager inside of a script (Python or text) or when output is being redirected or piped or when
@@ -906,7 +906,7 @@ def delimiter_complete(self, text: str, line: str, begidx: int, endidx: int, mat
906906
907907 def flag_based_complete (self , text : str , line : str , begidx : int , endidx : int ,
908908 flag_dict : Dict [str , Union [Iterable , Callable ]],
909- all_else : Union [None , Iterable , Callable ]= None ) -> List [str ]:
909+ all_else : Union [None , Iterable , Callable ] = None ) -> List [str ]:
910910 """
911911 Tab completes based on a particular flag preceding the token being completed
912912 :param text: the string prefix we are attempting to match (all returned matches must begin with it)
@@ -1161,7 +1161,7 @@ def get_exes_in_path(starts_with: str) -> List[str]:
11611161 return list (exes_set )
11621162
11631163 def shell_cmd_complete (self , text : str , line : str , begidx : int , endidx : int ,
1164- complete_blank : bool = False ) -> List [str ]:
1164+ complete_blank : bool = False ) -> List [str ]:
11651165 """Performs completion of executables either in a user's path or a given path
11661166 :param text: the string prefix we are attempting to match (all returned matches must begin with it)
11671167 :param line: the current input line with leading whitespace removed
@@ -2587,7 +2587,7 @@ def do_help(self, args: argparse.Namespace) -> None:
25872587 # No special behavior needed, delegate to cmd base class do_help()
25882588 super ().do_help (args .command )
25892589
2590- def _help_menu (self , verbose : bool = False ) -> None :
2590+ def _help_menu (self , verbose : bool = False ) -> None :
25912591 """Show a list of commands which help can be displayed for.
25922592 """
25932593 # Get a sorted list of help topics
@@ -2730,7 +2730,8 @@ def do_quit(self, _: argparse.Namespace) -> bool:
27302730 self ._should_quit = True
27312731 return self ._STOP_AND_EXIT
27322732
2733- def select (self , opts : Union [str , List [str ], List [Tuple [Any , Optional [str ]]]], prompt : str = 'Your choice? ' ) -> str :
2733+ def select (self , opts : Union [str , List [str ], List [Tuple [Any , Optional [str ]]]],
2734+ prompt : str = 'Your choice? ' ) -> str :
27342735 """Presents a numbered menu to the user. Modeled after
27352736 the bash shell's SELECT. Returns the item chosen.
27362737
@@ -2786,7 +2787,7 @@ def cmdenvironment(self) -> str:
27862787 Output redirection and pipes allowed: {}"""
27872788 return read_only_settings .format (str (self .terminators ), self .allow_cli_args , self .allow_redirection )
27882789
2789- def show (self , args : argparse .Namespace , parameter : str = '' ) -> None :
2790+ def show (self , args : argparse .Namespace , parameter : str = '' ) -> None :
27902791 """Shows current settings of parameters.
27912792
27922793 :param args: argparse parsed arguments from the set command
@@ -3604,7 +3605,7 @@ def set_window_title(self, title: str) -> None: # pragma: no cover
36043605 else :
36053606 raise RuntimeError ("another thread holds terminal_lock" )
36063607
3607- def cmdloop (self , intro : Optional [str ]= None ) -> None :
3608+ def cmdloop (self , intro : Optional [str ] = None ) -> None :
36083609 """This is an outer wrapper around _cmdloop() which deals with extra features provided by cmd2.
36093610
36103611 _cmdloop() provides the main loop equivalent to cmd.cmdloop(). This is a wrapper around that which deals with
0 commit comments