Back to index

python3.2  3.2.2
Functions
lfcr Namespace Reference

Functions

def main

Function Documentation

def lfcr.main ( void  )

Definition at line 7 of file lfcr.py.

00007 
00008 def main():
00009     for filename in sys.argv[1:]:
00010         if os.path.isdir(filename):
00011             print(filename, "Directory!")
00012             continue
00013         with open(filename, "rb") as f:
00014             data = f.read()
00015         if b'\0' in data:
00016             print(filename, "Binary!")
00017             continue
00018         newdata = re.sub(b"\r?\n", b"\r\n", data)
00019         if newdata != data:
00020             print(filename)
00021             with open(filename, "wb") as f:
00022                 f.write(newdata)

Here is the call graph for this function: