Extract parse_args methods
This commit is contained in:
parent
3ea4a1c5bb
commit
0a04d24fd4
2 changed files with 12 additions and 4 deletions
|
@ -8,13 +8,17 @@ from pickle import Pickler
|
|||
from tracetools_analysis.conversion import ctf
|
||||
|
||||
|
||||
def main():
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='Convert CTF trace data to a pickle file.')
|
||||
parser.add_argument('trace_directory',
|
||||
help='the path to the main CTF trace directory')
|
||||
parser.add_argument('pickle_file',
|
||||
help='the target pickle file to generate')
|
||||
args = parser.parse_args()
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
|
||||
trace_directory = args.trace_directory
|
||||
pickle_target_file = args.pickle_file
|
||||
|
|
|
@ -7,11 +7,15 @@ import pickle
|
|||
from tracetools_analysis.analysis import ros_processor, to_pandas
|
||||
|
||||
|
||||
def main():
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='Process a pickle file generated from tracing and analyze the data.')
|
||||
parser.add_argument('pickle_file',
|
||||
help='the pickle file to import')
|
||||
args = parser.parse_args()
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
|
||||
pickle_filename = args.pickle_file
|
||||
with open(pickle_filename, 'rb') as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue