def do_edit(self, args: argparse.Namespace) -> None:
        """Edit a file in a text editor"""
        if not self.editor:
            raise EnvironmentError("Please use 'set editor' to specify your text editing program of choice.")

        command = utils.quote_string_if_needed(os.path.expanduser(self.editor))
        if args.file_path:
            command += " " + utils.quote_string_if_needed(os.path.expanduser(args.file_path))

        self.do_shell(command)
def do_edit ( self , args : argparse . Namespace ) -> None : if not self . editor : raise EnvironmentError ( "Please use 'set editor' to specify your text editing program of choice." ) command = utils . quote_string_if_needed ( os . path . expanduser ( self . editor ) ) if args . file_path : command += " " + utils . quote_string_if_needed ( os . path . expanduser ( args . file_path ) ) self . do_shell ( command )
Edit a file in a text editor