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