Last change
on this file since 1550 was
797,
checked in by chervol, 18 years ago
|
initial import
|
File size:
460 bytes
|
Line | |
---|
1 | import md5 |
---|
2 | import os |
---|
3 | |
---|
4 | def encrypt_md5(s): |
---|
5 | return md5.new(s).hexdigest().upper() |
---|
6 | |
---|
7 | os.chdir('skins/captchas') |
---|
8 | files = os.listdir('.') |
---|
9 | index = 1 |
---|
10 | |
---|
11 | for file in files: |
---|
12 | fname = file[:-5] |
---|
13 | hash = md5.new(fname).hexdigest().upper() |
---|
14 | new_fname = str(index)+'.jpg' |
---|
15 | metaname = new_fname + '.metadata' |
---|
16 | meta = open(metaname,'w') |
---|
17 | meta.write('[default]\n') |
---|
18 | meta.write('title='+hash) |
---|
19 | meta.close() |
---|
20 | os.rename(file, new_fname) |
---|
21 | index += 1 |
---|
Note: See
TracBrowser
for help on using the repository browser.