@@ -354,7 +354,7 @@ def get_adapter_type():
354354 """
355355 return
356356
357- def _dispatch_on_get_connections (self ) -> list :
357+ def on_get_connections (self ) -> list :
358358 """
359359 The OnGetConnections() method returns all of the targets of any SendRequestSync or SendRequestAsync
360360 calls for the class. Implement this method to allow connections between components to show up in
@@ -369,19 +369,42 @@ def _dispatch_on_get_connections(self) -> list:
369369 # get the source code of the class
370370 source = getsource (self .__class__ )
371371 # find all invocations of send_request_sync and send_request_async
372- for method in ['send_request_sync' ,'send_request_async' ]:
372+ for method in ['send_request_sync' ,'send_request_async' , 'SendRequestSync' , 'SendRequestAsync' ]:
373373 i = source .find (method )
374374 while i != - 1 :
375375 j = source .find ("(" ,i )
376376 if j != - 1 :
377377 k = source .find ("," ,j )
378378 if k != - 1 :
379379 target = source [j + 1 :k ]
380- # trim " and ' from target
381- target = target .strip ('\' ' ).strip ('\" ' )
380+ if target .find ("=" ) != - 1 :
381+ # it's a keyword argument, remove the keyword
382+ target = target [target .find ("=" )+ 1 :].strip ()
382383 if target not in targer_list :
383384 targer_list .append (target )
384385 i = source .find (method ,i + 1 )
386+
387+ for target in targer_list :
388+ # if target is a string, remove the quotes
389+ if target [0 ] == "'" and target [- 1 ] == "'" :
390+ targer_list [targer_list .index (target )] = target [1 :- 1 ]
391+ elif target [0 ] == '"' and target [- 1 ] == '"' :
392+ targer_list [targer_list .index (target )] = target [1 :- 1 ]
393+ # if target is a variable, try to find the value of the variable
394+ else :
395+ self .on_init ()
396+ try :
397+ if target .find ("self." ) != - 1 :
398+ # it's a class variable
399+ targer_list [targer_list .index (target )] = getattr (self ,target [target .find ("." )+ 1 :])
400+ elif target .find ("." ) != - 1 :
401+ # it's a class variable
402+ targer_list [targer_list .index (target )] = getattr (getattr (self ,target [:target .find ("." )]),target [target .find ("." )+ 1 :])
403+ else :
404+ targer_list [targer_list .index (target )] = getattr (self ,target )
405+ except Exception as e :
406+ pass
407+
385408 return targer_list
386409
387410# It's a subclass of the standard JSONEncoder class that knows how to encode date/time, decimal types,
0 commit comments