/usr/share/pyshared/classytags/exceptions.py is in python-django-classy-tags 0.3.4.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | from django.template import TemplateSyntaxError
__all__ = ['ArgumentRequiredError', 'InvalidFlag', 'BreakpointExpected',
'TooManyArguments']
class BaseError(TemplateSyntaxError):
template = ''
def __str__(self): # pragma: no cover
return self.template % self.__dict__
class ArgumentRequiredError(BaseError):
template = "The tag '%(tagname)s' requires the '%(argname)s' argument."
def __init__(self, argument, tagname):
self.argument = argument
self.tagname = tagname
self.argname = self.argument.name
class InvalidFlag(BaseError):
template = ("The flag '%(argname)s' for the tag '%(tagname)s' must be one "
"of %(allowed_values)s, but got '%(actual_value)s'")
def __init__(self, argname, actual_value, allowed_values, tagname):
self.argname = argname
self.tagname = tagname
self.actual_value = actual_value
self.allowed_values = allowed_values
class BreakpointExpected(BaseError):
template = ("Expected one of the following breakpoints: %(breakpoints)s "
"in %(tagname)s, got '%(got)s' instead.")
def __init__(self, tagname, breakpoints, got):
self.breakpoints = ', '.join(["'%s'" % bp for bp in breakpoints])
self.tagname = tagname
self.got = got
class TooManyArguments(BaseError):
template = "The tag '%(tagname)s' got too many arguments: %(extra)s"
def __init__(self, tagname, extra):
self.tagname = tagname
self.extra = ', '.join(["'%s'" % e for e in extra])
class TemplateSyntaxWarning(Warning):
"""
Used for variable cleaning TemplateSyntaxErrors when in non-debug-mode.
"""
|