terom@22: #!/usr/bin/env python2.5 terom@12: # terom@12: # DeGAL - A pretty simple web image gallery terom@12: # Copyright (C) 2007 Tero Marttila terom@12: # http://marttila.de/~terom/degal/ terom@12: # terom@12: # This program is free software; you can redistribute it and/or modify terom@12: # it under the terms of the GNU General Public License as published by terom@12: # the Free Software Foundation; either version 2 of the License, or terom@12: # (at your option) any later version. terom@12: # terom@12: # This program is distributed in the hope that it will be useful, terom@12: # but WITHOUT ANY WARRANTY; without even the implied warranty of terom@12: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terom@12: # GNU General Public License for more details. terom@12: # terom@12: # You should have received a copy of the GNU General Public License terom@12: # along with this program; if not, write to the terom@12: # Free Software Foundation, Inc., terom@12: # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. terom@12: # terom@12: terom@18: import inc terom@22: from lib import shorturl, req terom@6: terom@22: key = req.get_str('key') terom@22: index = req.get_int('index', None) terom@9: terom@22: path = shorturl.html_path(key) terom@6: terom@22: if path : terom@22: print "Status: 302" terom@22: print "Location: ../%s" % path terom@22: print terom@22: print "../%s" % path terom@18: terom@22: else : terom@22: print "Status: 404" terom@22: print terom@22: print "404" terom@22: