Mercurial > hg > config
comparison python/diffex.py @ 446:95afeaf9c42d
-> http://k0s.org/portfolio/ideas/install_software_trifecta.txt
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 09 Aug 2013 16:28:20 -0700 |
parents | |
children | be91c9fb3147 |
comparison
equal
deleted
inserted
replaced
445:f71f6ffa731a | 446:95afeaf9c42d |
---|---|
1 #!/usr/bin/env python | |
2 # -*- coding: utf-8 -*- | |
3 | |
4 """ | |
5 diff before v after of executables (requires http://k0s.org/hg/config/file/f71f6ffa731a/python/lsex.py) | |
6 """ | |
7 | |
8 import difflib | |
9 import lsex | |
10 import optparse | |
11 import os | |
12 import subprocess | |
13 import sys | |
14 | |
15 def add_options(parser): | |
16 """add options to the OptionParser instance""" | |
17 | |
18 def main(args=sys.argv[1:]): | |
19 | |
20 # parse command line options | |
21 usage = '%prog [options] ...' | |
22 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): | |
23 """description formatter for console script entry point""" | |
24 def format_description(self, description): | |
25 if description: | |
26 return description.strip() + '\n' | |
27 else: | |
28 return '' | |
29 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) | |
30 options, args = parser.parse_args(args) | |
31 | |
32 # STUB | |
33 # before = lsex... # get executables before | |
34 # raw_input("Press [Enter] to continue") | |
35 # after = lsex... # get executables after | |
36 # difflib.diff() # get difference | |
37 | |
38 if __name__ == '__main__': | |
39 main() | |
40 |