@@ -196,8 +196,8 @@ if __name__ == "__main__":
196196 help = "Get the XY data of an output" , metavar = "OUTPUT_ID" )
197197 parser .add_argument ("--items" , dest = "items" ,
198198 help = "The list of XY items requested" , nargs = "*" )
199- parser .add_argument ("--times " , dest = "times " ,
200- help = "The list of XY times requested" , nargs = "*" )
199+ parser .add_argument ("--time-range " , dest = "time_range " ,
200+ help = "The time range requested" , nargs = 3 , metavar = ( "START" , "END" , "NUM_TIMES" ) )
201201 parser .add_argument ("--uuid" , dest = "uuid" , help = "The UUID of a trace" )
202202 parser .add_argument ("--uuids" , dest = "uuids" ,
203203 help = "The list of UUIDs" , nargs = "*" )
@@ -370,20 +370,35 @@ if __name__ == "__main__":
370370 __get_tree (options .uuid , options .get_xy_tree , "TREE_TIME_XY" )
371371
372372 if options .get_xy :
373- if not options .items or not options .times :
374- print ("Provide requested --items and --times for the XY data" )
373+ if not options .items :
374+ print ("Provide requested --items for the XY data" )
375+ sys .exit (1 )
376+
377+ if not options .time_range :
378+ print ("Provide requested --time-range for the XY data" )
375379 sys .exit (1 )
376380
377381 if options .uuid is not None :
378- parameters = {TspClient .REQUESTED_TIME_KEY : list (map (int , options .times )),
379- TspClient .REQUESTED_ITEM_KEY : list (map (int , options .items ))}
382+ start_time = int (options .time_range [0 ])
383+ end_time = int (options .time_range [1 ])
384+ nb_times = int (options .time_range [2 ])
385+
386+ parameters = {
387+ TspClient .REQUESTED_ITEM_KEY : list (map (int , options .items )),
388+ TspClient .REQUESTED_TIME_RANGE_KEY : {
389+ TspClient .REQUESTED_TIME_RANGE_START_KEY : start_time ,
390+ TspClient .REQUESTED_TIME_RANGE_END_KEY : end_time ,
391+ TspClient .REQUESTED_TIME_RANGE_NUM_TIMES_KEY : nb_times
392+ }
393+ }
394+
380395 params = {TspClient .PARAMETERS_KEY : parameters }
381396
382397 response = tsp_client .fetch_xy (
383398 options .uuid , options .get_xy , params )
384399 if response .status_code == 200 :
385400 xyModel = response .model .model
386- xyModel .print ()
401+ xyModel .print (array_print = True )
387402 sys .exit (0 )
388403 else :
389404 sys .exit (1 )
0 commit comments