• Home
  • Raw
  • Download

Lines Matching refs:category

10 def showwarning(message, category, filename, lineno, file=None, line=None):  argument
12 msg = WarningMessage(message, category, filename, lineno, file, line)
15 def formatwarning(message, category, filename, lineno, line=None): argument
17 msg = WarningMessage(message, category, filename, lineno, None, line)
36 category = msg.category.__name__
109 sw(msg.message, msg.category, msg.filename, msg.lineno,
126 return fw(msg.message, msg.category,
130 def filterwarnings(action, message="", category=Warning, module="", lineno=0, argument
145 assert isinstance(category, type), "category must be a class"
146 assert issubclass(category, Warning), "category must be a Warning subclass"
163 _add_filter(action, message, category, module, lineno, append=append)
165 def simplefilter(action, category=Warning, lineno=0, append=False): argument
179 _add_filter(action, None, category, None, lineno, append=append)
219 action, message, category, module, lineno = [s.strip()
222 category = _getcategory(category)
238 filterwarnings(action, message, category, module, lineno)
251 def _getcategory(category): argument
252 if not category:
254 if '.' not in category:
256 klass = category
258 module, _, klass = category.rpartition('.')
266 raise _OptionError("unknown warning category: %r" % (category,)) from None
268 raise _OptionError("invalid warning category: %r" % (category,))
287 def warn(message, category=None, stacklevel=1, source=None): argument
291 category = message.__class__
293 if category is None:
294 category = UserWarning
295 if not (isinstance(category, type) and issubclass(category, Warning)):
297 "not '{:s}'".format(type(category).__name__))
324 warn_explicit(message, category, filename, lineno, module, registry,
327 def warn_explicit(message, category, filename, lineno, argument
342 category = message.__class__
345 message = category(message)
346 key = (text, category, lineno)
354 issubclass(category, cat) and
374 oncekey = (text, category)
382 altkey = (text, category, 0)
394 msg = WarningMessage(message, category, filename, lineno, source)
403 def __init__(self, message, category, filename, lineno, file=None, argument
406 self.category = category
412 self._category_name = category.__name__ if category else None
506 warn(msg, category=RuntimeWarning, stacklevel=2, source=coro)
542 filterwarnings("default", category=DeprecationWarning,
544 simplefilter("ignore", category=DeprecationWarning, append=1)
545 simplefilter("ignore", category=PendingDeprecationWarning, append=1)
546 simplefilter("ignore", category=ImportWarning, append=1)
547 simplefilter("ignore", category=ResourceWarning, append=1)