[Rivet-svn] rivet: 2 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Tue Feb 23 15:00:02 GMT 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/025cc354ab52
branches:  release-2-4-x
changeset: 4986:025cc354ab52
user:      Andy Buckley <andy at insectnation.org>
date:      Tue Feb 23 14:54:44 2016 +0000
description:
Add automatic output paging to 'rivet --show-analyses'

details:   https://rivet.hepforge.org/hg/rivet/rev/8b317187975a
branches:  release-2-4-x
changeset: 4987:8b317187975a
user:      Andy Buckley <andy at insectnation.org>
date:      Tue Feb 23 14:59:20 2016 +0000
description:
Little tweak to allow piped output of --show-analyses output (test stdout for isatty())

diffs (truncated from 195 to 50 lines):

--- a/ChangeLog	Wed Feb 17 23:53:14 2016 +0000
+++ b/ChangeLog	Tue Feb 23 14:59:20 2016 +0000
@@ -1,3 +1,7 @@
+2016-02-23  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Add automatic output paging to 'rivet --show-analyses'
+
 2016-02-16  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Apply cross-section unit fixes and plot styling improvements to
--- a/bin/rivet	Wed Feb 17 23:53:14 2016 +0000
+++ b/bin/rivet	Tue Feb 23 14:59:20 2016 +0000
@@ -222,22 +222,32 @@
     if args:
         import re
         regexes = [re.compile(arg, re.I) for arg in args]
-    for aname in all_analyses:
-        if not regexes:
-            toshow = True
-        else:
-            toshow = False
-            for regex in regexes:
-                if regex.search(aname):
-                    toshow = True
-                    break
-        if toshow:
-            msg = aname
-            if opts.LOGLEVEL <= logging.INFO:
-                a = rivet.AnalysisLoader.getAnalysis(aname)
-                st = "" if a.status() == "VALIDATED" else ("[" + a.status() + "] ")
-                msg = "%-25s   %s" % (aname, st + rivet.util.detex(a.summary()))
-            print msg
+    try:
+        # import tempfile, subprocess
+        # tf, tfpath = tempfile.mkstemp(prefix="rivet-list.")
+        for aname in all_analyses:
+            if not regexes:
+                toshow = True
+            else:
+                toshow = False
+                for regex in regexes:
+                    if regex.search(aname):
+                        toshow = True
+                        break
+            if toshow:
+                msg = aname
+                if opts.LOGLEVEL <= logging.INFO:
+                    a = rivet.AnalysisLoader.getAnalysis(aname)
+                    st = "" if a.status() == "VALIDATED" else ("[" + a.status() + "] ")
+                    msg = "%-25s   %s" % (aname, st + rivet.util.detex(a.summary()))


More information about the Rivet-svn mailing list