当前位置: 首页>>代码示例>>Python>>正文


Python Query.getReleaseGroups方法代码示例

本文整理汇总了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
开发者ID:apotapov,项目名称:musicproject,代码行数:33,代码来源:findreleasegroup.py


注:本文中的musicbrainz2.webservice.Query.getReleaseGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。