def __init__(self, parent=None): QObject.__init__(self, parent) Extension.__init__(self) if FlameProfiler.enabled(): self.addMenuItem("Start BFG", startBFG) self.addMenuItem("Stop BFG", stopBFG) else: self.addMenuItem("<Profiling not activated>", noOp)
def profileEmit(func): if FlameProfiler.enabled(): @functools.wraps(func) 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) return wrapped else: return func
def profileEmit(function): if FlameProfiler.enabled(): @functools.wraps(function) def wrapped(self, *args, **kwargs): FlameProfiler.updateProfileConfig() if FlameProfiler.isRecordingProfile(): with FlameProfiler.profileCall("[SIG] " + self.getName()): function(self, *args, **kwargs) else: function(self, *args, **kwargs) return wrapped else: return function
def _recordSignalNames(): return FlameProfiler.enabled()