本文整理匯總了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
)