本文整理汇总了Python中models.Album.remoteId方法的典型用法代码示例。如果您正苦于以下问题:Python Album.remoteId方法的具体用法?Python Album.remoteId怎么用?Python Album.remoteId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Album
的用法示例。
在下文中一共展示了Album.remoteId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createAlbums
# 需要导入模块: from models import Album [as 别名]
# 或者: from models.Album import remoteId [as 别名]
def createAlbums(self, albumMappings, remoteAlbums):
""" Creates Albums from the data in albumMappings
and finds the remote ids from a list of remoteAlbums
based on the remote album name. """
self.logger.info("Remote albums: " )
remoteAlbumNames = [a["name"] for a in remoteAlbums]
self.logger.info(remoteAlbumNames)
albums = []
for m in albumMappings:
remoteName = m["remoteName"]
localPath = path.join(self.albumsPath, m["localName"])
album = Album(localPath, remoteName,
self.settings.backupDirName)
for a in remoteAlbums:
if remoteName == a["name"]:
album.remoteId = a["id"]
break
albums.append(album)
return albums