当前位置: 首页>>代码示例>>Python>>正文


Python Client.__init__方法代码示例

本文整理汇总了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
        )
开发者ID:swissbib,项目名称:contentCollector,代码行数:29,代码来源:swissbibOAIClient.py


注:本文中的oaipmh.client.Client.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。