Whitespace cleanup.
This commit is contained in:
@@ -4,24 +4,24 @@ import sys
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
p = optparse.OptionParser()
|
p = optparse.OptionParser()
|
||||||
p.add_option('-f', '--file', action="store",
|
p.add_option('-f', '--file', action="store",
|
||||||
type="string", dest="filename",
|
type="string", dest="filename",
|
||||||
help="File to read from, defaults to stdin", default=None)
|
help="File to read from, defaults to stdin", default=None)
|
||||||
p.add_option('-o', '--output', action="store",
|
p.add_option('-o', '--output', action="store",
|
||||||
type="string", dest="outfile",
|
type="string", dest="outfile",
|
||||||
help="File to write to, defaults to stdout", default=None)
|
help="File to write to, defaults to stdout", default=None)
|
||||||
|
|
||||||
options, arguments = p.parse_args()
|
options, arguments = p.parse_args()
|
||||||
|
|
||||||
if options.filename:
|
if options.filename:
|
||||||
f = open(options.filename)
|
f = open(options.filename)
|
||||||
content = f.read()
|
content = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
else:
|
else:
|
||||||
content = sys.stdin.read()
|
content = sys.stdin.read()
|
||||||
|
|
||||||
content = content.replace('background:', 'color:')
|
content = content.replace('background:', 'color:')
|
||||||
|
|
||||||
if options.outfile:
|
if options.outfile:
|
||||||
f = open(options.outfile, 'w')
|
f = open(options.outfile, 'w')
|
||||||
f.write(content)
|
f.write(content)
|
||||||
@@ -29,7 +29,6 @@ def main():
|
|||||||
else:
|
else:
|
||||||
print content
|
print content
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Reference in New Issue
Block a user