[Debconf-video-commits] r110 - package/trunk/src

benh at alioth.debian.org benh at alioth.debian.org
Wed Jul 23 19:53:59 UTC 2008


Author: benh
Date: 2008-07-23 19:53:58 +0000 (Wed, 23 Jul 2008)
New Revision: 110

Modified:
   package/trunk/src/dc-do-transcoding
Log:
Changed messages to be shorter and hopefully more readable.


Modified: package/trunk/src/dc-do-transcoding
===================================================================
--- package/trunk/src/dc-do-transcoding	2008-07-20 16:13:03 UTC (rev 109)
+++ package/trunk/src/dc-do-transcoding	2008-07-23 19:53:58 UTC (rev 110)
@@ -222,10 +222,11 @@
         if pretend:
             for job in queue:
                 if try_prepare_job(job):
-                    print 'spawning', job.command
+                    print ('INFO: generating %s; command: %s'
+                           % (job.target_filename, job.command))
                 else:
-                    print 'skipping', job.target_filename, \
-                          'as no source file available'
+                    print ('INFO: skipping %s as no source file available'
+                           % job.target_filename)
             break
 
         # Assign jobs to idle processors.
@@ -236,7 +237,8 @@
                     job = queue[queue_pos]
                     queue_pos += 1
                     if try_prepare_job(job):
-                        print 'spawning', job.command, 'on', host
+                        print ('INFO: generating %s; command: %s; host: %s'
+                               % (job.target_filename, job.command, host))
                         job.pipe = os.popen(
                             argv_to_command_line(
                             ['ssh', host, 'nice', job.command]))
@@ -245,12 +247,12 @@
                                      job.video_target_format_id)] = job
                         break
                     else:
-                        print 'skipping', job.target_filename, \
-                              'as no source file available'
-        print 'running jobs:'
+                        print ('INFO: skipping %s as no source file'
+                               'available' % job.target_filename)
+        print 'INFO: running jobs:'
         for host_proc, job in jobs_by_host_proc.items():
             host, proc = host_proc
-            print host + ': ' + job.command
+            print 'INFO: %s/%d: %s' % (host, proc, job.target_filename)
 
         # If not all processors are busy, we should look for new jobs in
         # 5 minutes.  Otherwise we should wait for a job to finish.
@@ -279,7 +281,7 @@
                     if data:
                         for line in data.split('\n'):
                             if line:
-                                print host + ': ' + line
+                                print '%s/%d: %s' % (host, proc, line)
                     else:
                         # EOF = job is done
                         result = job.pipe.close()
@@ -292,8 +294,12 @@
                         if (result is None
                             and os.path.isfile(job.target_filename)):
                             file_status_code = 'X'
+                            print ('INFO: completed %s; host: %s'
+                                   % (job.target_filename, host))
                         else:
                             file_status_code = 'F'
+                            print ('ERR: failed to generate %s; host: %s'
+                                   % (job.target_filename, host))
                         mark_job_done(job, file_status_code)
                         need_reschedule = True
             if need_reschedule:




More information about the Debconf-video-commits mailing list