DevelopmentPage/SchoolDev: make_www.py

File make_www.py, 684 bytes (added by Olivier Mattelaer, 6 years ago)
Line 
1
2import os
3import sys
4
5localhost = sys.argv[1]
6
7
8if 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
16if 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))