本文整理汇总了Python中tag.Tag.getTagsAll方法的典型用法代码示例。如果您正苦于以下问题:Python Tag.getTagsAll方法的具体用法?Python Tag.getTagsAll怎么用?Python Tag.getTagsAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tag.Tag
的用法示例。
在下文中一共展示了Tag.getTagsAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from tag import Tag [as 别名]
# 或者: from tag.Tag import getTagsAll [as 别名]
def run(self):
n=0
while True:
if n%100==0:
proxy=getProxy(self.proxyid)
if self.proxyid>0 and proxy is None:
print("No proxy available! Sleeping...")
time.sleep(3600)
continue
try:
httpClient=HttpClient(proxy)
keysv1=conf.getint('default', 'keysv1')
keyv1=conf.get('keyv1', 'key%d' % randrange(keysv1))
dbclientv1=DoubanClient(keyv1, httpClient)
tagClient=Tag(dbclientv1)
colClient=Collection(dbclientv1)
except Exception as e: print(e)
uid=self.queue.get()
print(self.name, 'is processing', uid)
try:
movietags=tagClient.getTagsAll(uid, 'movie')
musictags=tagClient.getTagsAll(uid, 'music')
booktags=tagClient.getTagsAll(uid, 'book')
movies=colClient.getMoviesAll(uid)
books=colClient.getItemsAll(uid, 'book')
music=colClient.getItemsAll(uid, 'music')
dao.saveTC(uid, movietags, musictags, booktags, movies, music, books)
n+=1
except Exception as e: print(uid, e)
self.queue.task_done()