@@ -0,0 +1,1800 @@
+# -*- coding: utf-8 -*-%0A#------------------------------------------------------------------------------%0A#  Package: Pikos toolkit%0A#  File: monitors/monitor_attach.py%0A#  License: LICENSE.TXT%0A#%0A#  Copyright (c) 2012, Enthought, Inc.%0A#  All rights reserved.%0A#------------------------------------------------------------------------------%0Afrom pikos.monitors.monitor_attach import MonitorAttach%0A%0A%0Aclass FocusedMonitorAttach(MonitorAttach):%0A    %22%22%22 The monitor attach decorator for focused monitors.%0A%0A    This class provides the option for the decorated function to be added in%0A    the set of functions where the monitor will focus.%0A%0A    %22%22%22%0A    def __init__(self, obj,  include_decorated=False):%0A        %22%22%22 Class initialization.%0A%0A        Parameters%0A        ----------%0A        obj : object%0A            A contect manager to monitor, inspect or profile the decorated%0A            function while it is executed.%0A%0A        include_decorated : boolean%0A            If the decorated function should be included into the list of%0A            focused functions. Default is False.%0A%0A        %22%22%22%0A        super(FocusedMonitorAttach, self).__init__(obj)%0A        self._include_decorated = include_decorated%0A%0A    def _wrap_function(self, function):%0A        %22%22%22 Wrap a normal callable object.%0A        %22%22%22%0A        if self._include_decorated:%0A            self._add_function(function)%0A        return super(FocusedMonitorAttach, self)._wrap_function(function)%0A%0A    def _wrap_generator(self, function):%0A        %22%22%22 Wrap a generator function.%0A        %22%22%22%0A        if self._include_decorated:%0A            self._add_function(function)%0A        return super(FocusedMonitorAttach, self)._wrap_generator(function)%0A%0A    def _add_function(self, function):%0A        functions = self._monitor_object.functions%0A        functions.add(function)%0A

Add a new MonitorAttach class for Focused monitors