本文整理汇总了Python中lollypop.objects.Track.set_uri方法的典型用法代码示例。如果您正苦于以下问题:Python Track.set_uri方法的具体用法?Python Track.set_uri怎么用?Python Track.set_uri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lollypop.objects.Track
的用法示例。
在下文中一共展示了Track.set_uri方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_external
# 需要导入模块: from lollypop.objects import Track [as 别名]
# 或者: from lollypop.objects.Track import set_uri [as 别名]
def load_external(self, uri, name=''):
"""
Load external tracks
@param uri as str
@param name as string
"""
track = Track()
track.set_album_artists([name])
track.set_uri(uri)
if track.uri.startswith('file://'):
track.id = Type.EXTERNALS
track.name = GLib.path_get_basename(GLib.filename_from_uri(uri)[0])
else:
track.name = uri
track.id = Type.RADIOS
self._external_tracks.append(track)
示例2: load_external
# 需要导入模块: from lollypop.objects import Track [as 别名]
# 或者: from lollypop.objects.Track import set_uri [as 别名]
def load_external(self, uri, name=''):
"""
Load external tracks
@param uri as str
@param name as string
"""
try:
uri = GLib.filename_to_uri(uri)
except:
pass
track = Track()
track.set_album_artists([name])
track.set_uri(uri)
if track.uri.startswith('file://'):
track.id = Type.EXTERNALS
else:
track.id = Type.RADIOS
self._external_tracks.append(track)