Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)

        def delete_repo_by_id(id):
    repo = get_repo_by_id(id)
    if not repo:
        raise KeyError("Invalid repository ID")
    (name, path) = format_name(repo['repository_name'])
    import shutil
    shutil.rmtree(path)
    # TODO: Shouldn't these two be in the same transaction?
    #       How do we implement transactions in SQLAlchemy?
    s = repos.delete().where(repos.c.repository_id == id)
    result = db.execute(s)
    s = repo_acls.delete().where(repo_acls.c.repository_id == id)
    result = db.execute(s)
        


src/g/i/gitzebo-0.0.10/gitzebo/flask_app.py   gitzebo(Download)
    if not repo_acls or len(repo_acls) < 1 or not repo_acls[0]['is_owner']:
        raise Exception("Permission denied; user doesn't own this repository.")
    repos.delete_repo_by_id(id)
    return redirect(url_for('list_repos'))