• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(44)  |  Call(43)  |  Derive(0)  |  Import(1)
Function to format a warning the standard way.

        def formatwarning(message, category, filename, lineno, line=None):
    """Function to format a warning the standard way."""
    s =  "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
    line = linecache.getline(filename, lineno) if line is None else line
    if line:
        line = line.strip()
        s += "  %s\n" % line
    return s
        


src/p/y/pymel-HEAD/pymel/internal/pwarnings.py   pymel(Download)
 
"""
import warnings
from warnings import formatwarning, linecache
 
def formatwarning(message, category, filename, lineno, line=None):
    """Redefined format warning for maya."""