Base class to hold / interpret general metadata
Definition at line 33 of file extractor_dict.py.
def python.extractor_dict.MetaData.__init__ |
( |
|
self, |
|
|
|
inputfile |
|
) |
| |
def python.extractor_dict.MetaData.extract_metadata_to_pipe |
( |
|
self | ) |
|
Extract metadata from inputfile into a pipe for further processing.
Definition at line 41 of file extractor_dict.py.
42 """Extract metadata from inputfile into a pipe for further processing.""" 43 local = project_utilities.path_to_local(self.
inputfile)
45 proc = Popen([
"sam_metadata_dumper", local], stdout=PIPE,
48 url = project_utilities.path_to_url(inputfile)
49 proc = Popen([
"sam_metadata_dumper", url], stdout=PIPE,
51 if len(local) > 0
and local != self.
inputfile:
def python.extractor_dict.MetaData.get_job |
( |
|
self, |
|
|
|
proc |
|
) |
| |
Run the proc in a 60-sec timeout queue, return stdout, stderr
Definition at line 55 of file extractor_dict.py.
56 """Run the proc in a 60-sec timeout queue, return stdout, stderr""" 60 thread.join(timeout=60)
62 print(
'Terminating subprocess because of timeout.')
69 raise RuntimeError(
'sam_metadata_dumper returned nonzero exit status {}.'.
format(rc))
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
def python.extractor_dict.MetaData.md_handle_application |
( |
|
md | ) |
|
|
static |
If there's no application key in md dict, create the key with a blank dictionary.
Then return md['application'], along with mdval
Definition at line 95 of file extractor_dict.py.
96 """If there's no application key in md dict, create the key with a blank dictionary. 97 Then return md['application'], along with mdval""" 98 if 'application' not in md:
99 md[
'application'] = {}
100 return md[
'application']
def python.extractor_dict.MetaData.mdart_gen |
( |
|
jobtuple | ) |
|
|
static |
Take Jobout and Joberr (in jobtuple) and return mdart object from that
Definition at line 84 of file extractor_dict.py.
85 """Take Jobout and Joberr (in jobtuple) and return mdart object from that""" 86 mdtext =
''.join(line.replace(
", ,",
",")
for line
in jobtuple[0].
split(
'\n')
if line[-3:-1] !=
' ,')
87 mdtop = json.JSONDecoder().
decode(mdtext)
88 if len(list(mdtop.keys())) == 0:
89 print(
'No top-level key in extracted metadata.')
91 file_name = list(mdtop.keys())[0]
92 return mdtop[file_name]
void decode(std::any const &a, Hep2Vector &result)
void split(std::string const &s, char c, OutIter dest)
def python.extractor_dict.MetaData.wait_for_subprocess |
( |
|
jobinfo, |
|
|
|
q |
|
) |
| |
|
static |
Run jobinfo, put the return code, stdout, and stderr into a queue
Definition at line 73 of file extractor_dict.py.
74 """Run jobinfo, put the return code, stdout, and stderr into a queue""" 75 jobout, joberr = jobinfo.communicate()
79 for item
in (rc, jobout, joberr):
python.extractor_dict.MetaData.__metaclass__ = abc.ABCMeta |
|
staticprivate |
python.extractor_dict.MetaData.inputfile |
The documentation for this class was generated from the following file: