diff options
author | James Boisture <jboisture@jboisture-laptop.(none)> | 2010-07-20 03:15:23 (GMT) |
---|---|---|
committer | James Boisture <jboisture@jboisture-laptop.(none)> | 2010-07-20 03:15:23 (GMT) |
commit | b817158f554f7b3342ecfe3ce24d04e91abed3c3 (patch) | |
tree | 632bc4515e4feb5440714acb3b893aaa9b22a91d /controllers/default.py.bak |
The initial commit of the turtleartsite
Diffstat (limited to 'controllers/default.py.bak')
-rw-r--r-- | controllers/default.py.bak | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/controllers/default.py.bak b/controllers/default.py.bak new file mode 100644 index 0000000..d843133 --- /dev/null +++ b/controllers/default.py.bak @@ -0,0 +1,30 @@ +import os + +def index(): + form = SQLFORM(db.comment, fields = ['title', 'file', 'creator', 'description']) + if form.accepts(request.vars, session): + session.new_image = form.vars.file + session.new_image_title = form.vars.title + redirect(URL(r=request, f='jamiesprogram')) + return dict(form=form) + +def jamiesprogram(): + file_name_length = len(session.new_image) + os.system('python applications/turtle_art_images/modules/PngGenerator.py applications/turtle_art_images/uploads/'+session.new_image) + db(db.comment.title==session.new_image_title).update(newimage ='applications/turtle_art_images/uplodates/%s.png' % session.new_image[:-3]) + redirect(URL(r=request, f='imagelist')) + 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) |