Index: trunk/tools/czartool/CzarDb.pm
===================================================================
--- trunk/tools/czartool/CzarDb.pm	(revision 28728)
+++ trunk/tools/czartool/CzarDb.pm	(revision 28752)
@@ -2,5 +2,4 @@
 
 package czartool::CzarDb;
-
 
 use warnings;
@@ -10,5 +9,4 @@
 
 my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); # TODO put elsewhere
-
 
 use base 'czartool::MySQLDb';
@@ -20,5 +18,5 @@
 
     # Call the constructor of the parent class, Person.
-    my $self = $class->SUPER::new( $_[1], $_[2], $_[3], $_[4],  $_[5]);
+    my $self = $class->SUPER::new( $_[1], $_[2], $_[3], $_[4],  $_[5], $_[6]);
 
     bless $self, $class;
@@ -147,7 +145,7 @@
 ###########################################################################
 sub getTimeDifference { # TODO fix this
-    my ($self, $save_temps, $fromTime, $toTime) = @_; # TODO save_temps should be constructor arg
-
-    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$save_temps);
+    my ($self, $fromTime, $toTime) = @_; 
+
+    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$self->{_save_temps});
 
     my $query = $self->{_db}->prepare(<<SQL);
@@ -167,7 +165,7 @@
 ###########################################################################
 sub createTimeSeriesData {
-    my ($self, $save_temps, $label, $table, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_; # TODO save_temps should be constructor arg
-
-    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$save_temps);
+    my ($self, $label, $table, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_;
+
+    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$self->{_save_temps});
 
     my $query = $self->{_db}->prepare(<<SQL);
Index: trunk/tools/czartool/Czarplot.pm
===================================================================
--- trunk/tools/czartool/Czarplot.pm	(revision 28728)
+++ trunk/tools/czartool/Czarplot.pm	(revision 28752)
@@ -66,5 +66,5 @@
     my $stage = undef;
     foreach $stage (@{$stages}) {
-        $gnuplotFiles{$stage} =  $self->{_czarDb}->createTimeSeriesData($self->{_save_temps}, $label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
+        $gnuplotFiles{$stage} =  $self->{_czarDb}->createTimeSeriesData($label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
     }                                                           
 
Index: trunk/tools/czartool/MySQLDb.pm
===================================================================
--- trunk/tools/czartool/MySQLDb.pm	(revision 28728)
+++ trunk/tools/czartool/MySQLDb.pm	(revision 28752)
@@ -21,4 +21,5 @@
         _dbPass => shift,
         _verbose => shift,
+        _save_temps => shift,
     };                              
 
