def f(title, *authors, **kwargs): doNormalize = kwargs["normalize"] if "normalize" in kwargs else True if doNormalize: authors = u"; ".join( normalize(book_author_about(a, move_surname), preserveAlpha=preserveAlpha) for a in authors if a ) return u"%s:%s (%s)" % (prefix, normalize(move_article(title), preserveAlpha=preserveAlpha), authors) else: authors = u"; ".join(a for a in authors if a) return u"%s:%s (%s)" % (prefix, title, authors)
def normalize_author(author, year, month, day, **kwargs): doNormalize = kwargs['normalize'] if 'normalize' in kwargs else True if year: if month: if day: date = u' (%04d-%02d-%02d)' % (year, month, day) else: date = u' (%04d-%02d)' % (year, month) else: date = u' (%04d)' % (year) else: date = u'' if doNormalize: author = normalize(replacedots(author)) return u'author:%s%s' % (author, date)
def normalize_author(author, year, month, day, **kwargs): doNormalize = kwargs["normalize"] if "normalize" in kwargs else True if year: if month: if day: date = u" (%04d-%02d-%02d)" % (year, month, day) else: date = u" (%04d-%02d)" % (year, month) else: date = u" (%04d)" % (year) else: date = u"" if doNormalize: author = normalize(replacedots(author)) return u"author:%s%s" % (author, date)
def artist(name, **kwargs): """Usage: from aboutag.music import artist print artist((u"John Renbourn") artist:john renbourn print artist(u"Crosby, Stills, Nash & Young") artist:crosby stills nash & young' print artist(u"Motörhead") artist:motörhead' """ if 'convention' in kwargs: assert kwargs['convention'].lower() == u'artist-u' return 'artist:%s' % normalize(name, preserveAlpha=True)