本文整理汇总了Python中musicbrainz2.webservice.Query.getReleaseGroups方法的典型用法代码示例。如果您正苦于以下问题:Python Query.getReleaseGroups方法的具体用法?Python Query.getReleaseGroups怎么用?Python Query.getReleaseGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类musicbrainz2.webservice.Query
的用法示例。
在下文中一共展示了Query.getReleaseGroups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from musicbrainz2.webservice import Query [as 别名]
# 或者: from musicbrainz2.webservice.Query import getReleaseGroups [as 别名]
logger.setLevel(logging.DEBUG)
if len(sys.argv) < 2:
print "Usage: findreleasegroup.py 'release group name/Lucene query'"
sys.exit(1)
q = Query()
try:
# Search for all release groups matching the given query. Limit the results
# to the 5 best matches. The offset parameter could be used to page
# through the results.
#
f = ReleaseGroupFilter(query=sys.argv[1], limit=5)
results = q.getReleaseGroups(f)
except WebServiceError, e:
print 'Error:', e
sys.exit(1)
# No error occurred, so display the results of the search. It consists of
# ReleaseGroupResult objects, where each contains an artist.
#
for result in results:
releaseGroup = result.releaseGroup
print "Score\t\t :", result.score
print "Id :", releaseGroup.id
print "Name :", releaseGroup.title
print "Artist :", releaseGroup.artist.name
print "Type :", releaseGroup.type