1 |
|
---|
2 | import os
|
---|
3 | import sys
|
---|
4 |
|
---|
5 | localhost = sys.argv[1]
|
---|
6 |
|
---|
7 |
|
---|
8 | if os.path.exists('models'):
|
---|
9 | ff = open('models_db.dat','w')
|
---|
10 | for line in open('models_db_orig.dat'):
|
---|
11 | code_name, www = line.split()
|
---|
12 | code_tar = os.path.basename(www)
|
---|
13 | if os.path.exists('models/%s' % code_tar):
|
---|
14 | ff.write('%s http://%s/%s\n' % (code_name, localhost, code_tar))
|
---|
15 |
|
---|
16 | if os.path.exists('install'):
|
---|
17 | ff = open('package_info.dat','w')
|
---|
18 | for line in open('package_orig.dat'):
|
---|
19 | code_name, www = line.split()
|
---|
20 | code_tar = os.path.basename(www)
|
---|
21 | if os.path.exists('install/%s' % code_tar):
|
---|
22 | ff.write('%s http://%s/%s\n' % (code_name, localhost, code_tar))
|
---|