16 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
# |
# |
19 |
# Copyright 2001 Free Software Foundation |
# Copyright 2001-2003 Free Software Foundation |
20 |
# |
# |
21 |
# FILE: |
# FILE: |
22 |
# BaseMask.py |
# BaseMask.py |
139 |
except KeyError: |
except KeyError: |
140 |
pass |
pass |
141 |
if not len(mask): |
if not len(mask): |
142 |
raise PredefinedMaskNotFound, \ |
tmsg = _('The requested format mask "%s" is not defined for %s fields') \ |
143 |
_('The requested format mask "%s" is not defined for %s fields') \ |
% (mask[1:], self.basetype) |
144 |
% (mask[1:], self.basetype) |
raise PredefinedMaskNotFound, tmsg |
145 |
|
|
146 |
# Process each character in mask at a time |
# Process each character in mask at a time |
147 |
isLiteral = 0 |
isLiteral = 0 |
154 |
elif self.maskMappings.has_key(ch): |
elif self.maskMappings.has_key(ch): |
155 |
maskHandler.append(self.maskMappings[ch]) |
maskHandler.append(self.maskMappings[ch]) |
156 |
else: |
else: |
157 |
raise InvalidCharInMask, _('Unexpected character "%s" in %s mask.') \ |
tmsg = _('Unexpected character "%s" in %s mask.') \ |
158 |
% (ch, self.basetype) |
% (ch, self.basetype) |
159 |
|
raise InvalidCharInMask, tmsg |
160 |
|
|
161 |
return maskHandler |
return maskHandler |
162 |
|
|