Jimmy Berry 6069245350 Remove SUSE copyright, warranty, and license headers.
Distinct copyrights were left as I do not wish to track down commit
history to ensure it properly documents the copyright holders. Also left
non-GPLv2 licenses and left bs_copy untouched as a mirror from OBS.

Already have a mix of with and without headers and even OBS does not place
on majority of files. If SUSE lawyers have an issue it will come up in
legal review for Factory.
2018-08-23 19:18:06 -05:00

52 lines
1.3 KiB
Python
Executable File

#!/usr/bin/python
import os
import sys
from abichecker_dbmodel import *
from abichecker_common import CACHEDIR
from abichecker_common import Config
from flask import Flask, request, session, url_for, redirect, \
render_template, send_file, abort, g, flash, _app_ctx_stack
app = Flask(__name__)
app.config.from_object(__name__)
#app.cli.command('initdb')
#def initdb_command():
# """Creates the database tables."""
# Base.metadata.create_all(db_engine())
@app.route('/')
def list():
session = db_session()
requests = session.query(Request).order_by(Request.id.desc()).limit(200).all()
return render_template('index.html', requests = requests)
@app.route('/request/<int:request_id>')
def request(request_id):
session = db_session()
request = session.query(Request).filter(Request.id == request_id).one()
config = Config(session)
return render_template('request.html', request = request, obsurl = config.get('obs-weburl', "https://build.opensuse.org/"))
@app.route('/report/<int:report_id>')
def report(report_id):
session = db_session()
report = session.query(LibReport).filter(LibReport.id == report_id).one()
fn = os.path.join(CACHEDIR, report.htmlreport)
return send_file(fn)
application = app
if __name__ == '__main__':
Base.metadata.create_all(db_engine())
application.run(debug=True)