import os def index(): if len(request.args): records = db(db.comment.image_id==request.args[0]).select() if len(request.args) and len(records): form = SQLFORM(db.comment, records[0], deletable=True) else: form = SQLFORM(db.comment, fields = ['title', 'file', 'creator', 'description']) if form.accepts(request.vars, session): response.flash = 'form accepted' session.file = form.vars.file redirect(URL(r=request, f='jamiesprogram')) elif form.errors: response.flash = 'form has errors' return dict(form=form) def jamiesprogram(): images = db().select(db.comment.ALL) for row in images: db.comment.insert(file=os.system('python applications/turtle_art_images/modules/PngGenerator.py '+URL(request.application,'default','download',args=row.file))) return dict() def imagelist(): comments = db().select(db.comment.ALL) return dict(comments=comments) def adminpage(): db.comment.truncate() redirect('index.html') def imagetemplate(): return dict() def download(): return response.download(request, db)