summaryrefslogtreecommitdiffstats
blob: 8b8d24e47bdefc7e9dc9240509aabd47c3f0d7ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python

import sys, re

assert(len(sys.argv) == 2)

output = []
inputFile = open(sys.argv[1])
inIgnoredFile = False
for line in inputFile.readlines() :
  if inIgnoredFile :
    if line == "end_of_record\n" :
      inIgnoredFile = False
  else :
    if line.startswith("SF:") and (line.find("/Swiften/") == -1 or line.find("/UnitTest/") != -1 or line.find("/QA/") != -1 or line.find("/3rdParty/") != -1):
      inIgnoredFile = True
    else :
      if line.startswith("SF:") :
        line = line.replace("/./Swiften/", "/Swiften/")
      output.append(line)
inputFile.close()

outputFile = open(sys.argv[1], 'w')
outputFile.write(''.join(output))
outputFile.close()