class Project(object): def __init__(self, name): self.name = name self.eggstore = DatabaseEggStore('sqlite:///:memory:') self.eggstore.create_project(name) def add_egg(self, version, egg): self.eggstore.add_version(self.name, version, egg) def get_version(self, version): return self.eggstore.get_version(self.name, version) def version(self): return self.eggstore.get_version(self.name)
import contextlib from StringIO import StringIO from scrapeman.eggstore.database import DatabaseEggStore from scrapeman.scheduler import Scheduler store = DatabaseEggStore() crawler = store.create_crawler('price-scraper') with contextlib.closing(StringIO('test egg')) as handle: store.add_egg('price-scraper', '1.0.0', handle) crawl = Sche
def __init__(self, name): self.name = name self.eggstore = DatabaseEggStore('sqlite:///:memory:') self.eggstore.create_project(name)