diff --git a/Phys/DaVinci/python/DaVinci/utils.py b/Phys/DaVinci/python/DaVinci/utils.py deleted file mode 100644 index 061a775c87201de39e46926d77d6f20d611b50a1..0000000000000000000000000000000000000000 --- 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')