def wrapped(self, *args, **kwargs): FlameProfiler.updateProfileConfig() if FlameProfiler.isRecordingProfile(): with FlameProfiler.profileCall("[SIG] " + self.getName()): func(self, *args, **kwargs) else: func(self, *args, **kwargs)
def __performEmit(self, *args, **kwargs): # Quickly make some private references to the collections we need to process. # Although the these fields are always safe to use read and use with regards to threading, # we want to operate on a consistent snapshot of the whole set of fields. with self.__lock: functions = self.__functions methods = self.__methods signals = self.__signals if not FlameProfiler.isRecordingProfile(): # Call handler functions for func in functions: func(*args, **kwargs) # Call handler methods for dest, func in methods: func(dest, *args, **kwargs) # Emit connected signals for signal in signals: signal.emit(*args, **kwargs) else: # Call handler functions for func in functions: with FlameProfiler.profileCall(func.__qualname__): func(*args, **kwargs) # Call handler methods for dest, func in methods: with FlameProfiler.profileCall(func.__qualname__): func(dest, *args, **kwargs) # Emit connected signals for signal in signals: with FlameProfiler.profileCall("[SIG]" + signal.getName()): signal.emit(*args, **kwargs)