From 94cb31b7455bc91d0d32be431f969670d4c6fae2 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Sat, 15 May 2010 09:00:14 +0100 Subject: [PATCH] Tidy up messages when converting programmes. --- scripts/convert_ts_to_mp2.sh | 7 ++++--- src/rtv_convert.py | 12 +++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/convert_ts_to_mp2.sh b/scripts/convert_ts_to_mp2.sh index 077e043..dab1b85 100755 --- a/scripts/convert_ts_to_mp2.sh +++ b/scripts/convert_ts_to_mp2.sh @@ -16,7 +16,8 @@ SIZE=640x480 if [ ! -f "$MP2_FILENAME" ]; then { - echo "Converting $TS_FILENAME to MPEG-2 .avi" + #echo "Converting $TS_FILENAME to MPEG-2 .avi" + echo $TS_FILENAME #echo '$ mencoder -quiet '"'$TS_FILENAME'"' -o '"'$CONV_FILENAME'"' -vf pp=li,scale=640:480 -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=1200' @@ -33,7 +34,7 @@ if [ ! -f "$MP2_FILENAME" ]; then cat mencoder_out.txt - echo "Error: mplayer returned '"$RETVAL"'" + echo "** Error: mplayer returned '"$RETVAL"' **" exit 2 }; fi @@ -44,7 +45,7 @@ if [ ! -f "$MP2_FILENAME" ]; then } else { - echo "Error: .mp2 filename already exists: " $MP2_FILENAME + echo "** Error: .mp2 filename already exists: " $MP2_FILENAME " **" exit 5 }; fi diff --git a/src/rtv_convert.py b/src/rtv_convert.py index 8746cbc..c9f2c93 100644 --- a/src/rtv_convert.py +++ b/src/rtv_convert.py @@ -49,7 +49,7 @@ def _get_flv_file_path_from_proginfo( proginfo ): def _get_flv_file_path( rtvinfo, fallback_filename ): if not os.path.isfile( rtvinfo ): - print "Error: rtvinfo file '%s' not found." % rtvinfo + print "** Error: rtvinfo file '%s' not found. **" % rtvinfo sys.stdout.flush() return ( "", fallback_filename ) @@ -59,6 +59,9 @@ def _get_flv_file_path( rtvinfo, fallback_filename ): return _get_flv_file_path_from_proginfo( proginfo ) def _delete_empty_dirs( config ): + print + print "Removing empty directories:" + for ( dirpath, dirnames, filenames ) in os.walk( config.converted_progs_dir ): if len( filenames ) == 0 and len( dirnames ) == 0: @@ -69,12 +72,15 @@ def _delete_empty_dirs( config ): empty_dir_name = os.path.join( config.converted_progs_dir, dirpath ) - print "Removing empty directory '%s'" % empty_dir_name + print empty_dir_name os.rmdir( empty_dir_name ) def convert( config ): + print + print "Converting:" + for fn in os.listdir( config.recorded_progs_dir ): last_dot_loc = fn.rfind( "." ) @@ -117,7 +123,7 @@ def convert( config ): fn, flv_before, flv_after, old_dir ) ) if retval != 0: - print "Conversion of '%s' returned an error." % fn + print "** Conversion of '%s' returned an error. **" % fn continue if os.path.isfile( rtvinfo ): -- 2.11.4.GIT