'Convert metadata to multi-line Unicode string and skip datas
with priority lower than specified priority.
Default priority is Metadata.MAX_PRIORITY. If human flag is True, data
key are translated to better human name (eg. "bit_rate" becomes
"Bit rate") which may be translated using gettext.
If priority is too small, metadata are empty and so None is returned.
>>> print RootMetadata().exportPlaintext()
None
>>> meta = RootMetadata()
>>> meta.copyright = unicode("Â© Hachoir", "UTF-8")
>>> print repr(meta.exportPlaintext())
[u\'Metadata:\', u\'- Copyright: \xa9 Hachoir\']
@see __str__() and __unicode__()'

def exportPlaintext(self, priority=None, human=True, line_prefix=u'-    ', title=None):

    if (priority is not None):
        priority = max(priority, MIN_PRIORITY)
        priority = min(priority, MAX_PRIORITY)
    else:
        priority = MAX_PRIORITY
    if (not title):
        title = self.header
    text = [('%s:' % title)]
    for data in sorted(self):
        if (priority < data.priority):
            break
        if (not data.values):
            continue
        if human:
            title = data.description
        else:
            title = data.key
        for item in data.values:
            if human:
                value = item.text
            else:
                value = makeUnicode(item.value)
            text.append(('%s%s:    %s' % (line_prefix, title, value)))
    if (1 < len(text)):
        return text
    else:
        return None
