devtools/instrument.py
changeset 10589 7c23b7de2b8d
parent 9368 10694dd136f3
child 10662 10942ed172de
equal deleted inserted replaced
10588:fdaa0e4b7eaf 10589:7c23b7de2b8d
    12 # details.
    12 # details.
    13 #
    13 #
    14 # You should have received a copy of the GNU Lesser General Public License along
    14 # You should have received a copy of the GNU Lesser General Public License along
    15 # with this program. If not, see <http://www.gnu.org/licenses/>.
    15 # with this program. If not, see <http://www.gnu.org/licenses/>.
    16 """Instrumentation utilities"""
    16 """Instrumentation utilities"""
       
    17 from __future__ import print_function
    17 
    18 
    18 import os
    19 import os
    19 
    20 
    20 try:
    21 try:
    21     import pygraphviz
    22     import pygraphviz
    43     except KeyError:
    44     except KeyError:
    44         _COLORS[key] = '#'+ALL_COLORS[len(_COLORS) % len(ALL_COLORS)]
    45         _COLORS[key] = '#'+ALL_COLORS[len(_COLORS) % len(ALL_COLORS)]
    45         return _COLORS[key]
    46         return _COLORS[key]
    46 
    47 
    47 def warn(msg, *args):
    48 def warn(msg, *args):
    48     print 'WARNING: %s' % (msg % args)
    49     print('WARNING: %s' % (msg % args))
    49 
    50 
    50 def info(msg):
    51 def info(msg):
    51     print 'INFO: ' + msg
    52     print('INFO: ' + msg)
    52 
    53 
    53 
    54 
    54 class PropagationAnalyzer(object):
    55 class PropagationAnalyzer(object):
    55     """Abstract propagation analyzer, providing utility function to extract
    56     """Abstract propagation analyzer, providing utility function to extract
    56     entities involved in propagation from a schema, as well as propagation
    57     entities involved in propagation from a schema, as well as propagation