From: stevenknight Date: Tue, 7 Oct 2008 04:52:38 +0000 (+0000) Subject: Fix label placement in gnuplot graphs by the "scons-time.py func" X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6aafa5cf6e3c4ccf7d939e2cc6509865b66437e9;p=scons.git Fix label placement in gnuplot graphs by the "scons-time.py func" subcommand when a profile result is equal to (or near) 0.0. git-svn-id: http://scons.tigris.org/svn/scons/trunk@3572 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 4217dab3..69a874f1 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,6 +8,15 @@ +RELEASE 1.X - XXX + + From Steven Knight: + + - Fix label placement by the "scons-time.py func" subcommand + when a profile value was close to (or equal to) 0.0. + + + RELEASE 1.X - XXX From Chris AtLee diff --git a/src/script/scons-time.py b/src/script/scons-time.py index d651ba92..4c74411b 100644 --- a/src/script/scons-time.py +++ b/src/script/scons-time.py @@ -166,13 +166,13 @@ class Gnuplotter(Plotter): result = [] for line in self.lines: result.extend(line.get_x_values()) - return filter(None, result) + return filter(lambda r: not r is None, result) def get_all_y_values(self): result = [] for line in self.lines: result.extend(line.get_y_values()) - return filter(None, result) + return filter(lambda r: not r is None, result) def get_min_x(self): try: diff --git a/test/scons-time/func/file.py b/test/scons-time/func/file.py index 079c125e..33a9908c 100644 --- a/test/scons-time/func/file.py +++ b/test/scons-time/func/file.py @@ -74,8 +74,8 @@ vertical_bars = ( expect2 = \ r"""set title "ST2.CONF TITLE" set key bottom left -set label 3 "label 1.5" at 0.5,1.5 right -set label 4 "label 1.6" at 0.6,1.5 right +set label 3 "label 1.5" at 0.5,0.5 right +set label 4 "label 1.6" at 0.6,0.4 right plot '-' title "Startup" with lines lt 1, \ '-' notitle with lines lt 7, \ '-' title "label 1.5" with lines lt 7, \