[Rivet-svn] r4306 - in trunk: . bin data

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon May 27 15:23:22 BST 2013


Author: buckley
Date: Mon May 27 15:23:22 2013
New Revision: 4306

Log:
Updating bash completion scripts for YODA format and compare-histos -> rivet-cmphistos.

Modified:
   trunk/ChangeLog
   trunk/bin/rivet-cmphistos
   trunk/data/rivet-completion

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Mon May 27 14:48:41 2013	(r4305)
+++ trunk/ChangeLog	Mon May 27 15:23:22 2013	(r4306)
@@ -1,3 +1,7 @@
+2013-05-27  Andy Buckley  <andy.buckley at cern.ch>
+
+	* Updating bash completion scripts for YODA format and compare-histos -> rivet-cmphistos.
+
 2013-05-23  Andy Buckley  <andy.buckley at cern.ch>
 
 	* Adding Doxy comments and a couple of useful convenience functions to Utils.hh.

Modified: trunk/bin/rivet-cmphistos
==============================================================================
--- trunk/bin/rivet-cmphistos	Mon May 27 14:48:41 2013	(r4305)
+++ trunk/bin/rivet-cmphistos	Mon May 27 15:23:22 2013	(r4306)
@@ -115,8 +115,7 @@
     mchistos = {}
     mchistolist = []
     for infile in filelist:
-        if not mchistos.has_key(infile):
-            mchistos[infile] = {}
+        mchistos.setdefault(infile, {})
         analysisobjects = yoda.readYODA(infile)
         for ao in analysisobjects:
             path = ao.annotations()['Path']
@@ -252,7 +251,6 @@
 
     ## Create a list of all histograms to be plotted
     refhistos, mchistos, mchistolist = getHistos(filelist)
-    print mchistolist
 
     ## Read the reference data from the Rivet search paths and add them
     ## to the list of reference histograms

Modified: trunk/data/rivet-completion
==============================================================================
--- trunk/data/rivet-completion	Mon May 27 14:48:41 2013	(r4305)
+++ trunk/data/rivet-completion	Mon May 27 15:23:22 2013	(r4306)
@@ -1,5 +1,5 @@
 ## -*- sh -*-
-## Analysis name completion for rivet scripts
+## Analysis name completion for Rivet scripts
 
 (type _filedir &> /dev/null) || \
 function _filedir() {
@@ -40,7 +40,7 @@
     fi
 
     if (echo ${prev} | egrep -- "--\<histo-file\>|\<-H\>" &> /dev/null); then
-        _filedir aida
+        _filedir yoda
         return 0
     fi
 
@@ -92,7 +92,7 @@
 ##############################
 
 
-function _compare_histos() {
+function _rivet_cmphistos() {
     local cur prev commands options command
     COMPREPLY=()
     cur="${COMP_WORDS[COMP_CWORD]}"
@@ -126,12 +126,12 @@
         return 0
     fi
 
-    _filedir aida
+    _filedir yoda
     return 0
 }
 
 
-complete -F _compare_histos -o default compare-histos
+complete -F _rivet_cmphistos -o default rivet-cmphistos
 
 
 ##############################
@@ -209,73 +209,9 @@
         return 0
     fi
 
-    _filedir aida
+    _filedir yoda
     return 0
 }
 
 
 complete -F _rivet_mkhtml rivet-mkhtml
-
-
-##############################
-
-
-function _aida2flat() {
-    local cur prev commands options command
-    COMPREPLY=()
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    opts="--help -h"
-    opts="$opts --split -s"
-    opts="$opts --gnuplot -g"
-    opts="$opts --plotinfodir"
-    opts="$opts --smart-output -S"
-    opts="$opts --match -m"
-    opts="$opts --quiet -q --verbose -v"
-
-    if [[ ${cur} == "--plotinfodir" ]] ; then
-        _filedir -d
-        return 0
-    fi
-
-    if [[ ${cur} == -* ]] ; then
-        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-        if test -n "$COMPREPLY"; then
-            return 0
-        fi
-    fi
-
-    _filedir aida
-    return 0
-}
-
-
-complete -F _aida2flat -o default aida2flat
-
-
-##############################
-
-
-function _flat2aida() {
-    local cur prev commands options command
-    COMPREPLY=()
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    opts="--help -h"
-    opts="$opts --split -s"
-
-    if [[ ${cur} == -* ]] ; then
-        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-        if test -n "$COMPREPLY"; then
-            return 0
-        fi
-    fi
-
-    _filedir dat
-    return 0
-}
-
-
-complete -F _aida2flat -o default aida2flat


More information about the Rivet-svn mailing list