|
[Rivet-svn] r3371 - in trunk: . binblackhole at projects.hepforge.org blackhole at projects.hepforge.orgSat Sep 17 21:53:32 BST 2011
Author: buckley Date: Sat Sep 17 21:53:31 2011 New Revision: 3371 Log: Improving interactive metadata printout, by not printing headings for missing info. Modified: trunk/ChangeLog trunk/bin/rivet Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Sat Sep 17 19:50:07 2011 (r3370) +++ trunk/ChangeLog Sat Sep 17 21:53:31 2011 (r3371) @@ -1,5 +1,8 @@ 2011-09-17 Andy Buckley <andy at insectnation.org> + * Improving interactive metadata printout, by not printing + headings for missing info. + * Bumping the release number to 1.7.0alpha0, since with these SPIRES/Inspire changes and the MissingMomentum API change we need more than a minor release. Modified: trunk/bin/rivet ============================================================================== --- trunk/bin/rivet Sat Sep 17 19:50:07 2011 (r3370) +++ trunk/bin/rivet Sat Sep 17 21:53:31 2011 (r3371) @@ -287,19 +287,26 @@ print "Inspire URL: http://inspire-hep.net/search?p=find+key+%s" % ana.spiresId() print "HepData URL: http://hepdata.cedar.ac.uk/view/irn%s" % ana.spiresId() - coll = "" - if ana.collider(): - coll = ana.collider() - print "Experiment: %s" % ana.experiment(), "(%s)" % coll - print "Year of publication: %s" % ana.year() + if ana.experiment(): + print "Experiment: %s" % ana.experiment(), + if ana.collider(): + print "(%s)" % ana.collider() + + if ana.year(): + print "Year of publication: %s" % ana.year() + print "Authors:" for a in ana.authors(): print " " + a + print "" + print "Description:" twrap = textwrap.TextWrapper(width=75, initial_indent=2*" ", subsequent_indent=2*" ") print twrap.fill(ana.description()) + print "" + if ana.requiredBeams(): def pid_to_str(pid): if pid == 11: @@ -318,14 +325,18 @@ for bp in ana.requiredBeams(): beamstrs.append(pid_to_str(bp[0]) + " " + pid_to_str(bp[1])) print "Beams:", ", ".join(beamstrs) + if ana.requiredEnergies(): print "Beam energies:", "; ".join(["(%0.1f, %0.1f)" % (epair[0], epair[1]) for epair in ana.requiredEnergies()]), "GeV" else: print "Beam energies: ANY" - print "Run details:" - twrap = textwrap.TextWrapper(width=75, initial_indent=2*" ", subsequent_indent=4*" ") - for l in ana.runInfo().split("\n"): - print twrap.fill(l) + + if ana.runInfo(): + print "Run details:" + twrap = textwrap.TextWrapper(width=75, initial_indent=2*" ", subsequent_indent=4*" ") + for l in ana.runInfo().split("\n"): + print twrap.fill(l) + if ana.references(): print "" print "References:"
More information about the Rivet-svn mailing list |