From 837cbb1ed5ab992e79162962ebe868f59f654735 Mon Sep 17 00:00:00 2001 From: erodrigu <eduardo.rodrigues@cern.ch> Date: Wed, 16 Nov 2022 18:10:16 +0100 Subject: [PATCH] Remove non-needed DaVinci/utils.py file --- Phys/DaVinci/python/DaVinci/utils.py | 29 ---------------------------- 1 file changed, 29 deletions(-) delete mode 100644 Phys/DaVinci/python/DaVinci/utils.py diff --git a/Phys/DaVinci/python/DaVinci/utils.py b/Phys/DaVinci/python/DaVinci/utils.py deleted file mode 100644 index 061a775c8..000000000 --- a/Phys/DaVinci/python/DaVinci/utils.py +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration # -# # -# This software is distributed under the terms of the GNU General Public # -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # -# # -# In applying this licence, CERN does not waive the privileges and immunities # -# granted to it by virtue of its status as an Intergovernmental Organization # -# or submit itself to any jurisdiction. # -############################################################################### -import os, XRootD.client - - -def load_file(fname): - if not fname: return None - - if fname.startswith("root://eoslhcb.cern.ch//"): - with XRootD.client.File() as f: - status, _ = f.open(str(fname)) - if not status.ok: - raise RuntimeError(f"could not open {fname}: {status.message}") - status, data = f.read() - if not status.ok: - raise RuntimeError(f"could not read {fname}: {status.message}") - return data.decode('utf-8') - else: - with open(os.path.expandvars(fname)) as f: - data = f.read() - return data.decode('utf-8') -- GitLab