How to use the memorious.core.manager function in memorious

To help you get started, we’ve selected a few memorious examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alephdata / memorious / memorious / ui / views.py View on Github external
def get_crawler(name):
    crawler = manager.get(name)
    if crawler is None:
        abort(404)
    return crawler
github alephdata / memorious / memorious / cli.py View on Github external
def get_crawler(name):
    crawler = manager.get(name)
    if crawler is None:
        msg = 'Crawler [%s] not found.' % name
        raise click.BadParameter(msg, param=crawler)
    return crawler
github alephdata / memorious / memorious / ui / reporting.py View on Github external
def get_crawler(name):
    return manager.get(name)
github alephdata / memorious / memorious / worker.py View on Github external
def get_stages(self):
        return list({str(stage) for _, stage in manager.stages})
github alephdata / memorious / memorious / logic / context.py View on Github external
def from_state(cls, state, stage):
        state_crawler = state.get('crawler')
        crawler = manager.get(state_crawler)
        if crawler is None:
            raise RuntimeError("Missing crawler: [%s]" % state_crawler)
        stage = crawler.get(stage)
        if stage is None:
            raise RuntimeError('[%r] has no stage: %s' % (crawler, stage))
        return cls(crawler, stage, state)
github alephdata / memorious / memorious / ui / views.py View on Github external
def context():
    return {
        'version': settings.VERSION,
        'num_crawlers': len(manager),
        'state_change': state_change
    }
github alephdata / memorious / memorious / tasks.py View on Github external
def run_cleanup():
    manager.run_cleanup()