Exemplo n.º 1
0
class Importer(object):
    def __init__(self, collection_from, collection_to, user=None, issns=None):

        self._articlemeta = utils.articlemeta_server()
        self.collection_from = collection_from
        self.issns = issns
        self.catalog = Catalog(collection_to, user=user)

    def run(self):
        for item in self.items():
            self.catalog.load_issue(item)

    def items(self):

        if not self.issns:
            self.issns = [None]

        for issn in self.issns:
            for data in self._articlemeta.issues(
                    collection=self.collection_from, issn=issn):
                logger.debug(u'Lendo fascículos (%s-%s) do periódico %s - %s' %
                             (data.type, data.label, data.journal.title,
                              data.journal.scielo_issn))

                yield data
class Importer(object):

    def __init__(self, collection_from, collection_to, user=None, issns=None):

        self._articlemeta = utils.articlemeta_server()
        self.collection_from = collection_from
        self.issns = issns
        self.catalog = Catalog(collection_to, user=user)

    def run(self):
        for item in self.items():
            self.catalog.load_issue(item)

    def items(self):

        if not self.issns:
            self.issns = [None]

        for issn in self.issns:
            for data in self._articlemeta.issues(
                    collection=self.collection_from, issn=issn):
                logger.debug(u'Reading issue (%s-%s) from journal %s - %s' % (
                    data.type, data.label, data.journal.title, data.journal.scielo_issn))

                yield data
Exemplo n.º 3
0
    def __init__(self, collection_from, collection_to, user=None, issns=None):

        self._articlemeta = utils.articlemeta_server()
        self.collection_from = collection_from
        self.issns = issns
        self.catalog = Catalog(collection_to, user=user)
    def __init__(self, collection_from, collection_to, user=None, issns=None):

        self._articlemeta = utils.articlemeta_server()
        self.collection_from = collection_from
        self.issns = issns
        self.catalog = Catalog(collection_to, user=user)