[or-cvs] r15480: Directory writing option was broken (dumped everything in th (torflow/branches/gsoc2008/tools/BTAnalysis)

fallon at seul.org fallon at seul.org
Thu Jun 26 20:53:02 UTC 2008


Author: fallon
Date: 2008-06-26 16:53:02 -0400 (Thu, 26 Jun 2008)
New Revision: 15480

Modified:
   torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py
Log:
Directory writing option was broken (dumped everything in the current directory), this actually works.


Modified: torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py
===================================================================
--- torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py	2008-06-26 20:31:11 UTC (rev 15479)
+++ torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py	2008-06-26 20:53:02 UTC (rev 15480)
@@ -228,13 +228,16 @@
     elif sort and not truncate:
       newfile = dirname + '/' + filename + '.shuffled'
     else:
-      newfile = filename 
+      newfile =  filename 
     # shuffle, create new file
     shuffle(sort,truncate,filename,newfile)
-  
+ 
     # create histogram from file
     s = Stats(newfile)
-    s.makehistogram(100,newfile,newfile + '.hist')
+    if not sort and not truncate:
+      s.makehistogram(100,newfile,dirname + '/' + newfile + '.hist')
+    else:
+      s.makehistogram(100,newfile,newfile + '.hist')
     mean = s.mean()
     stddev = s.stddev()
     median = s.median()
@@ -249,8 +252,10 @@
   
     if graph:
       # create gnuplot file
+      if not sort and not truncate:
+        newfile =  dirname + '/' + newfile 
+      plotname =  newfile + '.plt'
       ncircuits = str(len(s.values))
-      plotname =  newfile + '.plt'
      
       plotstr = "set terminal png transparent nocrop enhanced size 800,600\nset output '" + newfile + ".png'\nset style fill  solid 1.00 border -1\nset style histogram clustered gap 1 title  offset character 0, 0, 0\nset datafile missing '-'\nset style data histograms\nset title 'Buildtime Distribution Function for "+ ncircuits +" Circuits k=" + str(k) + "\nset ylabel '# Circuits'\nset xlabel 'time (in 100ms)'\n"
       plotstr += "set label 'std dev=" + str(stddev) + "' at 170,15\n"



More information about the tor-commits mailing list