equal
deleted
inserted
replaced
16 db = shelve.open('shorturls2', 'r') |
16 db = shelve.open('shorturls2', 'r') |
17 |
17 |
18 try : |
18 try : |
19 type, dirpath, fname = db[key] |
19 type, dirpath, fname = db[key] |
20 |
20 |
|
21 if type == 'img' : |
|
22 fname += '.html' |
|
23 elif type == 'dir' : |
|
24 fname = '' |
|
25 |
21 if index : |
26 if index : |
22 if index > 1 : |
27 if index > 1 : |
23 fname += 'index_%s.html' % (index - 1) |
28 fname = 'index_%s.html' % (index - 1) |
24 |
29 |
25 dirpath = '../%s' % dirpath |
30 dirpath = '../%s' % dirpath |
26 |
|
27 if type == 'img' : |
|
28 fname += '.html' |
|
29 |
31 |
30 path = os.path.join(dirpath, fname) |
32 path = os.path.join(dirpath, fname) |
31 finally : |
33 finally : |
32 db.close() |
34 db.close() |
33 |
35 |