Ejemplo n.º 1
0
 def GET(self, paste_id):
     row = db.get_paste(paste_id)
     if row is None:
         return web.notfound('No such paste.')
     title = row['title']
     if title == '':
         title = 'Paste #%s' % paste_id
     formatted = highlighting.highlight(row['body'], row['syntax'])
     comments = db.get_comments(paste_id)
     return render.paste(
         paste_id=paste_id,
         created=row['created'],
         poster=row['poster'],
         title=title,
         body=formatted,
         syntax=highlighting.ALIAS_TO_NAME[row['syntax']],
         comments=comments,
     )
Ejemplo n.º 2
0
 def GET(self, paste_id):
     row = db.get_paste(paste_id)
     if row is None:
         return web.notfound('No such paste.')
     return row['body']