source: tracformsplugin/trunk/tracforms/errors.py

Last change on this file was 16384, checked in by Ryan J Ollos, 7 years ago

TracForms 0.5dev: Conform to PEP8

File size: 830 bytes
RevLine 
[9984]1# -*- coding: utf-8 -*-
[3968]2
[10044]3from api import _
[10021]4
[10044]5__all__ = ['FormError', 'FormTooManyValuesError',
6           'FormNoOperationError', 'FormNoCommandError']
[10021]7
8
[10044]9class FormError(Exception):
[3968]10    def __str__(self):
11        return self.message % self.args
12
[10021]13
[10044]14class FormTooManyValuesError(FormError):
[3968]15    def __init__(self, name):
[10044]16        FormError.__init__(self, name)
[3968]17
[10021]18    message = _(
[10079]19        """ERROR: Too many values for TracForms form variable %r
[10021]20        (maybe the same field is being used multiple times?)""")
[3968]21
[10021]22
[10044]23class FormNoOperationError(FormError):
[3968]24    def __init__(self, name):
[10044]25        FormError.__init__(self, name)
[3968]26
[10044]27    message = _("ERROR: No TracForms operation '%r'")
[3968]28
[10021]29
[10044]30class FormNoCommandError(FormError):
[3968]31    def __init__(self, name):
[10044]32        FormError.__init__(self, name)
[3968]33
[10044]34    message = _("ERROR: No TracForms command '%r'")
Note: See TracBrowser for help on using the repository browser.