def _tasklines_from_tasks(tasks):
    """
    Parse a set of tasks (e.g. taskdict.tasks.values()) into tasklines
    suitable to be written to a file.
    """
    tasklines = []
    for task in tasks:
        metapairs = [metapair for metapair in task.items()
                     if metapair[0] != 'text']
        meta_str = "; ".join("{}:{}".format(*metapair)
                             for metapair in metapairs)
        tasklines.append('{} | {}\n'.format(task['text'], meta_str))
    return tasklines