Mercurial > hg > config
comparison python/applyrealhard.py @ 519:8b990efa4648
python/applyrealhard.py
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 20 Sep 2013 08:23:41 -0700 |
parents | |
children | 3281b9fe4433 |
comparison
equal
deleted
inserted
replaced
518:4e2d8a7eb188 | 519:8b990efa4648 |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 # XXX STUB | |
4 | |
5 """ | |
6 http://code.google.com/p/python-patch/ | |
7 """ | |
8 | |
9 import difflib | |
10 import optparse | |
11 import os | |
12 import subprocess | |
13 import sys | |
14 from which import which | |
15 | |
16 here = os.path.dirname(os.path.realpath(__file__)) | |
17 | |
18 wiggle = which('wiggle') | |
19 | |
20 def find(directory, pattern): | |
21 # TODO: -> python | |
22 return [i for i in subprocess.check_output(['find', directory, '-iname', patten]).splitlines() if i.strip()] | |
23 | |
24 def rejects(directory): | |
25 """all rejects in directory""" | |
26 # TODO: not call out to find | |
27 | |
28 | |
29 def main(args=sys.argv[1:]): | |
30 | |
31 usage = '%prog [options]' | |
32 parser = optparse.OptionParser(usage=usage, description=__doc__) | |
33 parser.add_option('-d', '--directory', default=os.getcwd()) | |
34 options, args = parser.parse_args(args) | |
35 | |
36 | |
37 | |
38 if __name__ == '__main__': | |
39 main() |