# HG changeset patch # User Jeff Hammel # Date 1376180049 25200 # Node ID be91c9fb31477b760e83a02651fdc85abe1ddb60 # Parent 7d6bd51f0323081b627772af23603e4e9989d3b0 python/diffex.py diff -r 7d6bd51f0323 -r be91c9fb3147 python/diffex.py --- a/python/diffex.py Sat Aug 10 16:51:24 2013 -0700 +++ b/python/diffex.py Sat Aug 10 17:14:09 2013 -0700 @@ -11,6 +11,7 @@ import os import subprocess import sys +import tempfile def add_options(parser): """add options to the OptionParser instance""" @@ -29,11 +30,25 @@ parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) options, args = parser.parse_args(args) - # STUB - # before = lsex... # get executables before - # raw_input("Press [Enter] to continue") - # after = lsex... # get executables after - # difflib.diff() # get difference + # get difference + before = lsex.executable_names() # get executables before + raw_input("Press [Enter] to continue") + after = lsex.executable_names() # get executables after + + # display + added = [i for i in after if i not in before] + removed = [i for i in before if i not in after] + added.sort() + removed.sort() + + display = [('Added', added), + ('Removed', removed), + ] + + for display_name, var in display: + if var: + print '%s:' % display_name + print '\n'.join(var) if __name__ == '__main__': main()