def present_new_path_form(self, is_file):
        """Present form to create a new file or folder.

        Parameters
        ==========
        is_file (boolean)
            whether path being created must be a file or
            a folder.
        """
        ### present form to user by using get_path,
        ### passing the current directory and whether the
        ### new path is supposed to be a file or not;
        ### store the form data once you leave the form
        path = get_path(self.current_dir, is_file)

        ### if the path is None, it means the user
        ### cancelled the action, so return now to prevent
        ### any action from happening
        if path is None:
            return

        ### otherwise we proceed with creation of path

        ## pick path creation operation according to
        ## kind of path chosen
        creation_operation = Path.touch if is_file else Path.mkdir

        ## try creating path ('exist_ok' set to False
        ## causes an error to be raised if path already
        ## exists)
        try:
            creation_operation(path, exist_ok=False)

        ## report error message if error occurs

        except Exception as err:

            # pick name for kind of path depending on
            # is_file argument
            path_kind = "file" if is_file else "folder"

            # put an error message together explaining
            # the error

            error_message = (
                f"An error prevented the {path_kind} from being created."
            )

            # log the error

            logger.exception(error_message)
            USER_LOGGER.exception(error_message)

            # present the dialog

            dialog_message = error_message + (
                " Check the user log for details (press <Ctrl+Shift+j> after"
                " leaving the file browser or access the \"Help > Show user"
                " log\" option on the menubar)."
            )

            create_and_show_dialog(dialog_message, level_name='error')

        ## if the path is created, though, just reload
        ## the current directory, then jump to the path,
        ## leaving it selected

        else:

            self.load_current_dir_contents()
            self.jump_to_path(path)
Present form to create a new file or folder.

        Parameters
        ==========
        is_file (boolean)
            whether path being created must be a file or
            a folder.
        
nodezator/fileman/dirpanel/main.py