def export_textfile(wdict=None, word_pairs=None):

    if wdict is None and word_pairs is None:
        raise EWException('export_textfile: Either the wdict or the word_pairs '
                          'parameter has to be not None')
    elif wdict is not None:
        word_pairs = wdict.wordpair_set.filter(deleted=False)

    result = []
    for wp in word_pairs:
        result.append(
            '%s -- %s <%s %s><%s %s>\n' %
            (wp.word_in_lang1.replace('\n', ' ').replace('\r', ' '),
             wp.word_in_lang2.replace('\n', ' ').replace('\r', ' '),
             str(wp.strength1),
             str(wp.date1),
             str(wp.strength2),
             str(wp.date2)))
        for expl_line in wp.explanation.splitlines():
            if expl_line != '':
                result.append('    ')
                result.append(expl_line)
            result.append('\n')
    return ''.join(result)


##### Logging #####
Prints a dictionary in the old text format.
dataset/ETHPy150Open hcs42/ExponWords/models.py/export_textfile