]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/wince/clean_vcp.py
2 This script will delete dependences from *.vcp files.
3 After using this script, next time when you will try to save project,
4 you will have wait until 'Visual Tools' will rebuild all dependencies
5 and this process might take HUGE amount of time
7 Author : Viktor Voroshylo
9 __version__
='$Revision$'[11:-2]
13 if len(sys
.argv
) != 2 :
14 print "Usage: %s project_file.vcp" % sys
.argv
[0]
17 vsp_filename
= sys
.argv
[1]
21 vsp_file
= open(vsp_filename
, "r")
24 line
= vsp_file
.readline()
28 if not line
.endswith("\\\n") : exclude_line
= 0
30 elif line
.startswith("DEP_CPP_") or line
.startswith("NODEP_CPP_") :
33 elif empty_if_start
!= -1 :
34 if line
== "!ENDIF \n" :
35 resultLines
= resultLines
[:empty_if_start
]
38 elif line
!= "\n" and not line
.startswith("!ELSEIF ") :
40 elif line
.startswith("!IF ") :
41 empty_if_start
= len(resultLines
)
44 resultLines
.append(line
)
46 line
= vsp_file
.readline()
48 open(vsp_filename
, "w").write("".join(resultLines
))