cgi-bin/shorturl.py
branchuse-distutils
changeset 41 3b1579a7bffb
parent 22 72696ca68c34
equal deleted inserted replaced
40:373392025533 41:3b1579a7bffb
       
     1 #!/usr/bin/env python2.5
       
     2 #
       
     3 # DeGAL - A pretty simple web image gallery
       
     4 # Copyright (C) 2007 Tero Marttila
       
     5 # http://marttila.de/~terom/degal/
       
     6 #
       
     7 # This program is free software; you can redistribute it and/or modify
       
     8 # it under the terms of the GNU General Public License as published by
       
     9 # the Free Software Foundation; either version 2 of the License, or
       
    10 # (at your option) any later version.
       
    11 #
       
    12 # This program is distributed in the hope that it will be useful,
       
    13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    15 # GNU General Public License for more details.
       
    16 #
       
    17 # You should have received a copy of the GNU General Public License
       
    18 # along with this program; if not, write to the
       
    19 # Free Software Foundation, Inc.,
       
    20 # 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
       
    21 #
       
    22 
       
    23 import inc
       
    24 from lib import shorturl, req
       
    25 
       
    26 key = req.get_str('key')
       
    27 index = req.get_int('index', None)
       
    28 
       
    29 path = shorturl.html_path(key)
       
    30 
       
    31 if path :
       
    32     print "Status: 302"
       
    33     print "Location: ../%s" % path
       
    34     print
       
    35     print "../%s" % path
       
    36 
       
    37 else :
       
    38     print "Status: 404"
       
    39     print
       
    40     print "404"
       
    41