From 373984919c83c86e59c9d4811913181c7cf3c637 Mon Sep 17 00:00:00 2001 From: Adriana Draghici Date: Sat, 14 Nov 2009 23:08:34 +0000 Subject: [PATCH] Tribler: updated the scripts that add timestamp to print instructions --- tribler-mod/scrips/modify_all_print.sh | 2 +- tribler-mod/scrips/print_timestamp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tribler-mod/scrips/modify_all_print.sh b/tribler-mod/scrips/modify_all_print.sh index 69e3a44..48ad9d1 100755 --- a/tribler-mod/scrips/modify_all_print.sh +++ b/tribler-mod/scrips/modify_all_print.sh @@ -1,2 +1,2 @@ # Modifies all print instructions in order to output time information. -for i in $(find -name '*.py' -type f | grep -v '.svn'); do sed -i.bak 's/print[ \t]*>>sys.stderr,/print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ",/g' $i; sed -i.bak '1i\from time import localtime, strftime' $i; done; +for i in $(find -name '*.py' -type f | grep -v '.svn'); do sed -i.bak 's/print[ \t]*>>[ \t]*sys.stderr,/print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ",/g' $i; sed -i.bak '1i\from time import localtime, strftime' $i; done; diff --git a/tribler-mod/scrips/print_timestamp.sh b/tribler-mod/scrips/print_timestamp.sh index 01dad8e..68909f4 100755 --- a/tribler-mod/scrips/print_timestamp.sh +++ b/tribler-mod/scrips/print_timestamp.sh @@ -8,7 +8,7 @@ else # for i in $(cat $2 | grep "/");do echo $i; done; if test "-$1" == "-a" then - for i in $(cat $2 | grep "/"); do sed -i.bak 's/print[ \t]*>>sys.stderr,/print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ",/g' $i; sed -i.bak '1i\from time import localtime, strftime' $i; done; + for i in $(cat $2 | grep "/"); do sed -i.bak 's/print[ \t]*>>[ \t]*sys.stderr,/print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ",/g' $i; sed -i.bak '1i\from time import localtime, strftime' $i; done; else for i in $(cat $2 | grep "/"); do sed -i.bak 's/print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ",/print >>sys.stderr, /g' $i; sed -i.bak '1s/from time import localtime, strftime/ /;t' $i; done; fi -- 2.20.1