本文整理汇总了Python中song.Song.song_with_root方法的典型用法代码示例。如果您正苦于以下问题:Python Song.song_with_root方法的具体用法?Python Song.song_with_root怎么用?Python Song.song_with_root使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类song.Song
的用法示例。
在下文中一共展示了Song.song_with_root方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_all_possible_song_locations_set
# 需要导入模块: from song import Song [as 别名]
# 或者: from song.Song import song_with_root [as 别名]
def _get_all_possible_song_locations_set(playlist_location, roots):
all_songs = set()
with open(playlist_location) as playlist:
for song in playlist:
song_entity = Song(song.strip(), roots)
for root in roots:
all_songs.add(Song.song_with_root(song_entity, root))
return all_songs
示例2: test_song_with_root_simple
# 需要导入模块: from song import Song [as 别名]
# 或者: from song.Song import song_with_root [as 别名]
def test_song_with_root_simple(self):
song_path = "./_Done_/Belle_and_Sebastian/The Boy with the Arab Strap/06_Belle & Sebastian_Seymour Stein.mp3"
simple_song = Song(song_path, ['.', './_Done_'])
song_path_with_new_root = Song.song_with_root(simple_song, '/<microSD>/MUSIC')
expected_song_path = '/<microSD>/MUSIC/Belle_and_Sebastian/The Boy with the Arab Strap/06_Belle & Sebastian_Seymour Stein.mp3'
self.assertEquals(expected_song_path, song_path_with_new_root)