shorturl.cgi
changeset 5 156cdfffef8e
parent 3 9637b8f24005
child 6 d9d1f8e5f384
equal deleted inserted replaced
4:d46ab092d2b2 5:156cdfffef8e
    10 db = shelve.open('shorturls2', 'r')
    10 db = shelve.open('shorturls2', 'r')
    11 
    11 
    12 try :
    12 try :
    13     type, dirpath, fname = db[key]
    13     type, dirpath, fname = db[key]
    14 
    14 
       
    15     if type == 'dir' : fname = 'index'
       
    16 
    15     path = os.path.join(dirpath, fname) + '.html'
    17     path = os.path.join(dirpath, fname) + '.html'
    16 finally :
    18 finally :
    17     db.close()
    19     db.close()
    18 
    20 
    19 print "Status: 302"
    21 print "Status: 302"