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


Python MbXmlParser.getRelease方法代码示例

本文整理汇总了Python中musicbrainz2.wsxml.MbXmlParser.getRelease方法的典型用法代码示例。如果您正苦于以下问题:Python MbXmlParser.getRelease方法的具体用法?Python MbXmlParser.getRelease怎么用?Python MbXmlParser.getRelease使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在musicbrainz2.wsxml.MbXmlParser的用法示例。


在下文中一共展示了MbXmlParser.getRelease方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testReleaseFull

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testReleaseFull(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Little_Earthquakes_2.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()

		self.failIf( release is None )
		self.assertEquals(release.getId(),
			makeId('02232360-337e-4a3f-ad20-6cdd4c34288c'))

		self.assertEquals(release.getArtist().getName(), 'Tori Amos')

		events = release.getReleaseEventsAsDict()
		self.assertEquals(len(events), 3)
		self.assertEquals(events['GB'], '1992-01-13')
		self.assertEquals(events['DE'], '1992-01-17')
		self.assertEquals(events['US'], '1992-02-25')

		date = release.getEarliestReleaseDate()
		self.assertEquals(date, '1992-01-13')
		event = release.getEarliestReleaseEvent()
		self.assertEquals(event.date, date)
		self.assertEquals(event.country, 'GB')

		discs = release.getDiscs()
		self.assertEquals(len(discs), 3)
		self.assertEquals(discs[0].getId(), 'ILKp3.bZmvoMO7wSrq1cw7WatfA-')
		self.assertEquals(discs[1].getId(), 'ejdrdtX1ZyvCb0g6vfJejVaLIK8-')
		self.assertEquals(discs[2].getId(), 'Y96eDQZbF4Z26Y5.Sxdbh3wGypo-')

		tracks = release.getTracks()
		self.assertEquals(len(tracks), 12)
		self.assertEquals(tracks[0].getTitle(), 'Crucify')
		self.assertEquals(tracks[4].getTitle(), 'Winter')
开发者ID:bh0085,项目名称:programming,代码行数:35,代码来源:test_wsxml_release.py

示例2: testTags

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testTags(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Highway_61_Revisited_2.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()
		
		self.failIf( release is None )
		self.assertEquals(release.getTag('rock').count, 100)
		self.assertEquals(release.getTag('blues rock').count, 40)
		self.assertEquals(release.getTag('folk rock').count, 40)
		self.assertEquals(release.getTag('dylan').count, 4)
开发者ID:bh0085,项目名称:programming,代码行数:12,代码来源:test_wsxml_release.py

示例3: testIncompleteReleaseEvent

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testIncompleteReleaseEvent(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Under_the_Pink_1.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()

		self.failIf( release is None )
		self.assertEquals(release.getTitle(), 'Under the Pink')

		events = release.getReleaseEvents()
		self.assertEquals(len(events), 1)
		self.assertEquals(events[0].getDate(), '1994-01-28')
开发者ID:bh0085,项目名称:programming,代码行数:13,代码来源:test_wsxml_release.py

示例4: testReleaseGroup

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testReleaseGroup(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Under_the_Pink_2.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()

		self.failIf(release is None)
		self.assertEquals(release.getTitle(), 'Under the Pink')

		releaseGroup = release.getReleaseGroup()
		self.failIf(releaseGroup is None)
		self.assertEquals(releaseGroup.id[-36:],
			'ef2b891f-ca73-3e14-b38b-a68699dab8c4')
		self.assertEquals(releaseGroup.getTitle(), 'Under the Pink')
		self.assertEquals(releaseGroup.getType(), NS_MMD_1 + 'Album')
开发者ID:apotapov,项目名称:musicproject,代码行数:16,代码来源:test_wsxml_release.py

示例5: testReleaseBasic

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testReleaseBasic(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Little_Earthquakes_1.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()

		self.failIf( release is None )
		self.assertEquals(release.getId(),
			makeId('02232360-337e-4a3f-ad20-6cdd4c34288c'))
		self.assertEquals(release.getTitle(), 'Little Earthquakes')
		self.assertEquals(release.getTextLanguage(), 'ENG')
		self.assertEquals(release.getTextScript(), 'Latn')

		self.assertEquals(len(release.getTypes()), 2)
		self.assert_(NS_MMD_1 + 'Album' in release.getTypes())
		self.assert_(NS_MMD_1 + 'Official' in release.getTypes())
开发者ID:bh0085,项目名称:programming,代码行数:17,代码来源:test_wsxml_release.py

示例6: testReleaseRelations

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testReleaseRelations(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Highway_61_Revisited_1.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()

		self.failIf( release is None )
		self.assertEquals(release.getId(),
			makeId('d61a2bd9-81ac-4023-bd22-1c884d4a176c'))

		(rel1, rel2) = release.getRelations(Relation.TO_URL)

		self.assertEquals(rel1.getTargetId(),
			'http://en.wikipedia.org/wiki/Highway_61_Revisited')
		self.assertEquals(rel1.getDirection(), Relation.DIR_NONE)
		self.assertEquals(rel2.getTargetId(),
			'http://www.amazon.com/gp/product/B0000024SI')
开发者ID:bh0085,项目名称:programming,代码行数:18,代码来源:test_wsxml_release.py

示例7: testVariousArtistsRelease

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testVariousArtistsRelease(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Mission_Impossible_2.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()

		self.failIf( release is None )

		artistId = release.getArtist().getId()
		self.assertEquals(artistId, VARIOUS_ARTISTS_ID)

		events = release.getReleaseEventsAsDict()
		self.assertEquals(len(events), 1)
		self.assertEquals(events['EU'], '2000')

		track14 = release.getTracks()[14]
		self.assertEquals(track14.getTitle(), 'Carnival')
		self.assertEquals(track14.getArtist().getName(), 'Tori Amos')
开发者ID:bh0085,项目名称:programming,代码行数:19,代码来源:test_wsxml_release.py

示例8: testReleaseEvents

# 需要导入模块: from musicbrainz2.wsxml import MbXmlParser [as 别名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getRelease [as 别名]
	def testReleaseEvents(self):
		f = os.path.join(VALID_RELEASE_DIR, 'Under_the_Pink_3.xml')
		md = MbXmlParser().parse(f)
		release = md.getRelease()

		self.failIf( release is None )
		self.assertEquals(release.getTitle(), 'Under the Pink')

		events = release.getReleaseEvents()
		self.assertEquals(len(events), 1)
		e1 = events[0]
		self.assertEquals(e1.date, '1994-01-31')
		self.assertEquals(e1.catalogNumber, '82567-2')
		self.assertEquals(e1.barcode, '07567825672')
		self.assertEquals(e1.format, ReleaseEvent.FORMAT_CD)

		self.failIf( e1.label is None )
		self.assertEquals(e1.label.name, 'Atlantic Records')
开发者ID:bh0085,项目名称:programming,代码行数:20,代码来源:test_wsxml_release.py


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