4 for root, dirs, files
in os.walk(currentDir):
6 files = [os.path.join(root, f)
for f
in files]
8 if f.find(
".xml") != -1:
10 destination = open( f,
"w" )
11 source = open( f+
"~",
"r" )
13 if line.find(
"RegionOfInterest") != -1:
14 whitespaces = len(line) - len(line.lstrip(
' '))
16 for w
in range(whitespaces):
18 first = line.find(
"\"")
19 second = line.rfind(
"\"")
20 nums = line[first+1:second]
22 xorig =
int(result[0])
23 yorig =
int(result[1])
24 xsize =
int(result[2]) -
int(result[0])
25 ysize =
int(result[3]) -
int(result[1])
27 destination.write( prepend +
"ClipRectangleOrigin=\"" + str(xorig) +
" " + str(yorig) +
"\" \n" )
28 destination.write( prepend +
"ClipRectangleSize=\"" + str(xsize) +
" " + str(ysize) +
"\" \n" )
30 destination.write( line )
36 if __name__ ==
'__main__':
37 getInfos(
"C:\devel\PlusBuild-bin-x32\PlusLib\Data\ConfigFiles")