# HG changeset patch # User Jeff Hammel # Date 1379691839 25200 # Node ID 3281b9fe4433b5d9e867dea170f899348529b661 # Parent 8b990efa4648493106667018debeda4ec38e0e75 wip diff -r 8b990efa4648 -r 3281b9fe4433 python/applyrealhard.py --- a/python/applyrealhard.py Fri Sep 20 08:23:41 2013 -0700 +++ b/python/applyrealhard.py Fri Sep 20 08:43:59 2013 -0700 @@ -19,12 +19,12 @@ def find(directory, pattern): # TODO: -> python - return [i for i in subprocess.check_output(['find', directory, '-iname', patten]).splitlines() if i.strip()] - + return [i for i in subprocess.check_output(['find', directory, '-iname', pattern]).splitlines() if i.strip()] + def rejects(directory): """all rejects in directory""" # TODO: not call out to find - + return find(directory, '*.rej') def main(args=sys.argv[1:]): @@ -33,7 +33,15 @@ parser.add_option('-d', '--directory', default=os.getcwd()) options, args = parser.parse_args(args) - + # get rejects + rej = rejects(options.directory) + if not rej: + parser.error("No rejects") + print 'rej:\n%s\n' % '\n'.join([' %s' % r for r in rej]) + + for r in rej: + # find the corresponding file + pass if __name__ == '__main__': main()