[feedgnuplot] 35/42: If using --timefmt then --xlen MUST have an integer argument

Dima Kogan dkogan-guest at alioth.debian.org
Sun Oct 20 08:04:09 UTC 2013


This is an automated email from the git hooks/post-receive script.

dkogan-guest pushed a commit to tag v1.25
in repository feedgnuplot.

commit 74e95d8e6f87b915213899bfd5f426627ff58bbb
Author: Dima Kogan <dima at secretsauce.net>
Date:   Sat Oct 19 23:37:17 2013 -0700

    If using --timefmt then --xlen MUST have an integer argument
    
    I use strftime() and strptime() to deal with xlen in the timefmt case, and those
    functions only work with integers
---
 bin/feedgnuplot |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/bin/feedgnuplot b/bin/feedgnuplot
index aa98136..975d9e6 100755
--- a/bin/feedgnuplot
+++ b/bin/feedgnuplot
@@ -314,6 +314,17 @@ sub interpretCommandline
     $options{timefmt_Ncols} = $Nfields;
     my $regex_str = join( '\s+', ('\S+') x $Nfields );
     $options{timefmt_regex} = qr/$regex_str/;
+
+    # make sure --xlen is an integer. With a timefmt xlen goes through strptime
+    # and strftime, and those are integer-only
+    if( defined $options{xlen} )
+    {
+      if( $options{xlen} - int($options{xlen}) )
+      {
+        say STDERR "When streaming --xlen MUST be an integer. Rounding up to the nearest second";
+        $options{xlen} = 1 + int($options{xlen});
+      }
+    }
   }
 }
 
@@ -1061,7 +1072,7 @@ given, some other options act a little bit differently:
 
 =item
 
-C<--xlen> is in seconds
+C<--xlen> is an I<integer> in seconds
 
 =item
 
@@ -1103,7 +1114,7 @@ windowsize> can be given. This will create an constantly-updating, scrolling
 view of the recent past. C<windowsize> should be replaced by the desired length
 of the domain window to plot, in domain units (passed-in values if C<--domain>
 or line numbers otherwise). If the domain is a time/date via C<--timefmt>, then
-C<windowsize> is in seconds.
+C<windowsize> is and I<integer> in seconds.
 
 =head3 Special data commands
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/feedgnuplot.git



More information about the debian-science-commits mailing list