File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 35
35
from datetime import datetime as dt
36
36
from dateutil .parser import parse as parseutc
37
37
from warnings import warn
38
-
38
+ import simplejson as json
39
39
40
40
from .traits_extension import (traits , Undefined , TraitDictObject ,
41
41
TraitListObject , TraitError ,
@@ -1148,6 +1148,15 @@ def version(self):
1148
1148
self .__class__ .__name__ )
1149
1149
return self ._version
1150
1150
1151
+ def load_inputs_from_json (self , json_file ):
1152
+ with open (json_file ) as fhandle :
1153
+ inputs_dict = json .load (fhandle )
1154
+
1155
+ for key , val in list (inputs_dict .items ()):
1156
+ if not isdefined (getattr (self .inputs , key , Undefined )):
1157
+ setattr (self .inputs , key , val )
1158
+
1159
+
1151
1160
1152
1161
class Stream (object ):
1153
1162
"""Function to capture stdout and stderr streams with timestamps
You can’t perform that action at this time.
0 commit comments