@@ -568,7 +568,7 @@ def dict_to_jsonable(src_dict):
568
568
569
569
570
570
def write_json_to_file (
571
- data , subdir , fname , desc , listener = None , normalize_name = False
571
+ data , subdir , fname , desc , listener = None , normalize_name = False , ts = None
572
572
):
573
573
if listener is None or subdir == "local" :
574
574
base_dir = os .path .dirname (__file__ )
@@ -579,6 +579,12 @@ def write_json_to_file(
579
579
if not os .path .isdir (out_dir ):
580
580
os .mkdir (out_dir )
581
581
582
+ if ts is not None :
583
+ if '.' in fname :
584
+ base , ext = fname .rsplit ('.' , 1 )
585
+ fname = base + '_' + ts + '.' + ext
586
+ else :
587
+ fname = fname + '_' + ts
582
588
if normalize_name :
583
589
file_name = os .path .join (out_dir , normalize_filename (fname ))
584
590
else :
@@ -903,6 +909,8 @@ def extractParams( # noqa: C901
903
909
p .DOWNLOAD : None ,
904
910
p .PATH : None ,
905
911
p .USE_CACHE : False ,
912
+ p .JSON_OUT : None ,
913
+ p .JSON_TIMESTAMP : False ,
906
914
}
907
915
908
916
# Endpoint to send command to
@@ -1055,6 +1063,12 @@ def extractParams( # noqa: C901
1055
1063
if P .CSVLABEL in rawParams :
1056
1064
params [p .CSV_LABEL ] = rawParams [P .CSVLABEL ]
1057
1065
1066
+ if P .JSON_OUT in rawParams :
1067
+ params [p .JSON_OUT ] = rawParams [P .JSON_OUT ]
1068
+
1069
+ if P .JSON_TIMESTAMP in rawParams :
1070
+ params [p .JSON_TIMESTAMP ] = rawParams [P .JSON_TIMESTAMP ]
1071
+
1058
1072
return params
1059
1073
1060
1074
0 commit comments