'This converts a path to a tag name.'

def _path_to_tagname(self, path):

    parts = self._mailbox_path_split(path)
    parts = [p for p in parts if (not re.match(self.BORING_FOLDER_RE, p))]
    if (not parts):
        return _('Unnamed')
    tagname = self._strip_file_extension(parts.pop((-1)))
    while (tagname[:1] == '.'):
        tagname = tagname[1:]
    return re.sub(self.TAGNAME_STRIP_RE, '', tagname.replace('_', '    '))
