@@ -136,9 +136,9 @@ def to_parchmint_v1_2(self):
136136 dict: dictionary that can be used in json.dumps()
137137 """
138138 return {
139- "source" : None
140- if self .__source is None
141- else self . __source . to_parchmint_v1 ( ),
139+ "source" : (
140+ None if self .__source is None else self . __source . to_parchmint_v1 ()
141+ ),
142142 "sink" : None if self .__sink is None else self .__sink .to_parchmint_v1 (),
143143 "wayPoints" : [list (wp ) for wp in self .__waypoints ],
144144 "features" : [feat .ID for feat in self .__features ],
@@ -268,9 +268,9 @@ def to_parchmint_v1(self):
268268 "sinks" : [s .to_parchmint_v1 () for s in self .sinks ],
269269 "name" : self .name ,
270270 "id" : self .ID ,
271- "source" : self . source . to_parchmint_v1 ()
272- if self .source is not None
273- else None ,
271+ "source" : (
272+ self . source . to_parchmint_v1 () if self .source is not None else None
273+ ) ,
274274 "params" : self .params .to_parchmint_v1 (),
275275 "layer" : self .layer .ID if self .layer is not None else None ,
276276 }
@@ -372,9 +372,11 @@ def from_parchmint_v1_2(json_data: Dict, device_ref: Device) -> Connection:
372372 entity = json_data ["entity" ],
373373 params = Params (json_data ["params" ]),
374374 source = Target (json_data = json_data ["source" ]),
375- sinks = [Target (json_data = sink ) for sink in json_data ["sinks" ]]
376- if "sinks" in json_data .keys ()
377- else [],
375+ sinks = (
376+ [Target (json_data = sink ) for sink in json_data ["sinks" ]]
377+ if "sinks" in json_data .keys ()
378+ else []
379+ ),
378380 paths = [
379381 ConnectionPath .from_parchmint_v1_2 (path , device_ref )
380382 for path in json_data ["paths" ]
0 commit comments