本文整理汇总了Python中User.add_credentials方法的典型用法代码示例。如果您正苦于以下问题:Python User.add_credentials方法的具体用法?Python User.add_credentials怎么用?Python User.add_credentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.add_credentials方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import User [as 别名]
# 或者: from User import add_credentials [as 别名]
class Hermes:
def __init__(self, username):
self.setup_paths(username)
self.user = User(self, username)
self.player = Player()
# def __del__(self):
# print "**Hermes dtor"
def setup_paths(self, username):
Settings.add_path_dir("data", "hermes-userdata")
Settings.add_path_dir("user", username, "data")
Settings.add_path_file("profile", username, "user")
Settings.add_path_file("library", username+"_db", "user")
def add_account(self, j_item):
self.user.add_account(j_item)
self.user.add_credentials(j_item)
def search(self, tail):
return self.user.library.search(tail)
def search_album(self, album):
return self.user.library.search_album(album)
def search_artist(self, artist):
return self.user.library.search_artist(artist)
def get_stream_URL(self, location, song_id):
return self.user.get_stream_URL(location, song_id)
def get_watched(self):
return self.user.get_watched()
def add_watched(self, directory):
return self.user.add_watched(directory)
def remove_watched(self, directory):
self.user.remove_watched(directory)
def sync(self):
print "Syncing"
self.user.sync()
print "Done"
def syncStream(self):
self.user.sync_stream()
all_rows = self.user.library_get('streamid', ['artist', 'album', 'title', 'tracknum', 'art', 'location'], 'location', ['artist', 'album', 'tracknum'], 'S', False, 'stream')
return all_rows
def create_playlist(self, playlist_name):
self.user.create_playlist(playlist_name)
def quit(self):
self.user.quit()