This function generates a list of tours.
    
    The index argument is used to retrieve a particular tour. If None is
    passed, it will return the full list of tours. If instead -1 is given,
    this function will return a test tour

    To add more tours a new variable needs to be created to hold the list of
    dicts and the tours variable at the bottom of this function needs to be
    updated accordingly

def get_tour(index):
    """
    This function generates a list of tours.
    
    The index argument is used to retrieve a particular tour. If None is
    passed, it will return the full list of tours. If instead -1 is given,
    this function will return a test tour

    To add more tours a new variable needs to be created to hold the list of
    dicts and the tours variable at the bottom of this function needs to be
    updated accordingly
    """
    sw = SpyderWidgets
    qtconsole_link = "https://qtconsole.readthedocs.io/en/stable/index.html"

    # This test should serve as example of keys to use in the tour frame dics
    test = [{'title': "Welcome to Spyder introduction tour",
             'content': "<b>Spyder</b> is an interactive development \
                         environment. This tip panel supports rich text. <br>\
                         <br> it also supports image insertion to the right so\
                         far",
             'image': 'tour-spyder-logo.png'},

            {'title': "Widget display",
             'content': ("This show how a widget is displayed. The tip panel "
                         "is adjusted based on the first widget in the list"),
             'widgets': ['button1'],
             'decoration': ['button2'],
             'interact': True},

            {'title': "Widget display",
             'content': ("This show how a widget is displayed. The tip panel "
                         "is adjusted based on the first widget in the list"),
             'widgets': ['button1'],
             'decoration': ['button1'],
             'interact': True},

            {'title': "Widget display",
             'content': ("This show how a widget is displayed. The tip panel "
                         "is adjusted based on the first widget in the list"),
             'widgets': ['button1'],
             'interact': True},

            {'title': "Widget display and highlight",
             'content': "This shows how a highlighted widget looks",
             'widgets': ['button'],
             'decoration': ['button'],
             'interact': False},
            ]

    intro = [{'title': _("Welcome to the Introduction tour"),
              'content': _("<b>Spyder</b> is a powerful Interactive "
                           "Development Environment (or IDE) for the Python "
                           "programming language.<br><br>"
                           "Here we are going to guide you through its most "
                           "important features.<br><br>"
                           "Please use the arrow keys or click on the buttons "
                           "below to move along the tour."),
              'image': 'tour-spyder-logo.png'},

             {'title': _("The Editor"),
              'content': _("This is the pane where you write Python code before "
                           "evaluating it. You can get automatic suggestions "
                           "and completions while writing, by pressing the "
                           "<b>Tab</b> key next to a given text.<br><br>"
                           "The Editor comes "
                           "with a line number area (highlighted here in red), "
                           "where Spyder shows warnings and syntax errors. They "
                           "can help you to detect potential problems before "
                           "running the code.<br><br>"
                           "You can also set debug breakpoints in the line "
                           "number area, by doing a double click next to "
                           "a non-empty line."),
              'widgets': [sw.editor],
              'decoration': [sw.editor_line_number_area]},

             {'title': _("The IPython console"),
              'content': _("This is one of panes where you can run or "
                           "execute the code you wrote on the Editor. To do it "
                           "you need to press the <b>F5</b> key.<br><br>"
                           "This console comes with several "
                           "useful features that greatly improve your "
                           "programming workflow (like syntax highlighting and "
                           "inline plots). If you want to know more about them, "
                           "please follow this <a href=\"{0}\">link</a>.<br><br>"
                           "Please click on the button below to run some simple "
                           "code in this console. This will be useful to show "
                           "you other important features.").format(
                           qtconsole_link),
              'widgets': [sw.ipython_console],
              'run': ["li = list(range(100))", "d = {'a': 1, 'b': 2}"]
              },
              
             {'title': _("The Variable Explorer"),
              'content': _("In this pane you can view and edit the variables "
                           "generated during the execution of a program, or "
                           "those entered directly in one of Spyder "
                           "consoles.<br><br>"
                           "As you can see, the Variable Explorer is showing "
                           "the variables generated during the last step of "
                           "this tour. By doing a double-click on any "
                           "of them, a new window will be opened, where you "
                           "can inspect and modify their contents."),
              'widgets': [sw.variable_explorer],
              'interact': True},

             {'title': _("Help"),
              'content': _("This pane displays documentation of the "
                           "functions, classes, methods or modules you are "
                           "currently using in the Editor or the Consoles.<br><br>"
                           "To use it, you need to press <b>Ctrl+I</b> in "
                           "front of an object. If that object has some "
                           "documentation associated with it, it will be "
                           "displayed here."),
              'widgets': [sw.help_plugin],
              'interact': True},

             {'title': _("The File Explorer"),
              'content': _("This pane lets you navigate through the directories "
                           "and files present in your computer.<br><br>"
                           "You can also open any of these files with its "
                           "corresponding application, by doing a double "
                           "click on it.<br><br>"
                           "There is one exception to this rule: plain-text "
                           "files will always be opened in the Spyder Editor."),
              'widgets': [sw.file_explorer],
              'interact': True},

             {'title': _("The History Log"),
              'content': _("This pane records all commands introduced in "
                           "the Python and IPython consoles."),
              'widgets': [sw.history_log],
              'interact': True},
             ]

#                   ['The run toolbar',
#                       'Should be short',
#                       ['self.run_toolbar'], None],
#                   ['The debug toolbar',
#                       '',
#                       ['self.debug_toolbar'], None],
#                   ['The main toolbar',
#                       '',
#                       ['self.main_toolbar'], None],
#                   ['The editor',
#                       'Spyder has differnet bla bla bla',
#                       ['self.editor.dockwidget'], None],
#                   ['The editor',
#                       'Spyder has differnet bla bla bla',
#                       ['self.outlineexplorer.dockwidget'], None],
#
#                   ['The menu bar',
#                       'Spyder has differnet bla bla bla',
#                       ['self.menuBar()'], None],
#
#                   ['The menu bar',
#                       'Spyder has differnet bla bla bla',
#                       ['self.statusBar()'], None],
#
#
#                   ['The toolbars!',
#                       'Spyder has differnet bla bla bla',
#                       ['self.variableexplorer.dockwidget'], None],
#                   ['The toolbars MO!',
#                       'Spyder has differnet bla bla bla',
#                       ['self.extconsole.dockwidget'], None],
#                   ['The whole window?!',
#                       'Spyder has differnet bla bla bla',
#                       ['self'], None],
#                   ['Lets try something!',
#                       'Spyder has differnet bla bla bla',
#                       ['self.extconsole.dockwidget',
#                        'self.variableexplorer.dockwidget'], None]
#
#                      ]

    feat30 = [{'title': "New features in Spyder 3.0",
               'content': _("<b>Spyder</b> is an interactive development "
                            "environment based on bla"),
               'image': 'spyder.png'},

              {'title': _("Welcome to Spyder introduction tour"),
               'content': _("Spyder is an interactive development environment "
                            "based on bla"),
               'widgets': ['variableexplorer']},
              ]

    tours = [{'name': _('Introduction tour'), 'tour': intro},
             {'name': _('New features in version 3.0'), 'tour': feat30}]

    if index is None:
        return tours
    elif index == -1:
        return [test]
    else:
        return [tours[index]]