--- /dev/null
+
+
+===== Scripturi ========
+
+1. modify_all_print.sh - adauga in instructiunile print din toate fisierele sursa, informatii legate de timp.
+2. print_timestamp.sh - adauga in instructiunile print informatii legate de timp.
+ - caile catre fisierele sursa modificate sunt scrise intr-un fisier dat ca argument scriptului.
+3. set_DEBUG.sh - seteaza DEBUG pe true
+4. set_DEBUG_NORMAL.sh - seteaza DEBUG_NORMAL pe true
+
+Exemplu:
+
+./print_timestamp.sh modified_files_DEBUG
+./set_DEBUG.sh t modified_files_DEBUG
+./set_DEBUG_NORMAL.sh t modified_files_DEBUG_NORMAL
+
+
+5. make_changes.sh - modifica instr print din toate fisierele, face schimbarile legate de flag-urile DEBUG
+ si DEBUG_NORMAL in fisierele listate in modified_files_DEBUG, respectiv modified_files_DEBUG_NORMAL.
+
+6. undo_changes.sh - aduce sursele la forma in care erau inaintea rularii scripturilor de modificare.
+
+
+
+Fisierele modified_files_* contin pe fiecare linie calea catre un fisier ce trebuie modificat.
+Liniile care nu contin cel putin un "/" sunt ignorate.
+
+
--- /dev/null
+# Modifies tribler sources to output logging information.
+
+./modify_all_print.sh
+./set_DEBUG.sh t modified_files_DEBUG
+./set_DEBUG_NORMAL.sh t modified_files_DEBUG_NORMAL
+
+
--- /dev/null
+./Tribler/Core/BitTornado/BT1/Connecter.py
+
+++ /dev/null
-
-for i in $(find -name '*.py' -type f | grep -v '.svn'); do sed -i.bak 's/print >>sys.stderr,/print >>sys.stderr, strftime("%d-%m-%Y %H:%M:%S", localtime())," ",/g' $i; sed -i.bak '1i\from time import localtime, strftime\n' $i; done;
--- /dev/null
+
+sed -i.bak 's/print[ \t]\'/print >>sys.strderr, \'/g' Tribler/Core/BitTornado/BT1/Connecter.py;
+
--- /dev/null
+# 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;
--- /dev/null
+
+# Modifies print instructions in given files in order to output time information.
+if test $# -lt 2 -o \( "-$1" != "-a" -a "-$1" != "-d" \)
+then
+ echo "Usage: ";echo "$0 a <filename> - adds timestamp to print instructions in the source files listed in <filename>"
+ echo "$0 d <filename> - removes timestamp from print instructions in the source files listed in <filename>"
+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;
+ 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
+fi
+
+
+
--- /dev/null
+
+
+if test $# -lt 2 -o \( "-$1" != "-f" -a "-$1" != "-t" \)
+then
+ echo "Usage: ";echo "$0 t <filename> - changes DEBUG_NORMAL_MSGS variable to True for the source files listed in <filename>"
+ echo "$0 f <filename> - changes DEBUG_NORMAL_MSGS variable to False for the source files listed in <filename>"
+else
+ if test "-$1" == "-t"
+ then
+ for i in $(cat $2 | grep "/"); do sed -i.bak 's/DEBUG_NORMAL_MSGS[ \t]*=[ \t]*False[ \t]*[#a-zA-Z ]*/DEBUG_NORMAL_MSGS = True #False/g' $i; done;
+ else
+ for i in $(cat $2 | grep "/"); do sed -i.bak 's/DEBUG_NORMAL_MSGS[ \t]*=[ \t]*True[ \t]*[#a-zA-Z ]*/DEBUG_NORMAL_MSGS = False #True/g' $i; done;
+ fi
+fi
+
+
--- /dev/null
+
+./unmodify_all_print.sh
+./set_DEBUG.sh f modified_files_DEBUG
+./set_DEBUG_NORMAL.sh f modified_files_DEBUG_NORMAL
+
+
+
+++ /dev/null
-for i in $(find -name '*.py' -type f | grep -v '.svn'); do sed -i.bak 's/print >>sys.stderr, strftime("%d %m %Y %H:%M:%S", localtime())," ",/print >>sys.stderr, /g' $i; sed -i.bak 's/from time import localtime, strftime\n/ /g' $i; done;
-
--- /dev/null
+for i in $(find -name '*.py' -type f | grep -v '.svn'); 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;
+