From f59ab15dfaf15f4975f15b6d7f3d4fdc3fe00ddd Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 9 Mar 2023 11:28:01 +0100
Subject: [PATCH] DDSim.Output: simplify CHOICES config

---
 DDG4/python/DDSim/Helper/Output.py | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/DDG4/python/DDSim/Helper/Output.py b/DDG4/python/DDSim/Helper/Output.py
index cd81f68fe..bb7916aca 100644
--- a/DDG4/python/DDSim/Helper/Output.py
+++ b/DDG4/python/DDSim/Helper/Output.py
@@ -3,6 +3,9 @@
 from __future__ import absolute_import, unicode_literals
 from DDSim.Helper.ConfigHelper import ConfigHelper
 
+OUTPUT_CHOICES = (1, 2, 3, 4, 5, 6, 7, 'VERBOSE', 'DEBUG',
+                  'INFO', 'WARNING', 'ERROR', 'FATAL', 'ALWAYS')
+
 
 def outputLevelType(level):
   """Return verbosity level as integer if possible.
@@ -36,28 +39,16 @@ class Output(ConfigHelper):
 
   def __init__(self):
     super(Output, self).__init__()
-    self._kernel_EXTRA = {'choices': (1, 2, 3, 4, 5, 6, 7, 'VERBOSE', 'DEBUG',
-                                      'INFO', 'WARNING', 'ERROR', 'FATAL', 'ALWAYS'),
-                          'type': outputLevelType,
-                          }
+    self._kernel_EXTRA = {'choices': OUTPUT_CHOICES, 'type': outputLevelType}
     self._kernel = outputLevel('INFO')
 
-    self._part_EXTRA = {'choices': (1, 2, 3, 4, 5, 6, 7, 'VERBOSE', 'DEBUG',
-                                    'INFO', 'WARNING', 'ERROR', 'FATAL', 'ALWAYS'),
-                        'type': outputLevelType,
-                        }
+    self._part_EXTRA = {'choices': OUTPUT_CHOICES, 'type': outputLevelType}
     self._part = outputLevel('INFO')
 
-    self._inputStage_EXTRA = {'choices': (1, 2, 3, 4, 5, 6, 7, 'VERBOSE', 'DEBUG',
-                                          'INFO', 'WARNING', 'ERROR', 'FATAL', 'ALWAYS'),
-                              'type': outputLevelType,
-                              }
+    self._inputStage_EXTRA = {'choices': OUTPUT_CHOICES, 'type': outputLevelType}
     self._inputStage = outputLevel('INFO')
 
-    self._random_EXTRA = {'choices': (1, 2, 3, 4, 5, 6, 7, 'VERBOSE', 'DEBUG',
-                                      'INFO', 'WARNING', 'ERROR', 'FATAL', 'ALWAYS'),
-                          'type': outputLevelType,
-                          }
+    self._random_EXTRA = {'choices': OUTPUT_CHOICES, 'type': outputLevelType}
     self._random = outputLevel('FATAL')
 
   @property
-- 
GitLab