refactored _run_reprocessing
authorRodney Ewing <ewing.rj@gmail.com>
Thu, 1 Aug 2013 22:24:34 +0000 (15:24 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 16 Aug 2013 22:30:13 +0000 (15:30 -0700)
mediagoblin/gmg_commands/reprocess.py

index cad75c455384f1a840ef05d0509678894a261793..60df697fd9a3c50ec2010daa239bd9dcbd86ed2b 100644 (file)
@@ -85,7 +85,15 @@ def _reprocess_all(args):
 
 def _run_reprocessing(args):
     if args[0].available:
-        return hook_handle(('reprocess_action', args[0].type), args)
+        if args[0].state == 'failed':
+            print _('\n Available reprocess actions for all failed'
+                    ' media_entries: \n \t --initial_processing')
+        else:
+            result = hook_handle(('reprocess_action', args[0].type), args)
+            if not result:
+                print _('Sorry there is no available reprocessing for {}'
+                        ' entries in the {} state'.format(args[0].type,
+                                                          args[0].state))
     else:
         return hook_handle(('media_reprocess', args[0].type), args)