Show More
@@ -17,12 +17,12 b' Set up helpers' | |||||
17 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
17 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
18 | > except ImportError: |
|
18 | > except ImportError: | |
19 | > pass |
|
19 | > pass | |
20 | > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n') |
|
20 | > (old, new) = sys.argv[1] == 'LF' and (b'\n', b'\r\n') or (b'\r\n', b'\n') | |
21 | > print("%% switching encoding from %r to %r" % (old, new)) |
|
21 | > print("%% switching encoding from %r to %r" % (old, new)) | |
22 | > for path in sys.argv[2:]: |
|
22 | > for path in sys.argv[2:]: | |
23 |
> data = |
|
23 | > data = open(path, 'rb').read() | |
24 | > data = data.replace(old, new) |
|
24 | > data = data.replace(old, new) | |
25 |
> |
|
25 | > open(path, 'wb').write(data) | |
26 | > EOF |
|
26 | > EOF | |
27 |
|
27 | |||
28 | $ seteol () { |
|
28 | $ seteol () { |
General Comments 0
You need to be logged in to leave comments.
Login now