本文整理汇总了Python中totalimpact.providers.provider.ProviderFactory.get_all_static_meta方法的典型用法代码示例。如果您正苦于以下问题:Python ProviderFactory.get_all_static_meta方法的具体用法?Python ProviderFactory.get_all_static_meta怎么用?Python ProviderFactory.get_all_static_meta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类totalimpact.providers.provider.ProviderFactory
的用法示例。
在下文中一共展示了ProviderFactory.get_all_static_meta方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NotAuthenticatedError
# 需要导入模块: from totalimpact.providers.provider import ProviderFactory [as 别名]
# 或者: from totalimpact.providers.provider.ProviderFactory import get_all_static_meta [as 别名]
from totalimpact import json_sqlalchemy, tiredis
from totalimpact import db
# Master lock to ensure that only a single thread can write
# to the DB at one time to avoid document conflicts
import logging
logger = logging.getLogger('ti.item')
# print out extra debugging
#logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
all_static_meta = ProviderFactory.get_all_static_meta()
class NotAuthenticatedError(Exception):
pass
def delete_item(tiid):
item_object = Item.from_tiid(tiid)
db.session.delete(item_object)
try:
db.session.commit()
except (IntegrityError, FlushError) as e:
db.session.rollback()
logger.warning(u"Fails Integrity check in delete_item for {tiid}, rolling back. Message: {message}".format(
tiid=tiid,
示例2: test_get_all_static_meta
# 需要导入模块: from totalimpact.providers.provider import ProviderFactory [as 别名]
# 或者: from totalimpact.providers.provider.ProviderFactory import get_all_static_meta [as 别名]
def test_get_all_static_meta(self):
sm = ProviderFactory.get_all_static_meta(self.TEST_PROVIDER_CONFIG)
expected = 'The number of citations by papers in PubMed Central'
assert_equals(sm["pubmed:pmc_citations"]["description"], expected)