'Select a template based on whether the template argument
is set or not. If the template argument is not set, it will
interfactively ask user for a template
:param self: A TuiTemplateSelection object
:type self: TuiTemplateSelection
:param template_argument: The template argument which might
have been entered by the user
:type template_argument: str
:param template_manager: A TemplateManager object
:type template_manager: TemplateManager
:return A PhishingTemplate object
:rtype: PhishingTemplagte
:raises  InvalidTemplate in case the template argument entered
by the user is not available.'

def gather_info(self, template_argument, template_manager):

    templates = template_manager.get_templates()
    template_names = list(templates.keys())
    self.get_sections(template_names, templates)
    if (template_argument and (template_argument in templates)):
        return templates[template_argument]
    elif (template_argument and (template_argument not in templates)):
        raise phishingpage.InvalidTemplate
    else:
        template = curses.wrapper(self.display_info, templates, template_names)
    return template
