#!/usr/bin/python # import main from flask import Flask,request app = Flask(__name__) def run_flask(host,port): app = Flask(host=host, port=port) app.run() def getFeeds(db): db = getDb() cursor = db.cursor() cusror.execute(''' SELECT name FROM feeds ''') feeds = cursor.fetchall() cursor.close() return feeds @app.route('/') def list(): feeds = getFeeds() a = "

Header


" for i in feeds: a+= "".format(i,i) a+= "
Feeds
{}
" return a @app.route('/configure', methods = ['GET','POST']) def configure(feed_name): db = getDb() feed = lf(db, feed_name) if request.method == 'POST': for k,v in request.form.items(): feed.query_db(k,v) config_list = ( "url", "password", "username", "selector", "selector_login_user", "selector_login_pass", "selector_login_verify", "selector_login_verify_url", "selector_login_url") a = '
' for i in config_list: a += '''
'''.format(i,i,feed.query_db(i),i) a += "
"