Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a scanners directory #11

Open
LivInTheLookingGlass opened this issue Oct 4, 2022 · 1 comment · May be fixed by #48
Open

Add a scanners directory #11

LivInTheLookingGlass opened this issue Oct 4, 2022 · 1 comment · May be fixed by #48

Comments

@LivInTheLookingGlass
Copy link
Owner

The idea of a scan is that it should discover new markets to create. It should be implemented as an iterable, ideally a generator.

An example would look like (warning, pseudocode):

def scan_github(db, owner, repo, do_all = False**options) -> Iterable[CreationRequest]:
    db.execute("CREATE TABLE IF NOT EXISTS github_scans (owner TEXT, repo TEXT, number INT);")
    for pr in iter_prs(owner, repo):
        cur = db.execute('SELECT * FROM github_scans WHERE owner=?, repo=?, number=?;', (owner, repo, pr.number))
        if not cur.rowcount():
            yield create_request(pr)
            db.execute("INSERT INTO github_scans VALUES (?, ?, ?);", (owner, repo, pr.number))
            db.commit()
        elif not do_all:
            return  # I've already been here
@LivInTheLookingGlass
Copy link
Owner Author

Should be able to enable all, disable all (default), or enable individually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
1 participant