Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
bboc committed Nov 10, 2017
1 parent 2613833 commit 4706d85
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"""

import sys
import os
import time
import difflib
import optparse

Expand Down Expand Up @@ -67,7 +65,7 @@ def parse_line(line):


def main():
# Configure the option parser
# Configure the option parser
usage = "Output differences between two files as CriticMarkup. Output is a full file, works on full paragraphs only. \nusage: %prog [options] fromfile tofile"
parser = optparse.OptionParser(usage)
(options, args) = parser.parse_args()
Expand All @@ -81,14 +79,15 @@ def main():
fromfile, tofile = args # as specified in the usage string

# we're passing these as arguments to the diff function
fromdate = time.ctime(os.stat(fromfile).st_mtime)
todate = time.ctime(os.stat(tofile).st_mtime)
# fromdate = time.ctime(os.stat(fromfile).st_mtime)
# todate = time.ctime(os.stat(tofile).st_mtime)
fromlines = open(fromfile, 'U').readlines()
tolines = open(tofile, 'U').readlines()

diff = difflib.ndiff(fromlines, tolines)
# diff is a generator
sys.stdout.writelines(critic_markup(diff))


if __name__ == '__main__':
main()

0 comments on commit 4706d85

Please sign in to comment.