本文整理汇总了Python中oaipmh.client.Client.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Client.__init__方法的具体用法?Python Client.__init__怎么用?Python Client.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oaipmh.client.Client
的用法示例。
在下文中一共展示了Client.__init__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from oaipmh.client import Client [as 别名]
# 或者: from oaipmh.client.Client import __init__ [as 别名]
def __init__(
self, base_url, metadata_registry=None, applicationContext=None, dayGranularity=False, credentials=None
):
Client.__init__(self, base_url, metadata_registry, credentials)
SwissbibPreImportProcessor.__init__(self, applicationContext)
self._day_granularity = dayGranularity
# self.writeContext = writeContext
# was ist hier anders als bei Aleph!
if not self.context.getConfiguration().getIteratorOAIStructure() is None:
self.pIterSingleRecord = re.compile(
self.context.getConfiguration().getIteratorOAIStructure(), re.UNICODE | re.DOTALL | re.IGNORECASE
)
else:
self.pIterSingleRecord = re.compile("<record>.*?</record>", re.UNICODE | re.DOTALL | re.IGNORECASE)
# GH: 16.10.2015 this works for Nebis because we are looking for the outer 'shell' of all <record>...</record> not qualified with additional namespaces.
# we can use this for deleted as well as for full records. Compare example in exampleContentStructures/alma/deletedAndUpdatedRecords.xml
# with Aleph this isn't as easy.. .
# self.pIterSingleRecordNebis = re.compile('<record>.*?</record>',re.UNICODE | re.DOTALL | re.IGNORECASE)
self.pResumptionToken = re.compile(
"<resumptionToken.*?>(.{1,}?)</resumptionToken>", re.UNICODE | re.DOTALL | re.IGNORECASE
)
self.harvestingErrorPattern = re.compile(
"(<error.*?>.*?</error>|<html>.*?HTTP.*?Status.*?4\d\d)", re.UNICODE | re.DOTALL | re.IGNORECASE
)