From e2783ff955a73a5bd9f6a37e7f61eed45a38aa9c Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 9 Mar 2016 18:27:48 +0000
Subject: [PATCH] DDSim: Fix bugs for dumpingSteeringFile or parameters

Do not print error messages when dumping SteeringFile or parameters
Fix crash when dumping steeringfile
---
 DDSim/DD4hepSimulation.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/DDSim/DD4hepSimulation.py b/DDSim/DD4hepSimulation.py
index 888a79a36..8719dfcf4 100644
--- a/DDSim/DD4hepSimulation.py
+++ b/DDSim/DD4hepSimulation.py
@@ -211,12 +211,11 @@ class DD4hepSimulation(object):
 
     #self.__treatUnknownArgs( parsed, unknown )
     self.__parseAllHelper( parsed )
-    if self._errorMessages:
+    if self._errorMessages and not (self._dumpParameter or self._dumpSteeringFile):
       parser.epilog = "\n".join(self._errorMessages)
       parser.print_help()
       exit(1)
 
-
     if self._dumpParameter:
       from pprint import pprint
       print "="*80
@@ -607,7 +606,7 @@ SIM = DD4hepSimulation()
         steeringFileBase += "################################################################################\n"
         options = parameter.getOptions()
         for opt,valAndDoc in sorted( options.iteritems(), sortParameters ):
-          parValue, parDoc = valAndDoc
+          parValue, parDoc, _parOptions = valAndDoc
           if parDoc:
             steeringFileBase += "\n## %s\n" % "\n## ".join(parDoc.splitlines())
           ## add quotes if it is a string
-- 
GitLab