Simply write input file to output file
This commit is contained in:
parent
2ebe648546
commit
713228b6c0
1 changed files with 9 additions and 3 deletions
8
scour.py
8
scour.py
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
# TODOs:
|
||||
#
|
||||
# 5) Copy input file text to output file text
|
||||
# 6) Read input file into memory using an XML library
|
||||
# 7) Implement a function that will remove all unreferenced id attributes from
|
||||
# from an SVG document (xlink:href="#someid", fill="url(#someid)", etc)
|
||||
|
|
@ -48,11 +47,13 @@ if( len(args) != 4 ):
|
|||
infile = ''
|
||||
outfile = ''
|
||||
|
||||
# Get input file
|
||||
if( args[0] == '-i' ):
|
||||
infile = args[1]
|
||||
elif( args[2] == '-i' ):
|
||||
infile = args[3]
|
||||
|
||||
# Get output file
|
||||
if( args[0] == '-o' ):
|
||||
outfile = args[1]
|
||||
elif(args[2] == '-o' ):
|
||||
|
|
@ -66,8 +67,13 @@ if( outfile == '' ):
|
|||
print 'Error! -o argument is missing'
|
||||
quit()
|
||||
|
||||
# Open input file for reading, throws error if file does not exist
|
||||
input = open(infile, 'r')
|
||||
# Open output file for writing, overwriting file if necessary
|
||||
output = open(outfile, 'w')
|
||||
|
||||
output.write(input.read());
|
||||
|
||||
# Close input and output files
|
||||
input.close()
|
||||
output.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue