本文整理匯總了Python中editing.MusicBrainzClient.edit_artist方法的典型用法代碼示例。如果您正苦於以下問題:Python MusicBrainzClient.edit_artist方法的具體用法?Python MusicBrainzClient.edit_artist怎麽用?Python MusicBrainzClient.edit_artist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類editing.MusicBrainzClient
的用法示例。
在下文中一共展示了MusicBrainzClient.edit_artist方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: determine_begin_date
# 需要導入模塊: from editing import MusicBrainzClient [as 別名]
# 或者: from editing.MusicBrainzClient import edit_artist [as 別名]
if not artist['begin_date_year'] and not artist['end_date_year']:
begin_date, begin_date_reasons = determine_begin_date(artist, page, is_performance_name)
if begin_date['year']:
out(" * new begin date", begin_date)
artist['begin_date_year'] = begin_date['year']
artist['begin_date_month'] = begin_date['month']
artist['begin_date_day'] = begin_date['day']
update.add('begin_date')
reasons.append(('BEGIN DATE', begin_date_reasons))
end_date, end_date_reasons = determine_end_date(artist, page, is_performance_name)
if end_date['year']:
out(" * new end date", end_date)
artist['end_date_year'] = end_date['year']
artist['end_date_month'] = end_date['month']
artist['end_date_day'] = end_date['day']
update.add('end_date')
reasons.append(('END DATE', end_date_reasons))
if update:
edit_note = 'From %s' % (artist['url'],)
for field, reason in reasons:
edit_note += '\n\n%s:\n%s' % (field, ' '.join(reason))
out(' * edit note:', edit_note.replace('\n', ' '))
time.sleep(60 * 2)
mb.edit_artist(artist, update, edit_note)
db.execute("INSERT INTO bot_wp_artist_data (gid) VALUES (%s)", (artist['gid'],))
print