ATLAS Offline Software
Loading...
Searching...
No Matches
output_tarball_preparer.py
Go to the documentation of this file.
1# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2
3from AthenaCommon import Logging
4from ...decorators import timed
5import subprocess
6
7
8logger = Logging.logging.getLogger("PowhegControl")
9
10
11@timed("output tarball preparer")
12def output_tarball_preparer(output_events_name, output_tarball_name):
13 """! Tar events if LHE output is requested.
14
15 @param output_events_name LHE events file name.
16 @param output_tarball_name Tar-ed LHE file name.
17
18 @author James Robinson <james.robinson@cern.ch>
19 """
20 logger.info("Tar-ing output events into {}".format(output_tarball_name))
21 for line in subprocess.check_output(["tar", "cvzf", output_tarball_name, output_events_name], stderr=subprocess.STDOUT).splitlines():
22 logger.info(line)