Created
March 17, 2016 07:47
-
-
Save curzona/9afa67131a8ce14168ac to your computer and use it in GitHub Desktop.
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/env python | |
import argparse | |
from xml.dom.minidom import parseString | |
def parse_args(args=None): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('input') | |
parser.add_argument('output') | |
args = parser.parse_args(args) | |
return args | |
def main(args=None): | |
args = parse_args(args) | |
text = open(args.input, 'rb').read() | |
xml = parseString(text).toprettyxml() | |
open(args.output, 'wb').write(xml) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment