| Line | |
|---|
| 1 | # -*- coding: utf-8 -*- |
|---|
| 2 | |
|---|
| 3 | from api import _ |
|---|
| 4 | |
|---|
| 5 | __all__ = ['FormError', 'FormTooManyValuesError', |
|---|
| 6 | 'FormNoOperationError', 'FormNoCommandError'] |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | class FormError(Exception): |
|---|
| 10 | def __str__(self): |
|---|
| 11 | return self.message % self.args |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | class 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 | |
|---|
| 23 | class FormNoOperationError(FormError): |
|---|
| 24 | def __init__(self, name): |
|---|
| 25 | FormError.__init__(self, name) |
|---|
| 26 | |
|---|
| 27 | message = _("ERROR: No TracForms operation '%r'") |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | class 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.