From 48f5b0909e71bc0d7add33816a04b31eff3bf8d3 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 11 Nov 2020 15:03:00 +0100
Subject: [PATCH] Prophecy4fControl: enable flake8 and make code compliant

---
 Generators/Prophecy4fControl/CMakeLists.txt              | 2 +-
 Generators/Prophecy4fControl/python/DecoratorFactory.py  | 4 ++--
 Generators/Prophecy4fControl/python/ProphecyConfig.py    | 5 +++--
 .../Prophecy4fControl/python/ProphecyPowhegDefault.py    | 3 ++-
 .../Prophecy4fControl/python/ProphecyPowhegMerge.py      | 4 ++--
 Generators/Prophecy4fControl/python/__init__.py          | 9 +++++----
 .../python/decorators/DecoratorFromDefault.py            | 2 +-
 .../python/decorators/DecoratorFromPowheg.py             | 2 +-
 .../Prophecy4fControl/python/decorators/__init__.py      | 5 +++--
 9 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/Generators/Prophecy4fControl/CMakeLists.txt b/Generators/Prophecy4fControl/CMakeLists.txt
index ab8154addd4..62d883c1712 100644
--- a/Generators/Prophecy4fControl/CMakeLists.txt
+++ b/Generators/Prophecy4fControl/CMakeLists.txt
@@ -15,6 +15,6 @@ atlas_add_executable( DRM
                       LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py python/decorators )
+atlas_install_python_modules( python/*.py python/decorators POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
 
diff --git a/Generators/Prophecy4fControl/python/DecoratorFactory.py b/Generators/Prophecy4fControl/python/DecoratorFactory.py
index 60b329bf5a8..998d37b19c1 100644
--- a/Generators/Prophecy4fControl/python/DecoratorFactory.py
+++ b/Generators/Prophecy4fControl/python/DecoratorFactory.py
@@ -1,6 +1,6 @@
-#! /usr/bin/env python
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-from decorators import *
+from decorators import DecoratorFromDefault, DecoratorFromPowheg
 
 def decorate( prophecy_controller, decorator, **kwargs ) :
   ## Initialise correct decorator for Prophecy configurable
diff --git a/Generators/Prophecy4fControl/python/ProphecyConfig.py b/Generators/Prophecy4fControl/python/ProphecyConfig.py
index 6f7cbedd16d..40682d29ae0 100644
--- a/Generators/Prophecy4fControl/python/ProphecyConfig.py
+++ b/Generators/Prophecy4fControl/python/ProphecyConfig.py
@@ -1,4 +1,5 @@
-#! /usr/bin/env python
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
 import os, subprocess, time
 from DecoratorFactory import decorate
 from AthenaCommon import Logging
@@ -33,7 +34,7 @@ class ProphecyConfig(object) :
     self.add_parameter_set( 'fromDefault' )
 
     ## Initialise values from runArgs
-    if runArgs == None :
+    if runArgs is None :
       self.logger.warning( 'No run arguments found! Using defaults.' )
     else :
       # Read values from runArgs
diff --git a/Generators/Prophecy4fControl/python/ProphecyPowhegDefault.py b/Generators/Prophecy4fControl/python/ProphecyPowhegDefault.py
index 7e27b8b9067..49fdc5a5f88 100644
--- a/Generators/Prophecy4fControl/python/ProphecyPowhegDefault.py
+++ b/Generators/Prophecy4fControl/python/ProphecyPowhegDefault.py
@@ -1,4 +1,5 @@
-#! /usr/bin/env python
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
 from ProphecyConfig import ProphecyConfig
 
 class ProphecyPowhegDefault(ProphecyConfig) :
diff --git a/Generators/Prophecy4fControl/python/ProphecyPowhegMerge.py b/Generators/Prophecy4fControl/python/ProphecyPowhegMerge.py
index 4a60dcf5fba..129415436a6 100644
--- a/Generators/Prophecy4fControl/python/ProphecyPowhegMerge.py
+++ b/Generators/Prophecy4fControl/python/ProphecyPowhegMerge.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 import os, subprocess, time, glob
 from AthenaCommon import Logging
 from PowhegControl import RepeatingTimer
@@ -26,7 +26,7 @@ class ProphecyPowhegMerge(object) :
     self.__input_prophecy_file_name = 'ProphecyOTF._1.events'
 
     ## Initialise values from runArgs
-    if runArgs == None :
+    if runArgs is None :
       self.logger.warning( 'No run arguments found! Using defaults.' )
     else :
       # Read values from runArgs
diff --git a/Generators/Prophecy4fControl/python/__init__.py b/Generators/Prophecy4fControl/python/__init__.py
index 9ee08c96c73..88d7b729811 100644
--- a/Generators/Prophecy4fControl/python/__init__.py
+++ b/Generators/Prophecy4fControl/python/__init__.py
@@ -1,4 +1,5 @@
-from ProphecyConfig import *
-from ProphecyPowhegDefault import *
-from ProphecyPowhegMerge import *
-from .decorators import *
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+from ProphecyConfig import *          # noqa: F401, F403
+from ProphecyPowhegDefault import *   # noqa: F401, F403
+from ProphecyPowhegMerge import *     # noqa: F401, F403
+from .decorators import *             # noqa: F401, F403
diff --git a/Generators/Prophecy4fControl/python/decorators/DecoratorFromDefault.py b/Generators/Prophecy4fControl/python/decorators/DecoratorFromDefault.py
index ebff63cbf61..7a1343df896 100644
--- a/Generators/Prophecy4fControl/python/decorators/DecoratorFromDefault.py
+++ b/Generators/Prophecy4fControl/python/decorators/DecoratorFromDefault.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 class DecoratorFromDefault(object) :
 
diff --git a/Generators/Prophecy4fControl/python/decorators/DecoratorFromPowheg.py b/Generators/Prophecy4fControl/python/decorators/DecoratorFromPowheg.py
index 5e77016e9fc..98c74d5f024 100644
--- a/Generators/Prophecy4fControl/python/decorators/DecoratorFromPowheg.py
+++ b/Generators/Prophecy4fControl/python/decorators/DecoratorFromPowheg.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from PowhegControl import ATLASCommonParameters
 
diff --git a/Generators/Prophecy4fControl/python/decorators/__init__.py b/Generators/Prophecy4fControl/python/decorators/__init__.py
index 6e4d88587e9..a2de9e3a2ab 100644
--- a/Generators/Prophecy4fControl/python/decorators/__init__.py
+++ b/Generators/Prophecy4fControl/python/decorators/__init__.py
@@ -1,2 +1,3 @@
-from DecoratorFromDefault import *
-from DecoratorFromPowheg import *
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+from DecoratorFromDefault import *  # noqa: F401, F403
+from DecoratorFromPowheg import *   # noqa: F401, F403
-- 
GitLab