Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/errors/127.0.0.1.2010-07-07.16-42-49.5500a16a-fe80-4d2b-a2df-b94c99a58dfd
blob: 7ce36f50d8ced349bd433c398d696844675ae169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(dp1
S'output'
p2
S''
sS'layer'
p3
S'/home/jboisture/Desktop/web2py/applications/turtlesite/controllers/default.py'
p4
sS'code'
p5
S'import os\n\ndef index():\n  if "page" in request.vars.keys(): page = int(request.vars["page"]) - 1\n  else: page = 0\n  table = []\n  comments = db().select(db.comment.ALL)\n  i = 0\n  row = []\n  count = 0\n  for comment in comments:\n      if count >= page * 12 and page*12+12 > count:\n          if i == 4:\n              table.append(row)\n              row = []\n              i = 0\n          i += 1\n          row.append(comment)\n      count += 1\n  table.append(row)\n  pages = count / 12\n  if count%12 > 0: pages += 1\n  page += 1\n  return dict(comments=table, pages=pages, page=page)\n\ndef profile():\n  if "user" in request.vars.keys(): user = request.vars["user"]\n  else: redirect(URL(r=request, f=\'index\')) \n  if "page" in request.vars.keys(): page = int(request.vars["page"]) - 1\n  else: page = 0\n  table = []\n  user_pics = []\n  comments = db().select(db.comment.ALL)\n  for comment in comments:\n      if comment.creator == user:\n          print user, comment.creator\n          user_pics.append(comment)\n  i = 0\n  row = []\n  count = 0\n  print page\n  for comment in user_pics:\n      if count >= page * 12 and page*12+12 > count:\n          if i == 4:\n              table.append(row)\n              row = []\n              i = 0\n          i += 1\n          row.append(comment)\n      count += 1\n  table.append(row)\n  pages = count / 12\n  if count%12 > 0: pages += 1\n  page += 1\n  return dict(comments=table, pages=pages, page=page, user=user)\n\ndef upload():\n    form = SQLFORM(db.comment, fields = [\'title\', \'file\', \'newimage\', \'description\'])\n    if form.accepts(request.vars, session):\n      session.new_image_title = form.vars.title\n      db(db.comment.title==session.new_image_title).update(creator = auth.user.username)\n      redirect(URL(r=request, f=\'index\')) \n    return dict(form=form)\n\n\ndef image():\n   comments = db().select(db.comment.ALL)\n   title = request.vars["title"].replace(\'*\',\' \')\n   for comment in comments:\n       if comment.title == title:\n           real_comment = comment\n   return dict(comment = real_comment)\n   \n  \ndef testimage():\n\treturn db(db.comment.title=="hellotest")\n\ndef user(): \n  return dict(form=auth())\n\ndef delete():\n   comments = db().select(db.comment.ALL)\n   title = request.vars["title"].replace(\'*\',\' \')\n   for comment in comments:\n       if comment.title == title:\n           real_comment = comment\n   if auth.is_logged_in():\n       if auth.user.username == real_comment.creator:\n           query=(db.comment.id=real_comment.id)\n           db(query).delete()\n   redirect(URL(r=request, f=\'index\')) \n  \n\t\n\ndef adminpage():\n  redirect(\'index.html\')\n  \ndef download():\n  return response.download(request, db)\n\nresponse._vars=response._caller(image)\n'
p6
sS'traceback'
p7
S'Traceback (most recent call last):\n  File "/home/jboisture/Desktop/web2py/gluon/restricted.py", line 176, in restricted\n    ccode = compile2(code,layer)\n  File "/home/jboisture/Desktop/web2py/gluon/restricted.py", line 163, in compile2\n    return compile(code.rstrip().replace(\'\\r\\n\',\'\\n\')+\'\\n\', layer, \'exec\')\n  File "/home/jboisture/Desktop/web2py/applications/turtlesite/controllers/default.py", line 89\n    query=(db.comment.id=real_comment.id)\n                        ^\nSyntaxError: invalid syntax\n'
p8
s.