Created
August 18, 2015 08:45
-
-
Save tehmaze/f8f77292755d5571f007 to your computer and use it in GitHub Desktop.
Fix broken ASCIIs interpreted as ANSi by PabloDraw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
lines = [] | |
overflow = False | |
with open(sys.argv[1]) as i: | |
for line in i: | |
line = line.rstrip('\r\n') | |
if overflow: | |
lines.append(lines.pop(len(lines) - 1) + line) | |
else: | |
lines.append(line) | |
overflow = len(line) >= 80 | |
print '\n'.join(lines) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment