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

All Samples(2438)  |  Call(2336)  |  Derive(0)  |  Import(102)
Insert an entry into the list of warnings filters (at the front).

'action' -- one of "error", "ignore", "always", "default", "module",
            or "once"
'message' -- a regex that the warning message must match
'category' -- a class that the warning must be a subclass of
'module' -- a regex that the module name must match
'lineno' -- an integer line number, 0 matches all warnings
'append' -- if true, append to the list of filters

        def filterwarnings(action, message="", category=Warning, module="", lineno=0,
                   append=0):
    """Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    """
    import re
    assert action in ("error", "ignore", "always", "default", "module",
                      "once"), "invalid action: %r" % (action,)
    assert isinstance(message, basestring), "message must be a string"
    assert isinstance(category, (type, types.ClassType)), \
           "category must be a class"
    assert issubclass(category, Warning), "category must be a Warning subclass"
    assert isinstance(module, basestring), "module must be a string"
    assert isinstance(lineno, int) and lineno >= 0, \
           "lineno must be an int >= 0"
    item = (action, re.compile(message, re.I), category,
            re.compile(module), lineno)
    if append:
        filters.append(item)
    else:
        filters.insert(0, item)
        


src/p/y/pylo-0.91.2/pylo/__init__.py   pylo(Download)
def _ignore_extra_int_vector_warning():
    from warnings import filterwarnings
    filterwarnings("ignore", module="pylo", category=RuntimeWarning, lineno=43)
_ignore_extra_int_vector_warning()
 
 
 

src/l/o/logbook-HEAD/logbook/notifiers.py   logbook(Download)
 
        # growl is using the deprecated md5 module, but we really don't need
        # to see that deprecation warning
        from warnings import filterwarnings
        filterwarnings(module='Growl', category=DeprecationWarning,
                       action='ignore')
 

src/l/o/Logbook-0.2.1/logbook/notifiers.py   Logbook(Download)
 
        # growl is using the deprecated md5 module, but we really don't need
        # to see that deprecation warning
        from warnings import filterwarnings
        filterwarnings(module='Growl', category=DeprecationWarning,
                       action='ignore')
 

src/p/e/pendrell-0.3.3/lib/error.py   pendrell(Download)
# Work around a bug in twisted.web.errors in python2.6
#   http://twistedmatrix.com/trac/ticket/4456
#
from warnings import filterwarnings
filterwarnings("ignore", category=DeprecationWarning,
        message="BaseException\.message has been deprecated as of Python 2\.6")
 

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/cgi.py   ironruby(Download)
import UserDict
import urlparse
 
from warnings import filterwarnings, catch_warnings, warn
with catch_warnings():
    if sys.py3kwarning:
        filterwarnings("ignore", ".*mimetools has been removed",
                       DeprecationWarning)
        filterwarnings("ignore", ".*rfc822 has been removed",

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/cgi.py   ironruby(Download)
import UserDict
import urlparse
 
from warnings import filterwarnings, catch_warnings, warn
with catch_warnings():
    if sys.py3kwarning:
        filterwarnings("ignore", ".*mimetools has been removed",
                       DeprecationWarning)
        filterwarnings("ignore", ".*rfc822 has been removed",

src/p/y/python-big-HEAD/nws/sleigh.py   python-big(Download)
from os import environ as _Env
from types import CodeType, FunctionType, BuiltinFunctionType, MethodType
from cStringIO import StringIO
from warnings import warn, filterwarnings
from urllib import quote_plus
 
from nws.client import NetWorkSpace, NwsServer, NwsNoWorkSpaceException
from nws.client import FIFO, DICT, V_VARIABLE, V_VALUES, V_FETCHERS, V_FINDERS, V_MODE
from nws.client import PROTOCOL_VERSION_OLD, PROTOCOL_VERSION_NEW_0
from nws.util import which, msc_quote
from nws import __version__
 
# Change the default warning filtering for this module
filterwarnings('always', module=__name__)

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/mimetools.py   ironruby(Download)
"""Various tools used by MIME-reading or MIME-writing programs."""
 
 
import os
import sys
import tempfile
from warnings import filterwarnings, catch_warnings
with catch_warnings():
    if sys.py3kwarning:
        filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/mimetools.py   ironruby(Download)
"""Various tools used by MIME-reading or MIME-writing programs."""
 
 
import os
import sys
import tempfile
from warnings import filterwarnings, catch_warnings
with catch_warnings():
    if sys.py3kwarning:
        filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)

src/b/a/badger-lib-HEAD/packages/Django/django/db/backends/mysql/base.py   badger-lib(Download)
# Raise exceptions for database warnings if DEBUG is on
from django.conf import settings
if settings.DEBUG:
    from warnings import filterwarnings
    filterwarnings("error", category=Database.Warning)
 
DatabaseError = Database.DatabaseError

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next