本文整理汇总了Python中comicvinecacher.ComicVineCacher.get_volume_info方法的典型用法代码示例。如果您正苦于以下问题:Python ComicVineCacher.get_volume_info方法的具体用法?Python ComicVineCacher.get_volume_info怎么用?Python ComicVineCacher.get_volume_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comicvinecacher.ComicVineCacher
的用法示例。
在下文中一共展示了ComicVineCacher.get_volume_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetchVolumeData
# 需要导入模块: from comicvinecacher import ComicVineCacher [as 别名]
# 或者: from comicvinecacher.ComicVineCacher import get_volume_info [as 别名]
def fetchVolumeData( self, series_id ):
# before we search online, look in our cache, since we might already
# have this info
cvc = ComicVineCacher( )
cached_volume_result = cvc.get_volume_info( series_id )
if cached_volume_result is not None:
return cached_volume_result
volume_url = self.api_base_url + "/volume/" + CVTypeID.Volume + "-" + str(series_id) + "/?api_key=" + self.api_key + "&field_list=name,id,start_year,publisher,count_of_issues&format=json"
content = self.getUrlContent(volume_url)
cv_response = json.loads(content)
if cv_response[ 'status_code' ] != 1:
print >> sys.stderr, "Comic Vine query failed with error: [{0}]. ".format( cv_response[ 'error' ] )
return None
volume_results = cv_response['results']
cvc.add_volume_info( volume_results )
return volume_results
示例2: fetchVolumeData
# 需要导入模块: from comicvinecacher import ComicVineCacher [as 别名]
# 或者: from comicvinecacher.ComicVineCacher import get_volume_info [as 别名]
def fetchVolumeData( self, series_id ):
# before we search online, look in our cache, since we might already
# have this info
cvc = ComicVineCacher( )
cached_volume_result = cvc.get_volume_info( series_id )
if cached_volume_result is not None:
return cached_volume_result
volume_url = self.api_base_url + "/volume/" + CVTypeID.Volume + "-" + str(series_id) + "/?api_key=" + self.api_key + "&field_list=name,id,start_year,publisher,count_of_issues&format=json"
cv_response = self.getCVContent(volume_url)
volume_results = cv_response['results']
cvc.add_volume_info( volume_results )
return volume_results