Apply codestyle checks to all Python code.

This commit is contained in:
Dave Page
2019-03-20 11:17:51 +00:00
parent 6a8367beb9
commit bb1e908b54
7 changed files with 129 additions and 112 deletions

View File

@@ -1,14 +1,14 @@
import fileinput
import sys, getopt
import getopt
import sys
# Store input and output file names
infile=''
outfile=''
searchExp=''
replaceExp=''
infile = ''
outfile = ''
searchExp = ''
replaceExp = ''
# Read command line args
myopts, args = getopt.getopt(sys.argv[1:],"i:o:s:r:")
myopts, args = getopt.getopt(sys.argv[1:], "i:o:s:r:")
###############################
# o == option
@@ -16,13 +16,13 @@ myopts, args = getopt.getopt(sys.argv[1:],"i:o:s:r:")
###############################
for o, a in myopts:
if o == '-i':
infile=a
infile = a
elif o == '-o':
outfile=a
outfile = a
elif o == '-s':
searchExp=a
searchExp = a
elif o == '-r':
replaceExp=a
replaceExp = a
else:
print("Usage: %s -i input -o output" % sys.argv[0])
@@ -31,6 +31,6 @@ for o, a in myopts:
f1 = open(infile, 'r')
f2 = open(outfile, 'w')
for line in f1:
f2.write(line.replace(searchExp,replaceExp))
f2.write(line.replace(searchExp, replaceExp))
f1.close()
f2.close()