source: tuxpaint-config/trunk/fuentes/visualc/prebuild.py @ 220

Last change on this file since 220 was 220, checked in by mabarracus, 4 years ago

added tuxpaint-config sources from trusty

File size: 542 bytes
Line 
1import sys, re, os
2
3def lfcr(file):
4    if os.path.isdir(file):
5        print file, "Directory!"
6        return
7    data = open(file, "rb").read()
8    if '\0' in data:
9        print file, "Binary!"
10        return
11    newdata = re.sub("\r?\n", "\r\n", data)
12    if newdata != data:
13        print "Converting '"+file+"' to CRLF format."
14        f = open(file, "wb")
15        f.write(newdata)
16        f.close()
17
18
19docs = "../docs/"
20for doc in os.listdir(docs):
21    fullpath = docs+doc
22    if os.path.isdir(fullpath): continue
23    lfcr(fullpath)
24
25
Note: See TracBrowser for help on using the repository browser.