Base class to hold / interpret general metadata
Definition at line 30 of file extractor_dict.py.
def extractor_dict.MetaData.__init__ |
( |
|
self, |
|
|
|
inputfile |
|
) |
| |
def extractor_dict.MetaData.extract_metadata_to_pipe |
( |
|
self | ) |
|
Extract metadata from inputfile into a pipe for further processing.
Definition at line 38 of file extractor_dict.py.
39 """Extract metadata from inputfile into a pipe for further processing.""" 40 local = project_utilities.path_to_local(self.
inputfile)
42 proc = Popen([
"sam_metadata_dumper", local], stdout=PIPE,
45 url = project_utilities.path_to_url(inputfile)
46 proc = Popen([
"sam_metadata_dumper", url], stdout=PIPE,
48 if len(local) > 0
and local != self.
inputfile:
def extractor_dict.MetaData.get_job |
( |
|
self, |
|
|
|
proc |
|
) |
| |
Run the proc in a 60-sec timeout queue, return stdout, stderr
Definition at line 52 of file extractor_dict.py.
53 """Run the proc in a 60-sec timeout queue, return stdout, stderr""" 57 thread.join(timeout=60)
59 print(
'Terminating subprocess because of timeout.')
66 raise RuntimeError(
'sam_metadata_dumper returned nonzero exit status {}.'.
format(rc))
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
def 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 90 of file extractor_dict.py.
91 """If there's no application key in md dict, create the key with a blank dictionary. 92 Then return md['application'], along with mdval""" 93 if 'application' not in md:
94 md[
'application'] = {}
95 return md[
'application']
def extractor_dict.MetaData.mdart_gen |
( |
|
jobtuple | ) |
|
|
static |
Take Jobout and Joberr (in jobtuple) and return mdart object from that
Definition at line 79 of file extractor_dict.py.
80 """Take Jobout and Joberr (in jobtuple) and return mdart object from that""" 81 mdtext =
''.join(line.replace(
", ,",
",")
for line
in jobtuple[0].
split(
'\n')
if line[-3:-1] !=
' ,')
82 mdtop = json.JSONDecoder().
decode(mdtext)
83 if len(mdtop.keys()) == 0:
84 print(
'No top-level key in extracted metadata.')
86 file_name = mdtop.keys()[0]
87 return mdtop[file_name]
void decode(std::any const &a, Hep2Vector &result)
void split(std::string const &s, char c, OutIter dest)
def extractor_dict.MetaData.wait_for_subprocess |
( |
|
jobinfo, |
|
|
|
q |
|
) |
| |
|
static |
Run jobinfo, put the return code, stdout, and stderr into a queue
Definition at line 70 of file extractor_dict.py.
71 """Run jobinfo, put the return code, stdout, and stderr into a queue""" 72 jobout, joberr = jobinfo.communicate()
74 for item
in (rc, jobout, joberr):
extractor_dict.MetaData.__metaclass__ = abc.ABCMeta |
|
staticprivate |
extractor_dict.MetaData.inputfile |
The documentation for this class was generated from the following file: