# HG changeset patch # User Jeff Hammel # Date 1376090900 25200 # Node ID 95afeaf9c42de68730e930bbc8c05fad24cbc14b # Parent f71f6ffa731ad6c39ff0b29c0af1b578673d0030 -> http://k0s.org/portfolio/ideas/install_software_trifecta.txt diff -r f71f6ffa731a -r 95afeaf9c42d python/diffex.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/diffex.py Fri Aug 09 16:28:20 2013 -0700 @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +diff before v after of executables (requires http://k0s.org/hg/config/file/f71f6ffa731a/python/lsex.py) +""" + +import difflib +import lsex +import optparse +import os +import subprocess +import sys + +def add_options(parser): + """add options to the OptionParser instance""" + +def main(args=sys.argv[1:]): + + # parse command line options + usage = '%prog [options] ...' + class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): + """description formatter for console script entry point""" + def format_description(self, description): + if description: + return description.strip() + '\n' + else: + return '' + 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 + +if __name__ == '__main__': + main() +