source:
tracformsplugin/trunk/tracforms/errors.py
| Last change on this file was 16384, checked in by , 7 years ago | |
|---|---|
| File size: 830 bytes | |
| Rev | Line | |
|---|---|---|
| [9984] | 1 | # -*- coding: utf-8 -*- |
| [3968] | 2 | |
| [10044] | 3 | from api import _ |
| [10021] | 4 | |
| [10044] | 5 | __all__ = ['FormError', 'FormTooManyValuesError', |
| 6 | 'FormNoOperationError', 'FormNoCommandError'] | |
| [10021] | 7 | |
| 8 | ||
| [10044] | 9 | class FormError(Exception): |
| [3968] | 10 | def __str__(self): |
| 11 | return self.message % self.args | |
| 12 | ||
| [10021] | 13 | |
| [10044] | 14 | class 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] | 23 | class 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] | 30 | class 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.
