Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for i, dat in enumerate(sql_data):
trace = self.tmpdir / ('trace%d.sqlite3' % i)
if PY3:
conn = sqlite3.connect(str(trace))
else:
conn = sqlite3.connect(trace.path)
conn.row_factory = sqlite3.Row
conn.executescript(dat + 'COMMIT;')
conn.commit()
conn.close()
traces.append(trace)
target = self.tmpdir / 'target'
traceutils.combine_traces(traces, target)
target = target / 'trace.sqlite3'
if PY3:
conn = sqlite3.connect(str(target))
else:
conn = sqlite3.connect(target.path)
conn.row_factory = None
processes = list(conn.execute(
'''
SELECT * FROM processes;
'''))
opened_files = list(conn.execute(
'''
SELECT * FROM opened_files;
'''))
executed_files = list(conn.execute(
Reads in multiple trace databases and combines them into one.
The runs from the original traces are appended ('run_id' field gets
translated to avoid conflicts).
"""
traces = []
for tracepath in args.traces:
if tracepath == '-':
tracepath = Path(args.dir) / 'trace.sqlite3'
else:
tracepath = Path(tracepath)
if tracepath.is_dir():
tracepath = tracepath / 'trace.sqlite3'
traces.append(tracepath)
reprozip.traceutils.combine_traces(traces, Path(args.dir))
reprozip.tracer.trace.write_configuration(Path(args.dir),
args.identify_packages,
args.find_inputs_outputs,
overwrite=True)