def __init__(self, _db, api_key=None, do_get=None, metadata_client=None): self._db = _db self.api_key = api_key self.do_get = do_get or Representation.simple_http_get if not metadata_client: metadata_client = MetadataWranglerOPDSLookup.from_config(self._db) self.metadata_client = metadata_client
def __init__(self, collection, upload_client=None, **kwargs): _db = Session.object_session(collection) self.upload_client = upload_client or MetadataWranglerOPDSLookup.from_config( _db, collection=collection) super(MetadataUploadCoverageProvider, self).__init__(collection, **kwargs) if not self.upload_client.authenticated: raise CannotLoadConfiguration( "Authentication for the Library Simplified Metadata Wrangler " "is not set up. You can't upload metadata without authenticating." )
def __init__(self, collection, lookup_client=None, **kwargs): _db = Session.object_session(collection) lookup_client = lookup_client or MetadataWranglerOPDSLookup.from_config( _db, collection=collection) super(MetadataWranglerCoverageProvider, self).__init__(collection, lookup_client, **kwargs) if not self.lookup_client.authenticated: self.log.warn( "Authentication for the Library Simplified Metadata Wrangler " "is not set up. You can still use the metadata wrangler, but " "it will not know which collection you're asking about.")
def __init__(self, _db, collection, lookup=None): super(MetadataWranglerCollectionMonitor, self).__init__( _db, collection ) self.lookup = lookup or MetadataWranglerOPDSLookup.from_config( self._db, collection=collection ) self.importer = OPDSImporter( self._db, self.collection, data_source_name=DataSource.METADATA_WRANGLER, metadata_client=self.lookup, map_from_collection=True, )
def __init__(self, _db, collection, lookup=None): super(MetadataWranglerCollectionMonitor, self).__init__(_db, collection) self.lookup = lookup or MetadataWranglerOPDSLookup.from_config( self._db, collection=collection) self.importer = OPDSImporter( self._db, self.collection, data_source_name=DataSource.METADATA_WRANGLER, metadata_client=self.lookup, map_from_collection=True, )
def __init__(self, _db, api_key=None, do_get=None, metadata_client=None): self.log = logging.getLogger("NYT API") self._db = _db if not api_key: raise CannotLoadConfiguration("No NYT API key is specified") self.api_key = api_key self.do_get = do_get or Representation.simple_http_get if not metadata_client: try: metadata_client = MetadataWranglerOPDSLookup.from_config( self._db) except CannotLoadConfiguration, e: self.log.error( "Metadata wrangler integration is not configured, proceeding without one." )
def __init__(self, collection, lookup_client=None, **kwargs): """Since we are processing a specific collection, we must be able to get an _authenticated_ metadata wrangler lookup client for the collection. """ _db = Session.object_session(collection) lookup_client = lookup_client or MetadataWranglerOPDSLookup.from_config( _db, collection=collection) super(BaseMetadataWranglerCoverageProvider, self).__init__(collection, lookup_client, **kwargs) if not self.lookup_client.authenticated: raise CannotLoadConfiguration( "Authentication for the Library Simplified Metadata Wrangler " "is not set up. Without this, there is no way to register " "your identifiers with the metadata wrangler.")
def __init__(self, _db, api_key=None, do_get=None, metadata_client=None): self.log = logging.getLogger("NYT API") self._db = _db if not api_key: raise CannotLoadConfiguration("No NYT API key is specified") self.api_key = api_key self.do_get = do_get or Representation.simple_http_get if not metadata_client: try: metadata_client = MetadataWranglerOPDSLookup.from_config( self._db ) except CannotLoadConfiguration, e: self.log.error( "Metadata wrangler integration is not configured, proceeding without one." )
def __init__(self, collection, lookup_client=None, **kwargs): """Since we are processing a specific collection, we must be able to get an _authenticated_ metadata wrangler lookup client for the collection. """ _db = Session.object_session(collection) lookup_client = lookup_client or MetadataWranglerOPDSLookup.from_config( _db, collection=collection ) super(BaseMetadataWranglerCoverageProvider, self).__init__( collection, lookup_client, **kwargs ) if not self.lookup_client.authenticated: raise CannotLoadConfiguration( "Authentication for the Library Simplified Metadata Wrangler " "is not set up. Without this, there is no way to register " "your identifiers with the metadata wrangler." )
def __init__(self, _db, collection, api_class=Axis360API, metadata_client=None): super(Axis360CirculationMonitor, self).__init__(_db, collection) if isinstance(api_class, Axis360API): # Use a preexisting Axis360API instance rather than # creating a new one. self.api = api_class else: self.api = api_class(collection) if not metadata_client: metadata_client = MetadataWranglerOPDSLookup.from_config( _db, collection=collection) self.batch_size = self.DEFAULT_BATCH_SIZE self.metadata_client = metadata_client self.bibliographic_coverage_provider = ( Axis360BibliographicCoverageProvider(collection, api_class=self.api))
def __init__(self, metadata_web_app_url=None): if metadata_web_app_url: self.lookup = MetadataWranglerOPDSLookup(metadata_web_app_url) else: self.lookup = MetadataWranglerOPDSLookup.from_config(_db)
def __init__(self, _db, collection, lookup=None): super(MetadataWranglerCollectionUpdateMonitor, self).__init__(_db, collection) self.lookup = lookup or MetadataWranglerOPDSLookup.from_config( self._db, collection=collection)