def retrieve_links(self, values, selection_type):
        try:
            with self._db_instance:
                if selection_type == 'open':

                    selection = self._db_instance.execute('''
                        SELECT url from Links WHERE name = ? AND language = ? 
                    ''', (values['searchpattern'], values['language']))
                    return selection.fetchone()

                else:  # display

                    if selection_type == 'display':
                        selection = self._db_instance.execute('''
                            SELECT name, url, language from Links WHERE name LIKE ?
                        ''', (values['searchpattern'] + '%', ))

                    elif selection_type == 'lang-display':  # lang display
                        selection = self._db_instance.execute('''
                            SELECT name, url from Links WHERE name LIKE ?
                            AND language = ? 
                        ''', (values['searchpattern'] + '%', values['language']))

                    selection_list = selected_rows_to_list(selection)
                    return selection_list

        except sqlite3.Error as error:
            print "A database error has ocurred: ", error
            sys.exit(1)
Retrieves links into Link table.
dataset/ETHPy150Open BastiPaeltz/codedict/source/database.py/Database.retrieve_links