changeset 3 | 9637b8f24005 |
parent 2 | 8b2b40a51098 |
child 5 | 156cdfffef8e |
2:8b2b40a51098 | 3:9637b8f24005 |
---|---|
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 path = os.path.join(dirpath, fname) |
15 path = os.path.join(dirpath, fname) + '.html' |
16 finally : |
16 finally : |
17 db.close() |
17 db.close() |
18 |
18 |
19 print "Status: 302" |
19 print "Status: 302" |
20 print "Location: ../%s" % path |
20 print "Location: ../%s" % path |