def submit_form(self):
        """Store new path and trigger its submission."""

        ### try retrieving name from entry and building
        ### path using self.parent as the parent

        try:
            path = self.parent / self.path_name_entry.get()

        except Exception as err:

            # put an error message together explaining
            # the error

            error_message = (
                "An error ocurred while trying to put together"
                " the new path to be returned after exiting this"
                " form's loop."
            )

            # 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 pathlib.Path object is successfully built,
        ### set it as the new path
        else:
            self.new_path = path

        ### trigger form exit by setting special flag to
        ### False
        self.running = False
Store new path and trigger its submission.
nodezator/fileman/dirpanel/newpathform.py