Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Mono/replacer.py @ 8586

Last change on this file since 8586 was 8440, checked in by ascheibe, 12 years ago

#1861 made prebuild events os dependent

File size: 728 bytes
Line 
1
2import re
3import sys
4import fileinput
5import os
6
7
8path = '/home/andi/HeuristicLab.Mono/'
9
10
11list_files = []
12
13 
14def search2(path, extension):
15    for root, dirs, filenames in os.walk(path):
16        for filename in filenames:
17            if os.path.splitext(filename)[-1] == '.csproj':
18                list_files.append(os.path.join(root, filename))
19
20
21extention = '.csproj'
22search2 (path, extention)   
23print list_files     
24
25
26for k in list_files:
27 
28  f = open(k)
29  fout = open (k + "_new", "wt")
30  for line in f:
31    fout.write(line.replace('<PreBuildEvent>', '<PreBuildEvent Condition=" \'$(OS)\' == \'Windows_NT\' ">') )
32  f.close()
33  fout.close()
34  os.system('mv ' + str(k) + '_new' + ' ' + str(k))
35
36
Note: See TracBrowser for help on using the repository browser.