changeset 520:3281b9fe4433

wip
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 20 Sep 2013 08:43:59 -0700
parents 8b990efa4648
children c4432bd3cb9b
files python/applyrealhard.py
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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()