You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(1) |
Feb
(8) |
Mar
(8) |
Apr
(4) |
May
(19) |
Jun
(1) |
Jul
(1) |
Aug
(18) |
Sep
(18) |
Oct
(19) |
Nov
(75) |
Dec
(80) |
| 2006 |
Jan
(86) |
Feb
(61) |
Mar
(60) |
Apr
(47) |
May
(39) |
Jun
(16) |
Jul
(30) |
Aug
(13) |
Sep
(13) |
Oct
(21) |
Nov
(1) |
Dec
(10) |
| 2007 |
Jan
(2) |
Feb
(7) |
Mar
(9) |
Apr
(3) |
May
(9) |
Jun
(4) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(12) |
Nov
(1) |
Dec
(7) |
| 2008 |
Jan
|
Feb
(2) |
Mar
(14) |
Apr
(9) |
May
(23) |
Jun
(4) |
Jul
|
Aug
(13) |
Sep
(8) |
Oct
(15) |
Nov
(40) |
Dec
(14) |
| 2009 |
Jan
|
Feb
(4) |
Mar
(10) |
Apr
(2) |
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sub...@co...> - 2007-10-21 00:22:19
|
Author: ianb
Date: 2007-10-20 18:22:19 -0600 (Sat, 20 Oct 2007)
New Revision: 3101
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/validators.py
Log:
Fix for DateConverter.from_python
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-10-21 00:19:10 UTC (rev 3100)
+++ FormEncode/trunk/docs/news.txt 2007-10-21 00:22:19 UTC (rev 3101)
@@ -40,6 +40,9 @@
* ``validators.Int`` takes ``min`` and ``max`` options (from Felix
Schwarz).
+* Make ``validators.DateConverter`` serialize dates properly (from
+ James Gardner).
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-10-21 00:19:10 UTC (rev 3100)
+++ FormEncode/trunk/formencode/validators.py 2007-10-21 00:22:19 UTC (rev 3101)
@@ -1799,7 +1799,7 @@
'invalidDate': _('That is not a valid day (%(exception)s)'),
'unknownMonthName': _("Unknown month name: %(month)s"),
'invalidYear': _('Please enter a number for the year'),
- 'fourDigitYear': _('Please enter a four-digit year'),
+ 'fourDigitYear': _('Please enter a four-digit year after 1899'),
'wrongFormat': _('Please enter the date in the form %(format)s'),
}
@@ -1865,7 +1865,7 @@
year = year + 2000
if year >= 50 and year < 100:
year = year + 1900
- if year > 20 and year < 50:
+ if (year > 20 and year < 50) or (year>99 and year<1900):
raise Invalid(self.message('fourDigitYear', state),
year, state)
return year
@@ -1894,8 +1894,11 @@
def unconvert_day(self, value, state):
# @@ ib: double-check, improve
- return value.strftime("%m/%d/%Y")
-
+ if self.month_style == 'mm/dd/yyyy':
+ return value.strftime("%m/%d/%Y")
+ else:
+ return value.strftime("%d/%m/%Y")
+
def unconvert_month(self, value, state):
# @@ ib: double-check, improve
return value.strftime("%m/%Y")
|
|
From: <sub...@co...> - 2007-10-21 00:19:10
|
Author: ianb
Date: 2007-10-20 18:19:10 -0600 (Sat, 20 Oct 2007)
New Revision: 3100
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/validators.py
FormEncode/trunk/tests/test_validators.py
Log:
Add min/max options to Int, from Felix Schwarz
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-10-21 00:18:05 UTC (rev 3099)
+++ FormEncode/trunk/docs/news.txt 2007-10-21 00:19:10 UTC (rev 3100)
@@ -37,6 +37,9 @@
* ``validators.UnicodeString`` properly handles non-Unicode inputs.
+* ``validators.Int`` takes ``min`` and ``max`` options (from Felix
+ Schwarz).
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-10-21 00:18:05 UTC (rev 3099)
+++ FormEncode/trunk/formencode/validators.py 2007-10-21 00:19:10 UTC (rev 3100)
@@ -915,8 +915,20 @@
messages = {
'integer': _("Please enter an integer value"),
+ 'tooLow': _("Please enter an integer above %(min)i"),
+ 'tooHigh': _("Please enter an integer below %(max)i"),
}
+ min = None
+ max = None
+
+ def __initargs__(self, args):
+ if self.min != None:
+ self.min = int(self.min)
+ if self.max != None:
+ self.max = int(self.max)
+
+
def _to_python(self, value, state):
try:
return int(value)
@@ -924,6 +936,14 @@
raise Invalid(self.message('integer', state),
value, state)
+ def validate_python(self, value, state):
+ if self.min != None and value < self.min:
+ msg = self.message("tooLow", state, min=self.min)
+ raise Invalid(msg, value, state)
+ if self.max != None and value > self.max:
+ msg = self.message("tooHigh", state, max=self.max)
+ raise Invalid(msg, value, state)
+
_from_python = _to_python
class Number(FancyValidator):
@@ -1115,6 +1135,9 @@
value = value.encode(self.outputEncoding)
return value
+ def empty_value(self, value):
+ return u''
+
class Set(FancyValidator):
"""
Modified: FormEncode/trunk/tests/test_validators.py
===================================================================
--- FormEncode/trunk/tests/test_validators.py 2007-10-21 00:18:05 UTC (rev 3099)
+++ FormEncode/trunk/tests/test_validators.py 2007-10-21 00:19:10 UTC (rev 3100)
@@ -1,8 +1,8 @@
-from formencode.validators import String, UnicodeString, Invalid
+from formencode.validators import String, UnicodeString, Invalid, Int
def validate(validator, value):
try:
- validator.to_python(value)
+ return validator.to_python(value)
return None
except Invalid, e:
return e.unpack_errors()
@@ -38,8 +38,47 @@
assert sv.from_python(2) == "2"
assert sv.from_python([]) == ""
+
def test_unicode():
un = UnicodeString()
assert un.to_python(12) == u'12'
assert type(un.to_python(12)) is unicode
-
+
+def test_unicode_empty():
+ iv = UnicodeString()
+ for input in [None, "", u""]:
+ result = iv.to_python(input)
+ assert u"" == result, result
+ assert isinstance(result, unicode)
+
+
+def test_int_min():
+ messages = Int().message
+ iv = Int(min=5)
+ assert iv.to_python("5") == 5
+ assert validate(iv, "1") == messages('tooLow', None, min=5)
+
+def test_int_max():
+ messages = Int().message
+ iv = Int(max=10)
+ assert iv.to_python("10") == 10
+ assert validate(iv, "15") == messages('tooHigh', None, max=10)
+
+def test_int_minmax_optional():
+ messages = Int().message
+ iv = Int(min=5, max=10, if_empty=None)
+ assert iv.to_python("") == None
+ assert iv.to_python(None) == None
+ assert iv.to_python('7') == 7
+ assert validate(iv, "1") == messages('tooLow', None, min=5)
+ assert validate(iv, "15") == messages('tooHigh', None, max=10)
+
+def test_int_minmax_optional():
+ messages = Int().message
+ iv = Int(min=5, max=10, not_empty=True)
+ assert validate(iv, None) == messages('empty', None)
+ assert validate(iv, "1") == messages('tooLow', None, min=5)
+ assert validate(iv, "15") == messages('tooHigh', None, max=10)
+
+
+
|
|
From: <sub...@co...> - 2007-10-21 00:18:09
|
Author: ianb Date: 2007-10-20 18:18:05 -0600 (Sat, 20 Oct 2007) New Revision: 3099 Modified: FormEncode/trunk/docs/Design.txt Log: typo Modified: FormEncode/trunk/docs/Design.txt =================================================================== --- FormEncode/trunk/docs/Design.txt 2007-10-20 04:00:12 UTC (rev 3098) +++ FormEncode/trunk/docs/Design.txt 2007-10-21 00:18:05 UTC (rev 3099) @@ -21,7 +21,7 @@ applying the data and if there's a problem you raise an exception. Someplace else you catch the exception and roll back the transaction. Of course FormEncode works fine with such a system, but because -nothing is done until everything validators, you can use this without +nothing is done until everything validates, you can use this without transactions. FormEncode generally works on primitive types (though you could extend |
|
From: <sub...@co...> - 2007-10-17 18:48:33
|
Author: ianb
Date: 2007-10-17 12:48:36 -0600 (Wed, 17 Oct 2007)
New Revision: 3087
Modified:
FormEncode/trunk/formencode/schema.py
Log:
forgot to commit this schema/empty improvement
Modified: FormEncode/trunk/formencode/schema.py
===================================================================
--- FormEncode/trunk/formencode/schema.py 2007-10-17 18:17:57 UTC (rev 3086)
+++ FormEncode/trunk/formencode/schema.py 2007-10-17 18:48:36 UTC (rev 3087)
@@ -304,9 +304,8 @@
result.extend(self.fields.values())
return result
- def is_empty(self, value):
- # Generally nothing is 'empty' for a schema
- return False
+ def empty_value(self, value):
+ return {}
def format_compound_error(v, indent=0):
if isinstance(v, Exception):
|
|
From: <sub...@co...> - 2007-10-17 18:17:58
|
Author: ianb
Date: 2007-10-17 12:17:57 -0600 (Wed, 17 Oct 2007)
New Revision: 3086
Modified:
FormEncode/trunk/formencode/schema.py
FormEncode/trunk/formencode/variabledecode.py
FormEncode/trunk/tests/test_schema.py
Log:
Fix handling of empty values in Schema, regression from last commit
Modified: FormEncode/trunk/formencode/schema.py
===================================================================
--- FormEncode/trunk/formencode/schema.py 2007-10-17 18:08:56 UTC (rev 3085)
+++ FormEncode/trunk/formencode/schema.py 2007-10-17 18:17:57 UTC (rev 3086)
@@ -1,5 +1,6 @@
from interfaces import *
from api import *
+from api import _
import declarative
__all__ = ['Schema']
@@ -52,8 +53,9 @@
order = []
messages = {
- 'notExpected': 'The input field %(name)s was not expected.',
- 'missingValue': "Missing value",
+ 'notExpected': _('The input field %(name)s was not expected.'),
+ 'missingValue': _("Missing value"),
+ 'badDictType': _("The input must be dict-like (not a %(type)s: %(value)r)"),
}
__mutableattributes__ = ('fields', 'chained_validators',
@@ -98,12 +100,26 @@
for name, value in self.fields.items():
self.add_field(name, value)
+ def assert_dict(self, value, state):
+ """
+ Helper to assure we have proper input
+ """
+ if not hasattr(value, 'items'):
+ # Not a dict or dict-like object
+ raise Invalid(self.message('badDictType', state, type=type(value), value=value),
+ value, state)
+
def _to_python(self, value_dict, state):
- if not value_dict and self.if_empty is not NoDefault:
- return self.if_empty
+ if not value_dict:
+ if self.if_empty is not NoDefault:
+ return self.if_empty
+ else:
+ value_dict = {}
for validator in self.pre_validators:
value_dict = validator.to_python(value_dict, state)
+
+ self.assert_dict(value_dict, state)
new = {}
errors = {}
@@ -192,6 +208,7 @@
__traceback_info__ = 'for_python chained_validator %s (finished %s)' % (validator, ', '.join(map(repr, finished)) or 'none')
finished.append(validator)
value_dict = validator.from_python(value_dict, state)
+ self.assert_dict(value_dict, state)
new = {}
errors = {}
unused = self.fields.keys()
@@ -287,6 +304,10 @@
result.extend(self.fields.values())
return result
+ def is_empty(self, value):
+ # Generally nothing is 'empty' for a schema
+ return False
+
def format_compound_error(v, indent=0):
if isinstance(v, Exception):
try:
Modified: FormEncode/trunk/formencode/variabledecode.py
===================================================================
--- FormEncode/trunk/formencode/variabledecode.py 2007-10-17 18:08:56 UTC (rev 3085)
+++ FormEncode/trunk/formencode/variabledecode.py 2007-10-17 18:17:57 UTC (rev 3086)
@@ -143,3 +143,5 @@
def _from_python(self, value, state):
return variable_encode(value)
+ def empty_value(self, value):
+ return {}
Modified: FormEncode/trunk/tests/test_schema.py
===================================================================
--- FormEncode/trunk/tests/test_schema.py 2007-10-17 18:08:56 UTC (rev 3085)
+++ FormEncode/trunk/tests/test_schema.py 2007-10-17 18:17:57 UTC (rev 3086)
@@ -52,9 +52,10 @@
all_cases.append(self)
def test(self):
- print self.raw_input
+ print 'input', repr(self.input)
actual = self.schema.to_python(self.input)
- assert actual == self.output
+ print 'output', repr(actual)
+ assert actual == self.output
class BadCase(DecodeCase):
@@ -66,9 +67,9 @@
self.output = self.output['text']
def test(self):
- print self.raw_input
+ print repr(self.raw_input)
try:
- self.schema.to_python(self.input)
+ print repr(self.schema.to_python(self.input))
except Invalid, e:
actual = e.unpack_errors()
assert actual == self.output
|
|
From: <sub...@co...> - 2007-10-17 18:08:55
|
Author: ianb
Date: 2007-10-17 12:08:56 -0600 (Wed, 17 Oct 2007)
New Revision: 3085
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/validators.py
FormEncode/trunk/tests/test_validators.py
Log:
Improve the UnicodeString handling of non-str/non-unicode inputs
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-10-17 17:21:44 UTC (rev 3084)
+++ FormEncode/trunk/docs/news.txt 2007-10-17 18:08:56 UTC (rev 3085)
@@ -35,6 +35,8 @@
unicode if an ``encoding`` parameter is given. Empty values are
handled better.
+* ``validators.UnicodeString`` properly handles non-Unicode inputs.
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-10-17 17:21:44 UTC (rev 3084)
+++ FormEncode/trunk/formencode/validators.py 2007-10-17 18:08:56 UTC (rev 3085)
@@ -1088,23 +1088,32 @@
self.outputEncoding = outputEncoding or self.encoding
def _to_python(self, value, state):
- if value:
- if isinstance(value, unicode):
+ if not value:
+ return u''
+ if isinstance(value, unicode):
+ return value
+ if not isinstance(value, unicode):
+ if hasattr(value, '__unicode__'):
+ value = unicode(value)
return value
- if hasattr(value, '__unicode__'):
- return unicode(value)
- try:
- return unicode(value, self.inputEncoding)
- except UnicodeDecodeError:
- raise Invalid(self.message('badEncoding', state), value, state)
- return u''
+ else:
+ value = str(value)
+ try:
+ return unicode(value, self.inputEncoding)
+ except UnicodeDecodeError:
+ raise Invalid(self.message('badEncoding', state), value, state)
+ except TypeError:
+ raise Invalid(self.message('badType', state, type=type(value), value=value), value, state)
def _from_python(self, value, state):
- if hasattr(value, '__unicode__'):
- value = unicode(value)
+ if not isinstance(value, unicode):
+ if hasattr(value, '__unicode__'):
+ value = unicode(value)
+ else:
+ value = str(value)
if isinstance(value, unicode):
- return value.encode(self.outputEncoding)
- return str(value)
+ value = value.encode(self.outputEncoding)
+ return value
class Set(FancyValidator):
Modified: FormEncode/trunk/tests/test_validators.py
===================================================================
--- FormEncode/trunk/tests/test_validators.py 2007-10-17 17:21:44 UTC (rev 3084)
+++ FormEncode/trunk/tests/test_validators.py 2007-10-17 18:08:56 UTC (rev 3085)
@@ -1,4 +1,4 @@
-from formencode.validators import String, Invalid
+from formencode.validators import String, UnicodeString, Invalid
def validate(validator, value):
try:
@@ -38,3 +38,8 @@
assert sv.from_python(2) == "2"
assert sv.from_python([]) == ""
+def test_unicode():
+ un = UnicodeString()
+ assert un.to_python(12) == u'12'
+ assert type(un.to_python(12)) is unicode
+
|
|
From: <sub...@co...> - 2007-10-17 17:21:44
|
Author: ianb
Date: 2007-10-17 11:21:44 -0600 (Wed, 17 Oct 2007)
New Revision: 3084
Added:
FormEncode/trunk/tests/test_validators.py
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/validators.py
Log:
Improvements to validators.String, suggested by Felix Schwartz.
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-10-17 17:17:52 UTC (rev 3083)
+++ FormEncode/trunk/docs/news.txt 2007-10-17 17:21:44 UTC (rev 3084)
@@ -28,6 +28,13 @@
* Include ``formencode.validators.InternationalPhoneNumber`` from
W-Mark Kubacki.
+* Treat empty lists/tuples/dicts as "empty".
+
+* ``validators.String`` now always returns strings. It also converts
+ lists to comma-separated strings (no ``[...]``), and can encode
+ unicode if an ``encoding`` parameter is given. Empty values are
+ handled better.
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-10-17 17:17:52 UTC (rev 3083)
+++ FormEncode/trunk/formencode/validators.py 2007-10-17 17:21:44 UTC (rev 3084)
@@ -967,6 +967,10 @@
Also takes a `max` and `min` argument, and the string length must
fall in that range.
+ Also you may give an `encoding` argument, which will encode any
+ unicode that is found. Lists and tuples are joined with
+ `list_joiner` (default ``', '``) in ``from_python``.
+
::
>>> String(min=2).to_python('a')
@@ -997,6 +1001,8 @@
min = None
max = None
not_empty = None
+ encoding = None
+ list_joiner = ', '
messages = {
'tooLong': _("Enter a value less than %(max)i characters long"),
@@ -1006,8 +1012,37 @@
def __initargs__(self, new_attrs):
if self.not_empty is None and self.min:
self.not_empty = True
+
+ def _to_python(self, value, state):
+ if not value:
+ value = ''
+ if not isinstance(value, basestring):
+ try:
+ value = str(value)
+ except UnicodeEncodeError:
+ value = unicode(value)
+ if self.encoding is not None and isinstance(value, unicode):
+ value = value.encode(self.encoding)
+ return value
+
+ def _from_python(self, value, state):
+ if not value and value != 0:
+ value = ''
+ if not isinstance(value, basestring):
+ if isinstance(value, (list, tuple)):
+ value = self.list_joiner.join([
+ self._from_python(v, state) for v in value])
+ try:
+ value = str(value)
+ except UnicodeEncodeError:
+ value = unicode(value)
+ if self.encoding is not None and isinstance(value, unicode):
+ value = value.encode(self.encoding)
+ if self.strip:
+ value = value.strip()
+ return value
- def validate_python(self, value, state):
+ def validate_other(self, value, state):
if (self.max is not None and value is not None
and len(value) > self.max):
raise Invalid(self.message('tooLong', state,
@@ -1019,13 +1054,6 @@
min=self.min),
value, state)
- def _from_python(self, value, state):
- if value:
- return str(value)
- if value == 0:
- return str(value)
- return ""
-
def empty_value(self, value):
return ''
Added: FormEncode/trunk/tests/test_validators.py
===================================================================
--- FormEncode/trunk/tests/test_validators.py (rev 0)
+++ FormEncode/trunk/tests/test_validators.py 2007-10-17 17:21:44 UTC (rev 3084)
@@ -0,0 +1,40 @@
+from formencode.validators import String, Invalid
+
+def validate(validator, value):
+ try:
+ validator.to_python(value)
+ return None
+ except Invalid, e:
+ return e.unpack_errors()
+
+def validate_from(validator, value):
+ try:
+ validator.from_python(value)
+ return None
+ except Invalid, e:
+ return e.unpack_errors()
+
+messages = String().message
+
+def test_sv_min():
+ sv = String(min=2, accept_python=False)
+ assert sv.to_python("foo") == "foo"
+ assert validate(sv, "x") == messages('tooShort', None, min=2)
+ assert validate(sv, None) == messages('empty', None)
+ # should be completely invalid?
+ assert validate(sv, []) == messages('empty', None, min=2)
+ assert sv.from_python(['x', 'y']) == 'x, y'
+
+def test_sv_not_empty():
+ sv = String(not_empty=True)
+ assert validate(sv, "") == messages('empty', None)
+ assert validate(sv, None) == messages('empty', None)
+ # should be completely invalid?
+ assert validate(sv, []) == messages('empty', None)
+ assert validate(sv, {}) == messages('empty', None)
+
+def test_sv_string_conversion():
+ sv = String(not_empty=False)
+ assert sv.from_python(2) == "2"
+ assert sv.from_python([]) == ""
+
Property changes on: FormEncode/trunk/tests/test_validators.py
___________________________________________________________________
Name: svn:eol-style
+ native
|
|
From: <sub...@co...> - 2007-10-17 17:17:54
|
Author: ianb
Date: 2007-10-17 11:17:52 -0600 (Wed, 17 Oct 2007)
New Revision: 3083
Modified:
FormEncode/trunk/formencode/api.py
Log:
typo, and also treat empty lists/tuple/dict as 'empty'
Modified: FormEncode/trunk/formencode/api.py
===================================================================
--- FormEncode/trunk/formencode/api.py 2007-10-16 17:57:32 UTC (rev 3082)
+++ FormEncode/trunk/formencode/api.py 2007-10-17 17:17:52 UTC (rev 3083)
@@ -406,7 +406,7 @@
if fp:
value = fp(value, state)
vo = self.validate_other
- if vo and co is not self._validate_noop:
+ if vo and vo is not self._validate_noop:
vo(value, state)
return value
else:
@@ -424,7 +424,8 @@
def is_empty(self, value):
# None and '' are "empty"
- return value is None or value == ''
+ return value is None or value == '' or (
+ isinstance(value, (list, tuple, dict)) and not value)
def empty_value(self, value):
return None
|
|
From: <sub...@co...> - 2007-08-21 20:41:03
|
Author: gh
Date: 2007-08-21 14:41:00 -0600 (Tue, 21 Aug 2007)
New Revision: 2888
Added:
FormEncode/trunk/formencode/i18n/cs/
FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/
FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/FormEncode.mo
FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/FormEncode.po
Modified:
FormEncode/trunk/tests/test_i18n.py
Log:
Added Czech (cs) translation
Added: FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/FormEncode.mo
===================================================================
(Binary files differ)
Property changes on: FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/FormEncode.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/FormEncode.po
===================================================================
--- FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/FormEncode.po (rev 0)
+++ FormEncode/trunk/formencode/i18n/cs/LC_MESSAGES/FormEncode.po 2007-08-21 20:41:00 UTC (rev 2888)
@@ -0,0 +1,323 @@
+# Martin Šenkeřík <mar...@em...>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 0.1\n"
+"POT-Creation-Date: 2006-10-02 20:59+CEST\n"
+"PO-Revision-Date: 2007-06-04 15:40+PRAG\n"
+"Last-Translator: Martin Šenkeřík <mar...@em...>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: api.py:335 validators.py:433
+msgid "Please enter a value"
+msgstr "Prosím zadejte hodnotu"
+
+#: api.py:336
+msgid "The input must be a string (not a %(type)s: %(value)r)"
+msgstr "Vstupem musí být řetězec (ne %(type)s: %(value)r)"
+
+#: api.py:337
+msgid "The input must be a string (not None)"
+msgstr "Vstupem musí být String (ne None)"
+
+#: validators.py:160
+msgid "%(object)r is not a subclass of %(subclass)s"
+msgstr "%(object)r není potřídou %(subclass)s"
+
+#: validators.py:161
+msgid "%(object)r is not a subclass of one of the types %(subclassList)s"
+msgstr "%(object)r není podřídou žádné z: %(subclassList)s"
+
+#: validators.py:162
+msgid "%(object)r must be one of the types %(typeList)s"
+msgstr "%(object)r musí být jeden z následujících typů: %(typeList)s"
+
+#: validators.py:163
+msgid "%(object)r must be of the type %(type)s"
+msgstr "%(object)r musí být typu %(type)s"
+
+#: validators.py:344
+msgid "Enter a value less than %(maxLength)i characters long"
+msgstr "Vložte hodnodtu kratší než %(maxLength)i dlouhou"
+
+#: validators.py:345 validators.py:399
+msgid "Invalid value (value with length expected)"
+msgstr "Nesprávná hodnota (byla očekávána hodnota s délkou)"
+
+#: validators.py:398
+msgid "Enter a value at least %(minLength)i characters long"
+msgstr "Vložte hodnotu nejméně %(minLength)i znaků dlouhou"
+
+#: validators.py:458
+msgid "You cannot enter a value here"
+msgstr "Sem nemůžete zadat hodnotu"
+
+#: validators.py:509
+msgid "The input is not valid"
+msgstr "Vstup není platný"
+
+#: validators.py:565
+msgid "Enter only letters, numbers, or _ (underscore)"
+msgstr "Vložte pouze písmena, číslice nebo _ (podtržítko)"
+
+#: validators.py:604
+msgid "Invalid value"
+msgstr "Nesprávná hodnota"
+
+#: validators.py:605
+msgid "Value must be one of: %(items)s (not %(value)r)"
+msgstr "Hodnota musí být jedna z: %(items)s (ne však %(value)r)"
+
+#: validators.py:668
+msgid "Choose something"
+msgstr "Musíte něco vybrat"
+
+#: validators.py:669
+msgid "Enter a value from: %(items)s"
+msgstr "Zadejte jednu z těchto hodnot: %(items)s"
+
+#: validators.py:670
+msgid "That value is not known"
+msgstr "Zadaná hodnota není známa"
+
+#: validators.py:671
+msgid "Nothing in my dictionary goes by the value %(value)s. Choose one of: %(items)s"
+msgstr "Nic v mém slovníku neodpovídá %(value)s. Vyberte jednu hodnotu z: %(items)s"
+
+#: validators.py:732
+msgid "Must be an integer index"
+msgstr "Index musí být číselný"
+
+#: validators.py:733
+msgid "Index out of range"
+msgstr "Index je mimo rozsah"
+
+#: validators.py:734
+msgid "Item %(value)s was not found in the list"
+msgstr "Hodnota %(value)s nebyla nalezena v seznamu"
+
+#: validators.py:809
+msgid "Date must be after %(date)s"
+msgstr "Datum musí být po %(date)s"
+
+#: validators.py:810
+msgid "Date must be before %(date)s"
+msgstr "Datum musí být před %(date)s"
+
+#: validators.py:812
+msgid "%%A, %%d %%B %%Y"
+msgstr "%%A, %%d %%B %%y"
+
+#: validators.py:813
+msgid "The date must be sometime in the future"
+msgstr "Zadané datum musí být v budoucnosti"
+
+#: validators.py:913
+msgid "Please enter an integer value"
+msgstr "Prosím vložte číselnou hodnotu"
+
+#: validators.py:945
+msgid "Please enter a number"
+msgstr "Prosím vložte číslo"
+
+#: validators.py:998
+msgid "Enter a value less than %(max)i characters long"
+msgstr "Zadejte hodnotu kratší než %(max)i znaků"
+
+#: validators.py:999
+msgid "Enter a value %(min)i characters long or more"
+msgstr "Zadejte hodnotu nejméně %(min)i znaků dlouhou"
+
+#: validators.py:1050
+msgid "Invalid data or incorrect encoding"
+msgstr "Neplatná data nebo chybné kódování znaků"
+
+#: validators.py:1178
+msgid "Please enter an email address"
+msgstr "Prosím zadejte emailovou adresu"
+
+#: validators.py:1179
+msgid "An email address must contain a single @"
+msgstr "Emailová adresa musí obsahovat jeden znak @"
+
+#: validators.py:1180
+msgid "The username portion of the email address is invalid (the portion before the @: %(username)s)"
+msgstr "Uživatelské jméno v zadané adrese není platné (část před @: %(username)s)"
+
+#: validators.py:1181 validators.py:1294
+msgid "An error occured when trying to connect to the server: %(error)s"
+msgstr "Nastala chyba při snaze o připojení na server: %(error)s"
+
+#: validators.py:1182
+msgid "The domain portion of the email address is invalid (the portion after the @: %(domain)s)"
+msgstr "Doména zadaná v emailové adrese není platná (část za @: %(domain)s)"
+
+#: validators.py:1183
+msgid "The domain of the email address does not exist (the portion after the @: %(domain)s)"
+msgstr "Doména zadaná v emailové adrese neexistuje (část za @: %(domain)s)"
+
+#: validators.py:1291
+msgid "You must start your URL with http://, https://, etc"
+msgstr "Adresa musí začínat protokolem (http://, https://. atd)"
+
+#: validators.py:1292
+msgid "That is not a valid URL"
+msgstr "Tohle není platná URL adresa"
+
+#: validators.py:1293
+msgid "An error occurred when trying to access the URL: %(error)s"
+msgstr "Nastala chyba při pokusu otevřít stránku z URL adresy: %(error)s"
+
+#: validators.py:1295
+msgid "The server responded that the page could not be found"
+msgstr "Server oznámil, že požadovanou stránku nenalezl"
+
+#: validators.py:1296
+msgid "The server responded with a bad status code (%(status)s)"
+msgstr "Server odpověděl špatným kódem: %(status)s"
+
+#: validators.py:1399
+msgid "Please enter a state code"
+msgstr "Zadejte prosím zkratku státu"
+
+#: validators.py:1400
+msgid "Please enter a state code with TWO letters"
+msgstr "Prosím zadejte dvoupísmennou zkratku státu"
+
+#: validators.py:1401
+msgid "That is not a valid state code"
+msgstr "Tohle není správná zkratka státu"
+
+#: validators.py:1452
+msgid "Please enter a number, with area code, in the form ###-###-####, optionally with \"ext.####\""
+msgstr ""
+
+#: validators.py:1614 validators.py:1622
+msgid "Please enter the date in the form %(format)s"
+msgstr "Zadejte prosím datum ve formátu %(format)s"
+
+#: validators.py:1615
+msgid "Please enter a month from 1 to 12"
+msgstr "Zadejte prosím měsíc v rozmezí 1-12"
+
+#: validators.py:1616
+msgid "Please enter a valid day"
+msgstr "Prosím zadejte správný den"
+
+#: validators.py:1617
+msgid "That month only has %(days)i days"
+msgstr "Tento měsíc má jenom %(days)i dnů"
+
+#: validators.py:1618
+msgid "That is not a valid day (%(exception)s)"
+msgstr "Tohle není platný den v týdnu: (%(exception)s)"
+
+#: validators.py:1619
+msgid "Unknown month name: %(month)s"
+msgstr "Neznámý název měsíce: %(month)s"
+
+#: validators.py:1620
+msgid "Please enter a number for the year"
+msgstr "Prosím zadejte rok"
+
+#: validators.py:1621
+msgid "Please enter a four-digit year"
+msgstr "Zadejte prosím celý rok"
+
+#: validators.py:1800
+msgid "You must indicate AM or PM"
+msgstr "Musíte zadat AM nebo PM"
+
+#: validators.py:1801
+msgid "There are too many :'s"
+msgstr "Je zde příliš : (dvojteček)"
+
+#: validators.py:1802
+msgid "You may not enter seconds"
+msgstr "Nezadávejte sekundy"
+
+#: validators.py:1803
+msgid "You must enter seconds"
+msgstr "Musíte zadat sekundy"
+
+#: validators.py:1804
+msgid "You must enter minutes (after a :)"
+msgstr "Musíte zadat minuty (za :)"
+
+#: validators.py:1805
+msgid "The %(part)s value you gave is not a number: %(number)r"
+msgstr "Hodnota %(part)s kterou jste zadali není číslo: %(number)r"
+
+#: validators.py:1806
+msgid "You must enter an hour in the range %(range)s"
+msgstr "Musíte zadat hodinu v rozmezí %(range)s"
+
+#: validators.py:1807
+msgid "You must enter a minute in the range 0-59"
+msgstr "Musíte zadat minuty v rozmezí 0-59"
+
+#: validators.py:1808
+msgid "You must enter a second in the range 0-59"
+msgstr "Musíte zadat sekundy v rozmezí 0-59"
+
+#: validators.py:1962
+msgid "Please enter a zip code (5 digits)"
+msgstr "Prosím zadejte PSČ"
+
+#: validators.py:1986
+msgid "The name %(name)s is missing"
+msgstr "Jméno %(name)s chybí"
+
+#: validators.py:2027
+msgid "Value should be %(true)r or %(false)r"
+msgstr "Hodnota může být pouze %(true)r nebo %(false)r"
+
+#: validators.py:2062
+msgid "Value does not contain a signature"
+msgstr "Hodnota neobsahuje podpis"
+
+#: validators.py:2063
+msgid "Signature is not correct"
+msgstr "Podpis není správně"
+
+#: validators.py:2185
+msgid "Fields do not match (should be %(match)s)"
+msgstr "Položky nesouhlasí, správně by mělo být %(match)s"
+
+#: validators.py:2186
+msgid "Fields do not match"
+msgstr "Položky nesouhlasí"
+
+#: validators.py:2248
+msgid "Please enter only the number, no other characters"
+msgstr "Prosím vkládejte pouze číslice, nikoliv písmena."
+
+#: validators.py:2249
+msgid "You did not enter a valid number of digits"
+msgstr "Nevložil jste číslo správné délky"
+
+#: validators.py:2250
+msgid "That number is not valid"
+msgstr "Zadané číslo není platné"
+
+#: validators.py:2365
+msgid "Please enter numbers only for month and year"
+msgstr "Prosím vložte pouze čístlice pro měsíc a rok"
+
+#: validators.py:2366
+msgid "Invalid Expiration Date"
+msgstr "Špatná hodnota data expirace"
+
+#: validators.py:2435
+msgid "Please enter numbers only for credit card security code"
+msgstr "Prosím vložte pouze číslice z bezpečnostního kódu karty"
+
+#: validators.py:2436
+msgid "Invalid credit card security code length"
+msgstr "Nesprávná délka bezpečnostního kódu karty"
+
Modified: FormEncode/trunk/tests/test_i18n.py
===================================================================
--- FormEncode/trunk/tests/test_i18n.py 2007-08-21 20:24:14 UTC (rev 2887)
+++ FormEncode/trunk/tests/test_i18n.py 2007-08-21 20:41:00 UTC (rev 2888)
@@ -96,3 +96,6 @@
def test_zh_CN():
_test_lang("zh_CN", u"请输入一个值")
+def test_cs():
+ _test_lang("cs", u"Prosím zadejte hodnotu")
+
|
|
From: <sub...@co...> - 2007-08-21 20:24:16
|
Author: gh
Date: 2007-08-21 14:24:14 -0600 (Tue, 21 Aug 2007)
New Revision: 2887
Added:
FormEncode/trunk/formencode/i18n/zh_CN/
FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/
FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/FormEncode.mo
FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/FormEncode.po
Modified:
FormEncode/trunk/tests/test_i18n.py
Log:
Added Chinese simplified translation (zh_CN)
Added: FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/FormEncode.mo
===================================================================
(Binary files differ)
Property changes on: FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/FormEncode.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/FormEncode.po
===================================================================
--- FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/FormEncode.po (rev 0)
+++ FormEncode/trunk/formencode/i18n/zh_CN/LC_MESSAGES/FormEncode.po 2007-08-21 20:24:14 UTC (rev 2887)
@@ -0,0 +1,325 @@
+# Chinese/Simplified translation of PACKAGE.
+# Copyright (C) 2007 ORGANIZATION
+# qcshzihnus <qcs...@gm...>, 2007.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-10-02 20:59+CEST\n"
+"PO-Revision-Date: 2007-08-20 17:38+0800\n"
+"Last-Translator: qcshzihnus <qcs...@gm...>\n"
+"Language-Team: Chinese/Simplified\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit"
+
+#: api.py:335 validators.py:433
+msgid "Please enter a value"
+msgstr "请输入一个值"
+
+#: api.py:336
+msgid "The input must be a string (not a %(type)s: %(value)r)"
+msgstr "输入必须为一个字符串 (而不是 %(type)s: %(value)r)"
+
+#: api.py:337
+msgid "The input must be a string (not None)"
+msgstr "输入必须为一个字符串 (而不是 None)"
+
+#: validators.py:160
+msgid "%(object)r is not a subclass of %(subclass)s"
+msgstr "%(object)r 不是 %(subclass)s 的子类"
+
+#: validators.py:161
+msgid "%(object)r is not a subclass of one of the types %(subclassList)s"
+msgstr "%(object)r 不是这些类型之一的子类 %(subclassList)s"
+
+#: validators.py:162
+msgid "%(object)r must be one of the types %(typeList)s"
+msgstr "%(object)r 必须为这些类型之一 %(typeList)s"
+
+#: validators.py:163
+msgid "%(object)r must be of the type %(type)s"
+msgstr "%(object)r 必须为类型 %(type)s"
+
+#: validators.py:344
+msgid "Enter a value less than %(maxLength)i characters long"
+msgstr "请输入少于 %(maxLength)i 个字符的值"
+
+#: validators.py:345 validators.py:399
+msgid "Invalid value (value with length expected)"
+msgstr "无效的值 (长度错误)"
+
+#: validators.py:398
+msgid "Enter a value at least %(minLength)i characters long"
+msgstr "请输入至少 %(minLength)i 个字符的值"
+
+#: validators.py:458
+msgid "You cannot enter a value here"
+msgstr "您不能在此处输入值"
+
+#: validators.py:509
+msgid "The input is not valid"
+msgstr "输入无效"
+
+#: validators.py:565
+msgid "Enter only letters, numbers, or _ (underscore)"
+msgstr "请只输入字母、数字或 _ (下划线)"
+
+#: validators.py:604
+msgid "Invalid value"
+msgstr "无效的值"
+
+#: validators.py:605
+msgid "Value must be one of: %(items)s (not %(value)r)"
+msgstr "必须为这些值之一: %(items)s (而不是 %(value)r)"
+
+#: validators.py:668
+msgid "Choose something"
+msgstr "请选择些什么"
+
+#: validators.py:669
+msgid "Enter a value from: %(items)s"
+msgstr "请输入这些值之一: %(items)s"
+
+#: validators.py:670
+msgid "That value is not known"
+msgstr "值未知"
+
+#: validators.py:671
+msgid "Nothing in my dictionary goes by the value %(value)s. Choose one of: %(items)s"
+msgstr "字典中没有值 %(value)s。请选择这些值之一: %(items)s"
+
+#: validators.py:732
+msgid "Must be an integer index"
+msgstr "必须为整数索引"
+
+#: validators.py:733
+msgid "Index out of range"
+msgstr "索引超出范围"
+
+#: validators.py:734
+msgid "Item %(value)s was not found in the list"
+msgstr "无法在列表中找到项 %(value)s"
+
+#: validators.py:809
+msgid "Date must be after %(date)s"
+msgstr "日期必须在 %(date)s 之后"
+
+#: validators.py:810
+msgid "Date must be before %(date)s"
+msgstr "日期必须在 %(date)s 之前"
+
+#: validators.py:812
+msgid "%%A, %%d %%B %%Y"
+msgstr "%%Y %%B %%d, %%A"
+
+#: validators.py:813
+msgid "The date must be sometime in the future"
+msgstr "日期必须为将来的某一天"
+
+#: validators.py:913
+msgid "Please enter an integer value"
+msgstr "请输入一个整型值"
+
+#: validators.py:945
+msgid "Please enter a number"
+msgstr "请输入一个数"
+
+#: validators.py:998
+msgid "Enter a value less than %(max)i characters long"
+msgstr "请输入少于 %(max)i 个字符的值"
+
+#: validators.py:999
+msgid "Enter a value %(min)i characters long or more"
+msgstr "请输入至少 %(min)i 个字符的值"
+
+#: validators.py:1050
+msgid "Invalid data or incorrect encoding"
+msgstr "数据无效或编码错误"
+
+#: validators.py:1178
+msgid "Please enter an email address"
+msgstr "请输入一个电子邮件地址"
+
+#: validators.py:1179
+msgid "An email address must contain a single @"
+msgstr "电子邮件地址必须包含单个 @"
+
+#: validators.py:1180
+msgid "The username portion of the email address is invalid (the portion before the @: %(username)s)"
+msgstr "电子邮件地址的用户名部分无效 (@ 之前的部分: %(username)s)"
+
+#: validators.py:1181 validators.py:1294
+msgid "An error occured when trying to connect to the server: %(error)s"
+msgstr "尝试连接到服务器时错误: %(error)s"
+
+#: validators.py:1182
+msgid "The domain portion of the email address is invalid (the portion after the @: %(domain)s)"
+msgstr "电子邮件地址的域名部分无效 (@ 之后的部分: %(domain)s)"
+
+#: validators.py:1183
+msgid "The domain of the email address does not exist (the portion after the @: %(domain)s)"
+msgstr "电子邮件地址的域名不存在 (@ 之后的部分: %(domain)s)"
+
+#: validators.py:1291
+msgid "You must start your URL with http://, https://, etc"
+msgstr "URL 必须以 http:// 、https:// 等开头"
+
+#: validators.py:1292
+msgid "That is not a valid URL"
+msgstr "不是合法的URL"
+
+#: validators.py:1293
+msgid "An error occurred when trying to access the URL: %(error)s"
+msgstr "尝试访问该 URL 时出错: %(error)s"
+
+#: validators.py:1295
+msgid "The server responded that the page could not be found"
+msgstr "服务器回应说页面未找到"
+
+#: validators.py:1296
+msgid "The server responded with a bad status code (%(status)s)"
+msgstr "服务器返回了一个错误状态码 (%(status)s)"
+
+#: validators.py:1399
+msgid "Please enter a state code"
+msgstr "请输入一个状态码"
+
+#: validators.py:1400
+msgid "Please enter a state code with TWO letters"
+msgstr "请输入 两 个字母的状态码"
+
+#: validators.py:1401
+msgid "That is not a valid state code"
+msgstr "不是有效的状态码"
+
+#: validators.py:1452
+msgid "Please enter a number, with area code, in the form ###-###-####, optionally with \"ext.####\""
+msgstr "请输入号码,连带地区码,格式为 ###-###-####,后可加上 \"ext.####\""
+
+#: validators.py:1614 validators.py:1622
+msgid "Please enter the date in the form %(format)s"
+msgstr "请以格式 %(format)s 输入日期"
+
+#: validators.py:1615
+msgid "Please enter a month from 1 to 12"
+msgstr "请输入 1月 到 12 月其中之一"
+
+#: validators.py:1616
+msgid "Please enter a valid day"
+msgstr "请输入有效的天数"
+
+#: validators.py:1617
+msgid "That month only has %(days)i days"
+msgstr "该月只有 %(days)i 天"
+
+#: validators.py:1618
+msgid "That is not a valid day (%(exception)s)"
+msgstr "不是有效的天数 (%(exception)s)"
+
+#: validators.py:1619
+msgid "Unknown month name: %(month)s"
+msgstr "未知的月份名称: %(month)s"
+
+#: validators.py:1620
+msgid "Please enter a number for the year"
+msgstr "请输入一个数字代表年份"
+
+#: validators.py:1621
+msgid "Please enter a four-digit year"
+msgstr "请输入四位的年份"
+
+#: validators.py:1800
+msgid "You must indicate AM or PM"
+msgstr "您必须指明 AM 或 PM"
+
+#: validators.py:1801
+msgid "There are too many :'s"
+msgstr "太多的 :'s"
+
+#: validators.py:1802
+msgid "You may not enter seconds"
+msgstr "您不可以输入秒数"
+
+#: validators.py:1803
+msgid "You must enter seconds"
+msgstr "您必须输入秒数"
+
+#: validators.py:1804
+msgid "You must enter minutes (after a :)"
+msgstr "您必须输入分钟数 (在 : 之后)"
+
+#: validators.py:1805
+msgid "The %(part)s value you gave is not a number: %(number)r"
+msgstr "您给出的 %(part)s 值不是一个数字: %(number)r"
+
+#: validators.py:1806
+msgid "You must enter an hour in the range %(range)s"
+msgstr "您输入的小时数必须在 %(range)s 之内"
+
+#: validators.py:1807
+msgid "You must enter a minute in the range 0-59"
+msgstr "您输入的分钟数必须在 0-59之间"
+
+#: validators.py:1808
+msgid "You must enter a second in the range 0-59"
+msgstr "您输入的秒数必须在 0-59 之间"
+
+#: validators.py:1962
+msgid "Please enter a zip code (5 digits)"
+msgstr "请输入邮政编码 (5 位)"
+
+#: validators.py:1986
+msgid "The name %(name)s is missing"
+msgstr "缺少名称 %(name)s"
+
+#: validators.py:2027
+msgid "Value should be %(true)r or %(false)r"
+msgstr "值应当为 %(true)r 或是 %(false)r"
+
+#: validators.py:2062
+msgid "Value does not contain a signature"
+msgstr "值中不包含签名"
+
+#: validators.py:2063
+msgid "Signature is not correct"
+msgstr "签名不正确"
+
+#: validators.py:2185
+msgid "Fields do not match (should be %(match)s)"
+msgstr "域不符合 (应当为 %(match)s)"
+
+#: validators.py:2186
+msgid "Fields do not match"
+msgstr "域不符合"
+
+#: validators.py:2248
+msgid "Please enter only the number, no other characters"
+msgstr "请只输入数字,没有其他字符"
+
+#: validators.py:2249
+msgid "You did not enter a valid number of digits"
+msgstr "您输入的数字无效"
+
+#: validators.py:2250
+msgid "That number is not valid"
+msgstr "数字无效"
+
+#: validators.py:2365
+msgid "Please enter numbers only for month and year"
+msgstr "请只输入代表年份和月份的数字"
+
+#: validators.py:2366
+msgid "Invalid Expiration Date"
+msgstr "无效的过期日"
+
+#: validators.py:2435
+msgid "Please enter numbers only for credit card security code"
+msgstr "请只输入代表信用卡密码的数字"
+
+#: validators.py:2436
+msgid "Invalid credit card security code length"
+msgstr "信用卡密码长度无效"
+
Modified: FormEncode/trunk/tests/test_i18n.py
===================================================================
--- FormEncode/trunk/tests/test_i18n.py 2007-08-21 12:54:14 UTC (rev 2886)
+++ FormEncode/trunk/tests/test_i18n.py 2007-08-21 20:24:14 UTC (rev 2887)
@@ -93,3 +93,6 @@
def test_el():
_test_lang("el", u"Παρακαλούμε εισάγετε μια τιμή")
+def test_zh_CN():
+ _test_lang("zh_CN", u"请输入一个值")
+
|
|
From: <sub...@co...> - 2007-07-08 17:34:06
|
Author: gh
Date: 2007-07-08 11:33:59 -0600 (Sun, 08 Jul 2007)
New Revision: 2732
Added:
FormEncode/trunk/formencode/i18n/el/
FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/
FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/FormEncode.mo
FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/FormEncode.po
Modified:
FormEncode/trunk/tests/test_i18n.py
Log:
added Greek translation
Added: FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/FormEncode.mo
===================================================================
(Binary files differ)
Property changes on: FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/FormEncode.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/FormEncode.po
===================================================================
--- FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/FormEncode.po (rev 0)
+++ FormEncode/trunk/formencode/i18n/el/LC_MESSAGES/FormEncode.po 2007-07-08 17:33:59 UTC (rev 2732)
@@ -0,0 +1,326 @@
+# translation of FormEncode.po to Greek
+# Copyright (C) YEAR ORGANIZATION
+#
+# Dimitris Glezos <dim...@gl...>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: FormEncode\n"
+"POT-Creation-Date: 2006-10-02 20:59+CEST\n"
+"PO-Revision-Date: 2007-07-07 01:59+0100\n"
+"Last-Translator: Dimitris Glezos <dim...@gl...>\n"
+"Language-Team: Greek <fed...@re...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: api.py:335 validators.py:433
+msgid "Please enter a value"
+msgstr "Παρακαλούμε εισάγετε μια τιμή"
+
+#: api.py:336
+msgid "The input must be a string (not a %(type)s: %(value)r)"
+msgstr "Η είσοδος πρέπει να είναι τύπου συμβολοσειράς (όχι %(type)s: %(value)r)"
+
+#: api.py:337
+msgid "The input must be a string (not None)"
+msgstr "Η είσοδος πρέπει να είναι τύπου συμβολοσειράς (όχι None)"
+
+#: validators.py:160
+msgid "%(object)r is not a subclass of %(subclass)s"
+msgstr "Το %(object)r δεν είναι υποκλάση του %(subclass)s"
+
+#: validators.py:161
+msgid "%(object)r is not a subclass of one of the types %(subclassList)s"
+msgstr "Το %(object)r δεν είναι υποκλάση ενός από τους τύπους %(subclassList)s"
+
+#: validators.py:162
+msgid "%(object)r must be one of the types %(typeList)s"
+msgstr "Το %(object)r πρέπει να είναι ενός από τους τύπους %(typeList)s"
+
+#: validators.py:163
+msgid "%(object)r must be of the type %(type)s"
+msgstr "Το %(object)r πρέπει να είναι τύπου %(type)s"
+
+#: validators.py:344
+msgid "Enter a value less than %(maxLength)i characters long"
+msgstr "Εισάγετε μία τιμή με μήκος μικρότερο από %(maxLength)i χαρακτήρες"
+
+#: validators.py:345 validators.py:399
+msgid "Invalid value (value with length expected)"
+msgstr "Μη έγκυρη τιμή (αναμενόταν τιμή με κάποιο μήκος)"
+
+#: validators.py:398
+msgid "Enter a value at least %(minLength)i characters long"
+msgstr "Εισάγετε μία τιμή με μήκος τουλάχιστον %(minLength)i χαρακτήρες"
+
+#: validators.py:458
+msgid "You cannot enter a value here"
+msgstr "Δε μπορείτε να εισάγετε μία τιμή εδώ"
+
+#: validators.py:509
+msgid "The input is not valid"
+msgstr "Η είσοδος δεν είναι έγκυρη"
+
+#: validators.py:565
+msgid "Enter only letters, numbers, or _ (underscore)"
+msgstr "Εισάγετε μόνο γράμματα, αριθμούς, ή _ (κάτω παύλα)"
+
+#: validators.py:604
+msgid "Invalid value"
+msgstr "Μη έγκυρη τιμή"
+
+#: validators.py:605
+msgid "Value must be one of: %(items)s (not %(value)r)"
+msgstr "Η τιμή πρέπει να είναι μία από τις εξής: %(items)s (όχι %(value)r)"
+
+#: validators.py:668
+msgid "Choose something"
+msgstr "Επιλέξτε κάτι"
+
+#: validators.py:669
+msgid "Enter a value from: %(items)s"
+msgstr "Εισάγετε μία τιμή από τις εξής: %(items)s"
+
+#: validators.py:670
+msgid "That value is not known"
+msgstr "Αυτή η τιμή δεν είναι γνωστή"
+
+#: validators.py:671
+msgid "Nothing in my dictionary goes by the value %(value)s. Choose one of: %(items)s"
+msgstr "Τίποτα στο λεξικό του συστήματος δεν ταιριάζει με την τιμή %(value)s. Επιλέξτε μία από τις εξής: %(items)s"
+
+#: validators.py:732
+msgid "Must be an integer index"
+msgstr "Πρέπει να είναι ένας ακέραιος δείκτης"
+
+#: validators.py:733
+msgid "Index out of range"
+msgstr "Δείκτης εκτός αποδεκτού εύρους"
+
+#: validators.py:734
+msgid "Item %(value)s was not found in the list"
+msgstr "Το αντικείμενο %(value)s δε βρέθηκε στη λίστα"
+
+#: validators.py:809
+msgid "Date must be after %(date)s"
+msgstr "Η ημερομηνία πρέπει να είναι μετά από %(date)s"
+
+#: validators.py:810
+msgid "Date must be before %(date)s"
+msgstr "Η ημερομηνία πρέπει να είναι πριν από %(date)s"
+
+#: validators.py:812
+msgid "%%A, %%d %%B %%Y"
+msgstr "%%A, %%d %%B %%Y"
+
+#: validators.py:813
+msgid "The date must be sometime in the future"
+msgstr "Η ημερομηνία πρέπει να είναι στο μέλλον"
+
+#: validators.py:913
+msgid "Please enter an integer value"
+msgstr "Παρακαλούμε εισάγετε μία ακέραια τιμή"
+
+#: validators.py:945
+msgid "Please enter a number"
+msgstr "Παρακαλούμε εισάγετε έναν αριθμό"
+
+#: validators.py:998
+msgid "Enter a value less than %(max)i characters long"
+msgstr "Εισάγετε μία τιμή με μήκος μικρότερο από %(max)i χαρακτήρες"
+
+#: validators.py:999
+msgid "Enter a value %(min)i characters long or more"
+msgstr "Εισάγετε μία τιμή με μήκος τουλάχιστον %(max)i χαρακτήρες"
+
+#: validators.py:1050
+msgid "Invalid data or incorrect encoding"
+msgstr "Μη έκγυρα δεδομένα ή λανθασμένη κωδικοποίηση"
+
+#: validators.py:1178
+msgid "Please enter an email address"
+msgstr "Παρακαλούμε εισάγετε μία ηλ. διεύθυνση"
+
+#: validators.py:1179
+msgid "An email address must contain a single @"
+msgstr "Μία ηλ. διεύθυνση πρέπει να περιέχει ένα μοναδικό @"
+
+#: validators.py:1180
+msgid "The username portion of the email address is invalid (the portion before the @: %(username)s)"
+msgstr "Το τμήμα της ηλ. διεύθυνσης με το όνομα χρήστη δεν είναι έγκυρο (το τμήμα πριν το @: %(username)s)"
+
+#: validators.py:1181 validators.py:1294
+msgid "An error occured when trying to connect to the server: %(error)s"
+msgstr "Ένα σφάλμα συνέβηκε κατά την προσπάθεια σύνδεσης στον εξυπηρετητή: %(error)s"
+
+#: validators.py:1182
+msgid "The domain portion of the email address is invalid (the portion after the @: %(domain)s)"
+msgstr "Το τμήμα της ηλ. διεύθυνσης με τον τομέα δεν είναι έγκυρο (το τμήμα μετά το @: %(domain)s)"
+
+#: validators.py:1183
+msgid "The domain of the email address does not exist (the portion after the @: %(domain)s)"
+msgstr "Ο τομέας της ηλ. διεύθυνσης δεν υπάρχει (το τμήμα μετά το @: %(domain)s)"
+
+#: validators.py:1291
+msgid "You must start your URL with http://, https://, etc"
+msgstr "Τα URL σας πρέπει να ξεκινούν με http://, https://, κλπ"
+
+#: validators.py:1292
+msgid "That is not a valid URL"
+msgstr "Αυτό δεν είναι έγκυρο URL"
+
+#: validators.py:1293
+msgid "An error occurred when trying to access the URL: %(error)s"
+msgstr "Ένα σφάλμα συνέβηκε κατά την προσπάθεια πρόσβασης στο URL: %(error)s"
+
+#: validators.py:1295
+msgid "The server responded that the page could not be found"
+msgstr "Ο εξυπηρετητής απάντησε ότι η σελίδα δε μπόρεσε να βρεθεί"
+
+#: validators.py:1296
+msgid "The server responded with a bad status code (%(status)s)"
+msgstr "Ο εξυπηρετητής απάντησε με έναν κακό κωδικό κατάστασης (%(status)s)"
+
+#: validators.py:1399
+msgid "Please enter a state code"
+msgstr "Παρακαλούμε εισάγετε έναν κωδικό πολιτείας"
+
+#: validators.py:1400
+msgid "Please enter a state code with TWO letters"
+msgstr "Παρακαλούμε εισάγετε έναν κωδικό πολιτείας με ΔΥΟ γράμματα"
+
+#: validators.py:1401
+msgid "That is not a valid state code"
+msgstr "Αυτός δεν είναι ένας έγκυρος κωδικός πολιτείας"
+
+#: validators.py:1452
+msgid "Please enter a number, with area code, in the form ###-###-####, optionally with \"ext.####\""
+msgstr "Παρακαλούμε εισάγετε έναν αριθμό, με τον κωδικό περιοχής, στη μορφή ###-###-####, προαιρετικά με \"ext.####\""
+
+#: validators.py:1614 validators.py:1622
+msgid "Please enter the date in the form %(format)s"
+msgstr "Παρακαλούμε εισάγετε την ημερομηνία στη μορφή %(format)s"
+
+#: validators.py:1615
+msgid "Please enter a month from 1 to 12"
+msgstr "Παρακαλούμε εισάγετε έναν μήνα από 1 μέχρι 12"
+
+#: validators.py:1616
+msgid "Please enter a valid day"
+msgstr "Παρακαλούμε εισάγετε μία έγκυρη ημέρα"
+
+#: validators.py:1617
+msgid "That month only has %(days)i days"
+msgstr "Αυτός ο μήνας έχει μόνο %(days)i ημέρες"
+
+#: validators.py:1618
+msgid "That is not a valid day (%(exception)s)"
+msgstr "Αυτή δεν είναι μια έγκυρη ημέρα (%(exception)s)"
+
+#: validators.py:1619
+msgid "Unknown month name: %(month)s"
+msgstr "Άγνωστο όνομα μήνα: %(month)s"
+
+#: validators.py:1620
+msgid "Please enter a number for the year"
+msgstr "Παρακαλούμε εισάγετε έναν αριθμό για το χρόνο"
+
+#: validators.py:1621
+msgid "Please enter a four-digit year"
+msgstr "Παρακαλούμε εισάγετε ένα χρόνο με τέσσερα ψηφία"
+
+#: validators.py:1800
+msgid "You must indicate AM or PM"
+msgstr "Πρέπει να προσδιορίσετε πμ ή μμ"
+
+#: validators.py:1801
+msgid "There are too many :'s"
+msgstr "Υπάρχουν πάρα πολλοί απόστροφοι"
+
+#: validators.py:1802
+msgid "You may not enter seconds"
+msgstr "Δε μπορείτε να εισάγετε δευτερόλεπτα"
+
+#: validators.py:1803
+msgid "You must enter seconds"
+msgstr "Πρέπει να εισάγετε δευτερόλεπτα"
+
+#: validators.py:1804
+msgid "You must enter minutes (after a :)"
+msgstr "Πρέπει να εισάγετε λεπτά (μετά από ένα :)"
+
+#: validators.py:1805
+msgid "The %(part)s value you gave is not a number: %(number)r"
+msgstr "Το τμήμα %(part)s που έχετε εισάγει δεν είναι αριθμός: %(number)r"
+
+#: validators.py:1806
+msgid "You must enter an hour in the range %(range)s"
+msgstr "Πρέπει να εισάγετε μία ώρα στο εύρος %(range)s"
+
+#: validators.py:1807
+msgid "You must enter a minute in the range 0-59"
+msgstr "Πρέπει να εισάγετε ένα λεπτό στο εύρος 0-59"
+
+#: validators.py:1808
+msgid "You must enter a second in the range 0-59"
+msgstr "Πρέπει να εισάγετε ένα δευτερόλεπτο στο εύρος 0-59"
+
+#: validators.py:1962
+msgid "Please enter a zip code (5 digits)"
+msgstr "Παρακαλούμε εισάγετε έναν ταχυδρομικό κωδικό (5 ψηφία)"
+
+#: validators.py:1986
+msgid "The name %(name)s is missing"
+msgstr "Το όνομα %(name)s λείπει"
+
+#: validators.py:2027
+msgid "Value should be %(true)r or %(false)r"
+msgstr "Η τιμή πρέπει να είναι %(true)r ή %(false)r"
+
+#: validators.py:2062
+msgid "Value does not contain a signature"
+msgstr "Η τιμή δεν περιέχει υπογραφή"
+
+#: validators.py:2063
+msgid "Signature is not correct"
+msgstr "Η υπογραφή δεν είναι σωστή"
+
+#: validators.py:2185
+msgid "Fields do not match (should be %(match)s)"
+msgstr "Τα πεδία δεν ταιριάζουν (θα έπρεπε να είναι %(match)s)"
+
+#: validators.py:2186
+msgid "Fields do not match"
+msgstr "Τα πεδία δεν ταιριάζουν"
+
+#: validators.py:2248
+msgid "Please enter only the number, no other characters"
+msgstr "Παρακαλούμε εισάγετε μόνο τον αριθμό, χωρίς άλλους χαρακτήρες"
+
+#: validators.py:2249
+msgid "You did not enter a valid number of digits"
+msgstr "Δεν έχετε εισάγει έναν έγκυρο αριθμό από ψηφία"
+
+#: validators.py:2250
+msgid "That number is not valid"
+msgstr "Ο αριθμός δεν είναι έγκυρος"
+
+#: validators.py:2365
+msgid "Please enter numbers only for month and year"
+msgstr "Παρακαλώ εισάγετε μόνο αριθμούς για μήνα και έτος"
+
+#: validators.py:2366
+msgid "Invalid Expiration Date"
+msgstr "Μη έγκυρη ημερομηνία λήξης"
+
+#: validators.py:2435
+msgid "Please enter numbers only for credit card security code"
+msgstr "Παρακαλούμε εισάγετε μόνο αριθμούς για τον κωδικό ασφάλειας της πιστωτικής κάρτας"
+
+#: validators.py:2436
+msgid "Invalid credit card security code length"
+msgstr "Μη έγκυρο μήκος του κωδικού ασφάλειας της πιστωτικής κάρτας"
+
Modified: FormEncode/trunk/tests/test_i18n.py
===================================================================
--- FormEncode/trunk/tests/test_i18n.py 2007-07-07 20:35:04 UTC (rev 2731)
+++ FormEncode/trunk/tests/test_i18n.py 2007-07-08 17:33:59 UTC (rev 2732)
@@ -90,3 +90,6 @@
def test_pl():
_test_lang("pl", u"Proszę podać wartość")
+def test_el():
+ _test_lang("el", u"Παρακαλούμε εισάγετε μια τιμή")
+
|
|
From: <sub...@co...> - 2007-06-25 17:42:56
|
Author: ianb
Date: 2007-06-25 11:42:51 -0600 (Mon, 25 Jun 2007)
New Revision: 2719
Modified:
FormEncode/trunk/formencode/validators.py
Log:
Fix for DNS resolution, so it also works on Windows; from Ionel Maries Cristian
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-06-16 06:59:30 UTC (rev 2718)
+++ FormEncode/trunk/formencode/validators.py 2007-06-25 17:42:51 UTC (rev 2719)
@@ -42,7 +42,7 @@
try:
import DNS
- DNS.ParseResolvConf()
+ DNS.DiscoverNameServers()
have_dns=True
except ImportError:
have_dns=False
|
|
From: <sub...@co...> - 2007-06-16 06:59:34
|
Author: gh
Date: 2007-06-16 00:59:30 -0600 (Sat, 16 Jun 2007)
New Revision: 2718
Added:
FormEncode/trunk/formencode/i18n/pl/
FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/
FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/FormEncode.mo
FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/FormEncode.po
Modified:
FormEncode/trunk/tests/test_i18n.py
Log:
added Polish (pl) translation
Added: FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/FormEncode.mo
===================================================================
(Binary files differ)
Property changes on: FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/FormEncode.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/FormEncode.po
===================================================================
--- FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/FormEncode.po (rev 0)
+++ FormEncode/trunk/formencode/i18n/pl/LC_MESSAGES/FormEncode.po 2007-06-16 06:59:30 UTC (rev 2718)
@@ -0,0 +1,324 @@
+# Polish strings for FormEncode
+# Copyright (C) 2007 Robert Wojciechowicz, licence: LGPL V2.0
+# Robert Wojciechowicz <rw...@sm...>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: FormEncode 0.7.1\n"
+"POT-Creation-Date: 2006-09-26 07:57+CEST\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Robert Wojciechowicz <rw...@sm...>\n"
+"Language-Team: Robert Wojciechowicz <rw...@sm...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: api.py:319 validators.py:433
+msgid "Please enter a value"
+msgstr "Proszę podać wartość"
+
+#: api.py:320
+msgid "The input must be a string (not a %(type)s: %(value)r)"
+msgstr "Proszę podać ciąg znaków (nie %(type)s: %(value)r)"
+
+#: api.py:321
+msgid "The input must be a string (not None)"
+msgstr "Proszę podać ciąg znaków (nie None)"
+
+#: validators.py:160
+msgid "%(object)r is not a subclass of %(subclass)s"
+msgstr "%(object)r nie jest podklasą %(subclass)s"
+
+#: validators.py:161
+msgid "%(object)r is not a subclass of one of the types %(subclassList)s"
+msgstr "%(object)r nie jest podklasą żadnego z typów %(subclassList)s"
+
+#: validators.py:162
+msgid "%(object)r must be one of the types %(typeList)s"
+msgstr "%(object)r musi być jednym z takich typów: %(typeList)s"
+
+#: validators.py:163
+msgid "%(object)r must be of the type %(type)s"
+msgstr "%(object)r musi być typu %(type)s"
+
+#: validators.py:344
+msgid "Enter a value less than %(maxLength)i characters long"
+msgstr "Wprowadź wartość z mniejszą liczbą znaków niż %(maxLength)i"
+
+#: validators.py:345 validators.py:399
+msgid "Invalid value (value with length expected)"
+msgstr "Błędna wartość (oczekiwana wartość z długością)"
+
+#: validators.py:398
+msgid "Enter a value at least %(minLength)i characters long"
+msgstr "Wprowadź wartość z liczbą znaków minimum %(minLength)i"
+
+#: validators.py:458
+msgid "You cannot enter a value here"
+msgstr "Nie możesz wprowadzić tu wartości"
+
+#: validators.py:509
+msgid "The input is not valid"
+msgstr "Błędne dane"
+
+#: validators.py:565
+msgid "Enter only letters, numbers, or _ (underscore)"
+msgstr "Proszę podać tylko litery, cyfry lub _ (znak podkreślenia)"
+
+#: validators.py:604
+msgid "Invalid value"
+msgstr "Błędna wartość"
+
+#: validators.py:605
+msgid "Value must be one of: %(items)s (not %(value)r)"
+msgstr "Wartość musi być jedną z tych: %(items)s (nie %(value)r) "
+
+#: validators.py:668
+msgid "Choose something"
+msgstr "Wybierz coś"
+
+#: validators.py:669
+msgid "Enter a value from: %(items)s"
+msgstr "Wprowadź jedną z wartości: %(items)s"
+
+#: validators.py:670
+msgid "That value is not known"
+msgstr "Wartość nieznana"
+
+#: validators.py:671
+msgid "Nothing in my dictionary goes by the value %(value)s. Choose one of: %(items)s"
+msgstr "Mój słownik nie zawiera wartości: %(value)s. Wybierz jedną z wartości: %(items)s"
+
+#: validators.py:732
+msgid "Must be an integer index"
+msgstr "Musi to być wartość całkowita."
+
+#: validators.py:733
+msgid "Index out of range"
+msgstr "Indeks poza zakresem"
+
+#: validators.py:734
+msgid "Item %(value)s was not found in the list"
+msgstr "Wartość %(value)s nie została znaleziona na liście"
+
+#: validators.py:809
+msgid "Date must be after %(date)s"
+msgstr "Data musi następować po %(date)s"
+
+#: validators.py:810
+msgid "Date must be before %(date)s"
+msgstr "Data musi występować przed %(date)s"
+
+#: validators.py:812
+msgid "%%A, %%d %%B %%Y"
+msgstr "%%A, %%d %%B %%Y"
+
+#: validators.py:813
+msgid "The date must be sometime in the future"
+msgstr "Data musi odnosić się do przyszłości"
+
+#: validators.py:913
+msgid "Please enter an integer value"
+msgstr "Proszę podać liczbę całkowitą"
+
+#: validators.py:945
+msgid "Please enter a number"
+msgstr "Proszę podać liczbę"
+
+#: validators.py:998
+msgid "Enter a value less than %(max)i characters long"
+msgstr "Proszę podać wartość krótszą niż %(max)i znaków"
+
+#: validators.py:999
+msgid "Enter a value %(min)i characters long or more"
+msgstr "Proszę podać wartość z minimum %(min)i lub więcej znaków"
+
+#: validators.py:1050
+msgid "Invalid data or incorrect encoding"
+msgstr "Błędne dane lub niewłaściwe kodowanie"
+
+#: validators.py:1178
+msgid "Please enter an email address"
+msgstr "Proszę podać adres e-mail"
+
+#: validators.py:1179
+msgid "An email address must contain a single @"
+msgstr "Adres e-mail musi zawierać pojedyńczy znak @"
+
+#: validators.py:1180
+msgid "The username portion of the email address is invalid (the portion before the @: %(username)s)"
+msgstr "Nazwa użytkownika w adresie e-mail jest błędna (część przed @: %(username)s)"
+
+#: validators.py:1181 validators.py:1294
+msgid "An error occured when trying to connect to the server: %(error)s"
+msgstr "Wystąpił błąd przy próbie połączenia z serwerem: %(error)s"
+
+#: validators.py:1182
+msgid "The domain portion of the email address is invalid (the portion after the @: %(domain)s)"
+msgstr "Nazwa domeny w adresie e-mail jest błędna (część po @: %(domain)s)"
+
+#: validators.py:1183
+msgid "The domain of the email address does not exist (the portion after the @: %(domain)s)"
+msgstr "Nazwa domeny adresu e-mail nie istnieje (część po @: %(domain)s)"
+
+#: validators.py:1291
+msgid "You must start your URL with http://, https://, etc"
+msgstr "URL musi się zaczynać od http://, https://, etc"
+
+#: validators.py:1292
+msgid "That is not a valid URL"
+msgstr "To jest błędny URL"
+
+#: validators.py:1293
+msgid "An error occurred when trying to access the URL: %(error)s"
+msgstr "Przy próbie dostępu do URL-a wystąpił błąd: %(error)s"
+
+#: validators.py:1295
+msgid "The server responded that the page could not be found"
+msgstr "Serwer odpowiedział, iż ta strona nie została znaleziona."
+
+#: validators.py:1296
+msgid "The server responded with a bad status code (%(status)s)"
+msgstr "Serwer odpowiedział złym kodem statusu (%(status)s)"
+
+#: validators.py:1399
+msgid "Please enter a state code"
+msgstr "Proszę podać kod państwa"
+
+#: validators.py:1400
+msgid "Please enter a state code with TWO letters"
+msgstr "Proszę podać kod państwa z DWOMA literami"
+
+#: validators.py:1401
+msgid "That is not a valid state code"
+msgstr "To jest błędny kod państwa"
+
+#: validators.py:1452
+msgid "Please enter a number, with area code, in the form ###-###-####, optionally with \"ext.####\""
+msgstr "Proszę podać numer z numerem kierunkowym w formacie ###-###-####, opcjonalnie z \"ext.####\""
+
+#: validators.py:1614 validators.py:1622
+msgid "Please enter the date in the form %(format)s"
+msgstr "Proszę podać datę w formacie %(format)s"
+
+#: validators.py:1615
+msgid "Please enter a month from 1 to 12"
+msgstr "Proszę podać miesiąc od 1 do 12"
+
+#: validators.py:1616
+msgid "Please enter a valid day"
+msgstr "Proszę podać prawidłowy dzień"
+
+#: validators.py:1617
+msgid "That month only has %(days)i days"
+msgstr "Ten miesiąc ma tylko %(days)i dni"
+
+#: validators.py:1618
+msgid "That is not a valid day (%(exception)s)"
+msgstr "To nie jest prawidłowy dzień (%(exception)s)"
+
+#: validators.py:1619
+msgid "Unknown month name: %(month)s"
+msgstr "Nieznana nazwa miesiąca: %(month)s"
+
+#: validators.py:1620
+msgid "Please enter a number for the year"
+msgstr "Proszę podać rok"
+
+#: validators.py:1621
+msgid "Please enter a four-digit year"
+msgstr "Proszę podać czterocyfrowy rok"
+
+#: validators.py:1800
+msgid "You must indicate AM or PM"
+msgstr "Musisz podać AM lub PM"
+
+#: validators.py:1801
+msgid "There are too many :'s"
+msgstr "Jest tu za wiele :'s"
+
+#: validators.py:1802
+msgid "You may not enter seconds"
+msgstr "Nie można podawać sekund"
+
+#: validators.py:1803
+msgid "You must enter seconds"
+msgstr "Musisz podać sekundy"
+
+#: validators.py:1804
+msgid "You must enter minutes (after a :)"
+msgstr "Musisz podać minuty (po :)"
+
+#: validators.py:1805
+msgid "The %(part)s value you gave is not a number: %(number)r"
+msgstr "Podana wartość %(part)s nie jest liczbą: %(number)r"
+
+#: validators.py:1806
+msgid "You must enter an hour in the range %(range)s"
+msgstr "Musisz podać godzinę z zakresu %(range)s"
+
+#: validators.py:1807
+msgid "You must enter a minute in the range 0-59"
+msgstr "Musisz podać minutę z zakreu 0-59"
+
+#: validators.py:1808
+msgid "You must enter a second in the range 0-59"
+msgstr "Musisz podać sekundę z zakresu 0-59"
+
+#: validators.py:1962
+msgid "Please enter a zip code (5 digits)"
+msgstr "Proszę podać kod pocztowy (5 cyfr)"
+
+#: validators.py:1986
+msgid "The name %(name)s is missing"
+msgstr "Brakuje nazwy %(name)s"
+
+#: validators.py:2027
+msgid "Value should be %(true)r or %(false)r"
+msgstr "Wartość powinna być %(true)r lub %(false)r"
+
+#: validators.py:2062
+msgid "Value does not contain a signature"
+msgstr "Wartość nie zawiera podpisu"
+
+#: validators.py:2063
+msgid "Signature is not correct"
+msgstr "Podpis jest niewłaściwy"
+
+#: validators.py:2185
+msgid "Fields do not match (should be %(match)s)"
+msgstr "Pola się nie zgadzają (powinny zawierać %(match)s)"
+
+#: validators.py:2186
+msgid "Fields do not match"
+msgstr "Pola się nie zgadzają"
+
+#: validators.py:2248
+msgid "Please enter only the number, no other characters"
+msgstr "Proszę podać tylko liczbę bez żadnych innych znaków"
+
+#: validators.py:2249
+msgid "You did not enter a valid number of digits"
+msgstr "Podałe(a)ś nieprawidłową ilość cyfr"
+
+#: validators.py:2250
+msgid "That number is not valid"
+msgstr "Ta liczba jest błędna"
+
+#: validators.py:2365
+msgid "Please enter numbers only for month and year"
+msgstr "Proszę podać tylko liczby dla miesiąca i roku"
+
+#: validators.py:2366
+msgid "Invalid Expiration Date"
+msgstr "Błędna data utraty ważności"
+
+#: validators.py:2435
+msgid "Please enter numbers only for credit card security code"
+msgstr "Proszę podać tylko liczby kodu bezpieczeństwa karty kredytowej"
+
+#: validators.py:2436
+msgid "Invalid credit card security code length"
+msgstr "Błędna długość kodu bezpieczeństwa karty kredytowej"
Modified: FormEncode/trunk/tests/test_i18n.py
===================================================================
--- FormEncode/trunk/tests/test_i18n.py 2007-06-08 19:58:47 UTC (rev 2717)
+++ FormEncode/trunk/tests/test_i18n.py 2007-06-16 06:59:30 UTC (rev 2718)
@@ -86,3 +86,7 @@
def test_nl():
_test_lang("nl", u"Voer een waarde in")
+
+def test_pl():
+ _test_lang("pl", u"Proszę podać wartość")
+
|
|
From: <sub...@co...> - 2007-06-05 23:25:38
|
Author: ianb
Date: 2007-06-05 17:25:42 -0600 (Tue, 05 Jun 2007)
New Revision: 2708
Modified:
FormEncode/trunk/formencode/validators.py
Log:
added a bit more explanation in the docstring
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-06-05 23:25:26 UTC (rev 2707)
+++ FormEncode/trunk/formencode/validators.py 2007-06-05 23:25:42 UTC (rev 2708)
@@ -1607,6 +1607,20 @@
there may be extra values ``'original_filename'`` and
``'original_content'``, which may want to use in your form to show
the user you still have their content around.
+
+ To use this, make sure you are using variabledecode, then use
+ something like::
+
+ <input type="file" name="myfield.upload">
+ <input type="hidden" name="myfield.static">
+
+ Then in your scheme::
+
+ class MyScheme(Scheme):
+ myfield = FileUploadKeeper()
+
+ Note that big file uploads mean big hidden fields, and lots of
+ bytes passed back and forth in the case of an error.
"""
upload_key = 'upload'
|
|
From: <sub...@co...> - 2007-06-05 23:25:28
|
Author: ianb
Date: 2007-06-05 17:25:26 -0600 (Tue, 05 Jun 2007)
New Revision: 2707
Modified:
FormEncode/trunk/tests/test_htmlfill.py
Log:
remove print
Modified: FormEncode/trunk/tests/test_htmlfill.py
===================================================================
--- FormEncode/trunk/tests/test_htmlfill.py 2007-06-05 23:13:22 UTC (rev 2706)
+++ FormEncode/trunk/tests/test_htmlfill.py 2007-06-05 23:25:26 UTC (rev 2707)
@@ -8,8 +8,6 @@
os.path.abspath(__file__))))
if base_dir not in sys.path:
sys.path.insert(0, base_dir)
-import formencode
-print '>>>>', formencode.__file__
from formencode import htmlfill
from formencode.doctest_xml_compare import xml_compare
from elementtree import ElementTree as et
|
|
From: <sub...@co...> - 2007-05-25 23:54:01
|
Author: pjenvey
Date: 2007-05-25 17:53:52 -0600 (Fri, 25 May 2007)
New Revision: 2703
Modified:
FormEncode/trunk/formencode/htmlfill.py
FormEncode/trunk/tests/test_htmlfill.py
Log:
o fix charref unescaping, added a test
o removed debug statements
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2007-05-25 02:00:09 UTC (rev 2702)
+++ FormEncode/trunk/formencode/htmlfill.py 2007-05-25 23:53:52 UTC (rev 2703)
@@ -264,8 +264,8 @@
def add_key(self, key):
self.used_keys[key] = 1
- _entityref_re = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*);')
- _charref_re = re.compile('&#(?:[0-9]+|[xX][0-9a-fA-F]+);')
+ _entityref_re = re.compile('&([a-zA-Z][-.a-zA-Z\d]*);')
+ _charref_re = re.compile('&#(\d+|[xX][a-fA-F\d]+);')
def unescape(self, s):
s = self._entityref_re.sub(self._sub_entityref, s)
@@ -282,8 +282,8 @@
def _sub_charref(self, match):
num = match.group(1)
- if num.lower().startswith('0x'):
- num = int(num, 16)
+ if num.lower().startswith('x'):
+ num = int(num[1:], 16)
else:
num = int(num)
return unichr(num)
@@ -368,7 +368,6 @@
self.used_errors[name] = 1
def handle_input(self, attrs, startend):
- print 'attrs', attrs
t = (self.get_attr(attrs, 'type') or 'text').lower()
name = self.get_attr(attrs, 'name')
self.write_marker(name)
@@ -428,7 +427,6 @@
self.skip_next = True
self.add_key(name)
elif t == 'submit' or t == 'reset' or t == 'button':
- print 'set_attr', repr(value or self.get_attr(attrs, 'value', ''))
self.set_attr(attrs, 'value', value or
self.get_attr(attrs, 'value', ''))
self.write_tag('input', attrs, startend)
Modified: FormEncode/trunk/tests/test_htmlfill.py
===================================================================
--- FormEncode/trunk/tests/test_htmlfill.py 2007-05-25 02:00:09 UTC (rev 2702)
+++ FormEncode/trunk/tests/test_htmlfill.py 2007-05-25 23:53:52 UTC (rev 2703)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
import sys
import os
import re
@@ -82,3 +83,7 @@
== '<input type="submit" value="next>%s">' % rarr)
assert (htmlfill.render('<input type="submit" value="1&2">', {}, {})
== '<input type="submit" value="1&2">')
+ assert (htmlfill.render('<input type="submit" value="Japan - 日本 Nihon" />',
+ {}, {}) ==
+ u'<input type="submit" value="Japan - 日本 Nihon" />')
+
|
|
From: <sub...@co...> - 2007-05-25 02:00:11
|
Author: ianb
Date: 2007-05-24 20:00:09 -0600 (Thu, 24 May 2007)
New Revision: 2702
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/validators.py
Log:
Include InternationalPhoneNumber
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-05-25 01:55:04 UTC (rev 2701)
+++ FormEncode/trunk/docs/news.txt 2007-05-25 02:00:09 UTC (rev 2702)
@@ -25,6 +25,9 @@
* Fix problem with looking up A records for email addresses.
+* Include ``formencode.validators.InternationalPhoneNumber`` from
+ W-Mark Kubacki.
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-05-25 01:55:04 UTC (rev 2701)
+++ FormEncode/trunk/formencode/validators.py 2007-05-25 02:00:09 UTC (rev 2702)
@@ -1426,10 +1426,9 @@
class PhoneNumber(FancyValidator):
"""
- Validates, and converts to ###-###-####, optionally with
- extension (as ext.##...)
-
- @@: should add international phone number support
+ Validates, and converts to ###-###-####, optionally with extension
+ (as ext.##...). Only support US phone numbers. See
+ InternationalPhoneNumber for support for that kind of phone number.
::
@@ -1475,6 +1474,108 @@
result = result + " ext.%s" % match.group(4)
return result
+# from dbmanager.intl_util.validators@r313[208:303]
+class IPhoneNumberValidator(FancyValidator):
+
+ """
+ Validates, and converts phone numbers to +##-###-#######.
+ Adapted from RFC 3966
+
+ ::
+
+ >>> p = IPhoneNumberValidator()
+ >>> p.to_python('333-3333')
+ Traceback (most recent call last):
+ ...
+ Invalid: Please enter a number, with area code, in the form +##-###-#######.
+ >>> p.to_python('0555/4860-300')
+ '+49-555-4860-300'
+ >>> p.to_python('0555-49924-51')
+ '+49-555-49924-51'
+ >>> p.to_python('0555/8114100')
+ '+49-555-8114100'
+ >>> p.to_python('0555 8114100')
+ '+49-555-8114100'
+ >>> p.to_python(' +49 (0)555 350 60 0')
+ '+49-555-35060-0'
+ >>> p.to_python('+49 555 350600')
+ '+49-555-350600'
+ >>> p.to_python('0049/ 555/ 871 82 96')
+ '+49-555-87182-96'
+ >>> p.to_python('0555-2 50-30')
+ '+49-555-250-30'
+ >>> p.to_python('(05 55)4 94 33 47')
+ '+49-555-49433-47'
+ >>> p.to_python('+973-555431')
+ '+973-555431'
+ >>> p.to_python('1-393-555-3939')
+ '+1-393-555-3939'
+ >>> p.to_python('+43 (1) 55528/0')
+ '+43-1-55528-0'
+ >>> p.to_python('+43 5555 429 62-0')
+ '+43-5555-42962-0'
+ >>> p.to_python('00 218 55 33 50 317 321')
+ '+218-55-3350317-321'
+ >>> p.to_python('+218 (0)55-3636639/38')
+ '+218-55-3636639-38'
+ """
+
+ strip = True
+ # Use if there's a default country code you want to use:
+ default_cc = None
+ _mark_chars_re = re.compile(r"[_.!~*'/]")
+ _preTransformations = [
+ (re.compile(r'^\((\d+)\s*(\d+)\)(.+)$'), '%s%s-%s'),
+ (re.compile(r'^(?:1-)(\d+.+)$'), '+1-%s'),
+ (re.compile(r'^00\s*(\d+.+)$'), '+%s'),
+ (re.compile(r'^(\+\d+)\s+\(0\)\s*(\d+.+)$'), '%s-%s'),
+ (re.compile(r'^(0\d+)\s(\d+)$'), '%s-%s'),
+ ]
+ _ccIncluder = [
+ (re.compile(r'^0([1-9]\d*)\-(\d+.*)$'), '+%d-%s-%s'),
+ ]
+ _postTransformations = [
+ (re.compile(r'^(\+\d+)[-\s]\(?(\d+)\)?[-\s](\d+.+)$'), '%s-%s-%s'),
+ (re.compile(r'^(.+)\s(\d+)$'), '%s-%s'),
+ ]
+ _phoneIsSane = re.compile(r'^(\+[1-9]\d*)-([\d\-]+)$')
+
+ messages = {
+ 'phoneFormat': _('Please enter a number, with area code, in the form +##-###-#######.'),
+ }
+
+ def _perform_rex_transformation(self, value, transformations):
+ for rex, trf in transformations:
+ match = rex.search(value)
+ if match:
+ value = trf % match.groups()
+ return value
+
+ def _prepend_country_code(self, value, transformations, country_code):
+ for rex, trf in transformations:
+ match = rex.search(value)
+ if match:
+ return trf % ((country_code,)+match.groups())
+ return value
+
+ def _to_python(self, value, state):
+ self.assert_string(value, state)
+ value = self._perform_rex_transformation(value, self._preTransformations)
+ value = self._mark_chars_re.sub('-', value)
+ if self.default_cc:
+ value = self._prepend_country_code(value, self._ccIncluder, self.default_cc)
+ for f, t in [(' ', ' '), ('--', '-'), (' - ', '-'), ('- ', '-'), (' -', '-')]:
+ value = value.replace(f, t)
+ value = self._perform_rex_transformation(value, self._postTransformations)
+ value = value.replace(' ', '')
+ # did we successfully transform that phone number? Thus, is it valid?
+ if not self._phoneIsSane.search(value):
+ raise Invalid(self.message('phoneFormat', state), value, state)
+ return value
+
+
+
+
class FieldStorageUploadConverter(FancyValidator):
"""
Converts a cgi.FieldStorage instance to
|
|
From: <sub...@co...> - 2007-05-25 01:55:05
|
Author: ianb
Date: 2007-05-24 19:55:04 -0600 (Thu, 24 May 2007)
New Revision: 2701
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/validators.py
Log:
Fix for DNS from Jacob Smullyan
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-05-25 01:52:10 UTC (rev 2700)
+++ FormEncode/trunk/docs/news.txt 2007-05-25 01:55:04 UTC (rev 2701)
@@ -23,6 +23,8 @@
* Fix problem with HTMLParser's default unescaping routing, which only
understood a very limited number of entities in attribute values.
+* Fix problem with looking up A records for email addresses.
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2007-05-25 01:52:10 UTC (rev 2700)
+++ FormEncode/trunk/formencode/validators.py 2007-05-25 01:55:04 UTC (rev 2701)
@@ -1230,8 +1230,10 @@
if self.resolve_domain:
assert have_dns, "pyDNS should be available"
try:
- a=DNS.DnsRequest(domain).req().answers
- dnsdomains=[x['data'] for x in a if x['typename'] in ('A', 'MX')]
+ a=DNS.DnsRequest(domain, qtype='mx').req().answers
+ if not a:
+ a=DNS.DnsRequest(domain, qtype='a').req().answers
+ dnsdomains=[x['data'] for x in a]
except (socket.error, DNS.DNSError), e:
raise Invalid(
self.message('socketError', state, error=e),
|
|
From: <sub...@co...> - 2007-05-25 01:52:13
|
Author: ianb
Date: 2007-05-24 19:52:10 -0600 (Thu, 24 May 2007)
New Revision: 2700
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/htmlfill.py
FormEncode/trunk/tests/test_htmlfill.py
Log:
Fix problem with entity def unescaping in attribute values
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-05-25 01:32:05 UTC (rev 2699)
+++ FormEncode/trunk/docs/news.txt 2007-05-25 01:52:10 UTC (rev 2700)
@@ -20,6 +20,9 @@
* Fixed bug in htmlfill when a document ends with no trailing text
after the last tag.
+* Fix problem with HTMLParser's default unescaping routing, which only
+ understood a very limited number of entities in attribute values.
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2007-05-25 01:32:05 UTC (rev 2699)
+++ FormEncode/trunk/formencode/htmlfill.py 2007-05-25 01:52:10 UTC (rev 2700)
@@ -6,6 +6,7 @@
import HTMLParser
import cgi
import re
+from htmlentitydefs import name2codepoint
__all__ = ['render', 'htmlliteral', 'default_formatter',
'none_formatter', 'escape_formatter',
@@ -263,6 +264,30 @@
def add_key(self, key):
self.used_keys[key] = 1
+ _entityref_re = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*);')
+ _charref_re = re.compile('&#(?:[0-9]+|[xX][0-9a-fA-F]+);')
+
+ def unescape(self, s):
+ s = self._entityref_re.sub(self._sub_entityref, s)
+ s = self._charref_re.sub(self._sub_charref, s)
+ return s
+
+ def _sub_entityref(self, match):
+ name = match.group(1)
+ if name not in name2codepoint:
+ # If we don't recognize it, pass it through as though it
+ # wasn't an entity ref at all
+ return match.group(0)
+ return unichr(name2codepoint[name])
+
+ def _sub_charref(self, match):
+ num = match.group(1)
+ if num.lower().startswith('0x'):
+ num = int(num, 16)
+ else:
+ num = int(num)
+ return unichr(num)
+
def handle_starttag(self, tag, attrs, startend=False):
self.write_pos()
if tag == 'input':
@@ -343,6 +368,7 @@
self.used_errors[name] = 1
def handle_input(self, attrs, startend):
+ print 'attrs', attrs
t = (self.get_attr(attrs, 'type') or 'text').lower()
name = self.get_attr(attrs, 'name')
self.write_marker(name)
@@ -402,6 +428,7 @@
self.skip_next = True
self.add_key(name)
elif t == 'submit' or t == 'reset' or t == 'button':
+ print 'set_attr', repr(value or self.get_attr(attrs, 'value', ''))
self.set_attr(attrs, 'value', value or
self.get_attr(attrs, 'value', ''))
self.write_tag('input', attrs, startend)
Modified: FormEncode/trunk/tests/test_htmlfill.py
===================================================================
--- FormEncode/trunk/tests/test_htmlfill.py 2007-05-25 01:32:05 UTC (rev 2699)
+++ FormEncode/trunk/tests/test_htmlfill.py 2007-05-25 01:52:10 UTC (rev 2700)
@@ -1,6 +1,7 @@
import sys
import os
import re
+from htmlentitydefs import name2codepoint
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
@@ -72,4 +73,12 @@
checker(p, listener.schema())
def test_no_trailing_newline():
- assert htmlfill.render('<html><body></body></html>',{},{}) == '<html><body></body></html>'
+ assert (htmlfill.render('<html><body></body></html>', {}, {})
+ == '<html><body></body></html>')
+
+def test_escape_defaults():
+ rarr = unichr(name2codepoint['rarr'])
+ assert (htmlfill.render('<input type="submit" value="next>→">', {}, {})
+ == '<input type="submit" value="next>%s">' % rarr)
+ assert (htmlfill.render('<input type="submit" value="1&2">', {}, {})
+ == '<input type="submit" value="1&2">')
|
|
From: <sub...@co...> - 2007-05-25 01:32:06
|
Author: ianb
Date: 2007-05-24 19:32:05 -0600 (Thu, 24 May 2007)
New Revision: 2699
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/htmlfill.py
FormEncode/trunk/tests/test_htmlfill.py
Log:
fix bug with no trailing newline, reported by Graham Stratton
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-05-25 01:27:48 UTC (rev 2698)
+++ FormEncode/trunk/docs/news.txt 2007-05-25 01:32:05 UTC (rev 2699)
@@ -17,6 +17,9 @@
* Be friendlier when loaded from a zip file (as with py2exe);
previously only egg zip files would work.
+* Fixed bug in htmlfill when a document ends with no trailing text
+ after the last tag.
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2007-05-25 01:27:48 UTC (rev 2698)
+++ FormEncode/trunk/formencode/htmlfill.py 2007-05-25 01:32:05 UTC (rev 2699)
@@ -208,6 +208,7 @@
HTMLParser.HTMLParser.feed(self, data)
def close(self):
+ self.handle_misc(None)
HTMLParser.HTMLParser.close(self)
unused_errors = self.errors.copy()
for key in self.used_errors.keys():
Modified: FormEncode/trunk/tests/test_htmlfill.py
===================================================================
--- FormEncode/trunk/tests/test_htmlfill.py 2007-05-25 01:27:48 UTC (rev 2698)
+++ FormEncode/trunk/tests/test_htmlfill.py 2007-05-25 01:32:05 UTC (rev 2699)
@@ -70,3 +70,6 @@
print expected
assert 0
checker(p, listener.schema())
+
+def test_no_trailing_newline():
+ assert htmlfill.render('<html><body></body></html>',{},{}) == '<html><body></body></html>'
|
|
From: <sub...@co...> - 2007-05-25 01:27:52
|
Author: ianb
Date: 2007-05-24 19:27:48 -0600 (Thu, 24 May 2007)
New Revision: 2698
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/api.py
Log:
work with zip files (as with py2exe)
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-05-21 22:05:33 UTC (rev 2697)
+++ FormEncode/trunk/docs/news.txt 2007-05-25 01:27:48 UTC (rev 2698)
@@ -14,6 +14,9 @@
* Added encoding parameter to htmlfill, which will handle cases when mixed
str and unicode objects are used (turning all str objects into unicode)
+* Be friendlier when loaded from a zip file (as with py2exe);
+ previously only egg zip files would work.
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/api.py
===================================================================
--- FormEncode/trunk/formencode/api.py 2007-05-21 22:05:33 UTC (rev 2697)
+++ FormEncode/trunk/formencode/api.py 2007-05-25 01:27:48 UTC (rev 2698)
@@ -6,7 +6,10 @@
import textwrap
import re
import os
-from pkg_resources import resource_filename
+try:
+ from pkg_resources import resource_filename
+except ImportError:
+ resource_filename = None
__all__ = ['NoDefault', 'Invalid', 'Validator', 'Identity',
'FancyValidator', 'is_validator']
@@ -14,7 +17,13 @@
import gettext
def get_localedir():
- return resource_filename(__name__, "/i18n")
+ if resource_filename is not None:
+ try:
+ return resource_filename(__name__, "/i18n")
+ except NotImplementedError:
+ # resource_filename doesn't work with non-egg zip files
+ pass
+ return os.path.join(os.path.dirname(__file__), 'i18n')
def set_stdtranslation(domain="FormEncode", languages=None, \
localedir = get_localedir()):
|
|
From: <sub...@co...> - 2007-05-21 22:05:37
|
Author: pjenvey
Date: 2007-05-21 16:05:33 -0600 (Mon, 21 May 2007)
New Revision: 2697
Added:
FormEncode/trunk/tests/htmlfill_data/data-form-last-element.txt
Removed:
FormEncode/trunk/tests/htmlfill_data/form-last-element.txt
Log:
prefix this test with data- so its actually included in the htmlfill tests
Copied: FormEncode/trunk/tests/htmlfill_data/data-form-last-element.txt (from rev 2696, FormEncode/trunk/tests/htmlfill_data/form-last-element.txt)
===================================================================
--- FormEncode/trunk/tests/htmlfill_data/data-form-last-element.txt (rev 0)
+++ FormEncode/trunk/tests/htmlfill_data/data-form-last-element.txt 2007-05-21 22:05:33 UTC (rev 2697)
@@ -0,0 +1,7 @@
+<select name='num'><option
+value='1'>ONE</option></select>
+----
+<select name="num"><option value="1"
+selected="selected">ONE</option></select>
+----
+defaults={"num":"1"}
Deleted: FormEncode/trunk/tests/htmlfill_data/form-last-element.txt
===================================================================
--- FormEncode/trunk/tests/htmlfill_data/form-last-element.txt 2007-05-18 03:57:17 UTC (rev 2696)
+++ FormEncode/trunk/tests/htmlfill_data/form-last-element.txt 2007-05-21 22:05:33 UTC (rev 2697)
@@ -1,7 +0,0 @@
-<select name='num'><option
-value='1'>ONE</option></select>
-----
-<select name="num"><option value="1"
-selected="selected">ONE</option></select>
-----
-defaults={"num":"1"}
|
|
From: <sub...@co...> - 2007-05-18 03:57:23
|
Author: pjenvey
Date: 2007-05-17 21:57:17 -0600 (Thu, 17 May 2007)
New Revision: 2696
Modified:
FormEncode/trunk/docs/Validator.txt
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/api.py
Log:
added support for Paste's MultiDict dictionary as input to
Schema.to_python, by converting it to a normal dict via MultiDict.mixed.
Previously MultiDicts wouldn't work with CompoundValidators (like
ForEach)
Modified: FormEncode/trunk/docs/Validator.txt
===================================================================
--- FormEncode/trunk/docs/Validator.txt 2007-05-16 14:49:23 UTC (rev 2695)
+++ FormEncode/trunk/docs/Validator.txt 2007-05-18 03:57:17 UTC (rev 2696)
@@ -192,11 +192,11 @@
Like any other validator, a ``Registration`` instance will have the
``to_python`` and ``from_python`` methods. The input should be a
-dictionary, with keys like ``"first_name"``, ``"password"``, etc. The
-validators you give as attributes will be applied to each of the
-values of the dictionary. *All* the values will be validated, so if
-there are multiple invalid fields you will get information about all
-of them.
+dictionary (or a Paste MultiDict), with keys like ``"first_name"``,
+``"password"``, etc. The validators you give as attributes will be
+applied to each of the values of the dictionary. *All* the values
+will be validated, so if there are multiple invalid fields you will
+get information about all of them.
Most validators (anything that subclasses
``formencode.FancyValidator``) will take a certain standard set of
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-05-16 14:49:23 UTC (rev 2695)
+++ FormEncode/trunk/docs/news.txt 2007-05-18 03:57:17 UTC (rev 2696)
@@ -6,6 +6,11 @@
svn trunk
---------
+* Added support for Paste's MultiDict dictionary as input to
+ Schema.to_python, by converting it to a normal dict via MultiDict.mixed.
+ Previously MultiDicts wouldn't work with CompoundValidators (like
+ ForEach)
+
* Added encoding parameter to htmlfill, which will handle cases when mixed
str and unicode objects are used (turning all str objects into unicode)
Modified: FormEncode/trunk/formencode/api.py
===================================================================
--- FormEncode/trunk/formencode/api.py 2007-05-16 14:49:23 UTC (rev 2695)
+++ FormEncode/trunk/formencode/api.py 2007-05-18 03:57:17 UTC (rev 2696)
@@ -352,6 +352,9 @@
try:
if self.strip and isinstance(value, (str, unicode)):
value = value.strip()
+ elif hasattr(value, 'mixed'):
+ # Support Paste's MultiDict
+ value = value.mixed()
if self.is_empty(value):
if self.not_empty:
raise Invalid(self.message('empty', state), value, state)
|
|
From: <sub...@co...> - 2007-05-08 22:33:35
|
Author: ianb
Date: 2007-05-08 16:33:34 -0600 (Tue, 08 May 2007)
New Revision: 2661
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/htmlfill.py
Log:
Added encoding parameter to htmlfill.htmlrender
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2007-05-08 15:07:11 UTC (rev 2660)
+++ FormEncode/trunk/docs/news.txt 2007-05-08 22:33:34 UTC (rev 2661)
@@ -3,6 +3,12 @@
.. contents::
+svn trunk
+---------
+
+* Added encoding parameter to htmlfill, which will handle cases when mixed
+ str and unicode objects are used (turning all str objects into unicode)
+
0.7.1
-----
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2007-05-08 15:07:11 UTC (rev 2660)
+++ FormEncode/trunk/formencode/htmlfill.py 2007-05-08 22:33:34 UTC (rev 2661)
@@ -14,7 +14,7 @@
def render(form, defaults=None, errors=None, use_all_keys=False,
error_formatters=None, add_attributes=None,
auto_insert_errors=True, auto_error_formatter=None,
- text_as_default=False, listener=None):
+ text_as_default=False, listener=None, encoding=None):
"""
Render the ``form`` (which should be a string) given the defaults
and errors. Defaults are the values that go in the input fields
@@ -52,6 +52,9 @@
``listener`` can be an object that watches fields pass; the only
one currently is in ``htmlfill_schemabuilder.SchemaBuilder``
+
+ ``encoding`` specifies an encoding to assume when mixing str and
+ unicode text in the template.
"""
if defaults is None:
defaults = {}
@@ -64,7 +67,7 @@
add_attributes=add_attributes,
auto_error_formatter=auto_error_formatter,
text_as_default=text_as_default,
- listener=listener,
+ listener=listener, encoding=encoding,
)
p.feed(form)
p.close()
@@ -166,7 +169,7 @@
error_formatters=None, error_class='error',
add_attributes=None, listener=None,
auto_error_formatter=None,
- text_as_default=False):
+ text_as_default=False, encoding=None):
HTMLParser.HTMLParser.__init__(self)
self._content = []
self.source = None
@@ -193,6 +196,7 @@
self.listener = listener
self.auto_error_formatter = auto_error_formatter
self.text_as_default = text_as_default
+ self.encoding = encoding
def feed(self, data):
self.data_is_str = isinstance(data, str)
@@ -231,6 +235,13 @@
assert False, (
"These errors were not used in the form: %s" %
', '.join(error_text))
+ if self.encoding is not None:
+ new_content = []
+ for item in self._content:
+ if isinstance(item, str):
+ item = item.decode(self.encoding)
+ new_content.append(item)
+ self._content = new_content
try:
self._text = ''.join([
t for t in self._content if not isinstance(t, tuple)])
|
|
From: <sub...@co...> - 2007-04-26 08:47:02
|
Author: gh
Date: 2007-04-26 02:30:06 -0600 (Thu, 26 Apr 2007)
New Revision: 2609
Added:
FormEncode/trunk/formencode/i18n/nl/
FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/
FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/FormEncode.mo
FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/FormEncode.po
Modified:
FormEncode/trunk/tests/test_i18n.py
Log:
added nl (dutch) translation
Added: FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/FormEncode.mo
===================================================================
(Binary files differ)
Property changes on: FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/FormEncode.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/FormEncode.po
===================================================================
--- FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/FormEncode.po (rev 0)
+++ FormEncode/trunk/formencode/i18n/nl/LC_MESSAGES/FormEncode.po 2007-04-26 08:30:06 UTC (rev 2609)
@@ -0,0 +1,324 @@
+# Dutch translation for formencode messages
+# Copyright (C) 2007, The Health Agency
+# Jan-Wijbrand Kolman <jk...@th...>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: r2591\n"
+"POT-Creation-Date: 2006-10-02 20:59+CEST\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Jan-Wijbrand Kolman <jk...@th...>\n"
+"Language-Team: LANGUAGE <LL...@li...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: api.py:335 validators.py:433
+msgid "Please enter a value"
+msgstr "Voer een waarde in"
+
+#: api.py:336
+msgid "The input must be a string (not a %(type)s: %(value)r)"
+msgstr "De ingevoerde waarde moet een \"string\" zijn (niet een \"%(type)s\": %(value)r)"
+
+#: api.py:337
+msgid "The input must be a string (not None)"
+msgstr "De ingevoerde waarde moet een \"string\" zijn (niet \"None\")"
+
+#: validators.py:160
+msgid "%(object)r is not a subclass of %(subclass)s"
+msgstr "%(object)r is geen subclass van \"%(subclass)s\""
+
+#: validators.py:161
+msgid "%(object)r is not a subclass of one of the types %(subclassList)s"
+msgstr "%(object)r is geen subclass van één van de types: %(subclassList)s"
+
+#: validators.py:162
+msgid "%(object)r must be one of the types %(typeList)s"
+msgstr "%(object)r moet van één van de types %(typeList)s zijn"
+
+#: validators.py:163
+msgid "%(object)r must be of the type %(type)s"
+msgstr "%(object)r moet van het type \"%(type)s\" zijn"
+
+#: validators.py:344
+msgid "Enter a value less than %(maxLength)i characters long"
+msgstr "Voer een waarde in korter dan %(maxLength)i tekens"
+
+#: validators.py:345 validators.py:399
+msgid "Invalid value (value with length expected)"
+msgstr "Ongeldige waarde (waarde met een zekere lengte verwacht)"
+
+#: validators.py:398
+msgid "Enter a value at least %(minLength)i characters long"
+msgstr "Voer een waarde in van minimaal %(minLength)i tekens"
+
+#: validators.py:458
+msgid "You cannot enter a value here"
+msgstr "Er kan hier geen waarde worden ingevoerd"
+
+#: validators.py:509
+msgid "The input is not valid"
+msgstr "De ingevoerde waarde is incorrect"
+
+#: validators.py:565
+msgid "Enter only letters, numbers, or _ (underscore)"
+msgstr "De waarde kan alleen bestaan uit letters, cijfers of _ (\"underscore\")"
+
+#: validators.py:604
+msgid "Invalid value"
+msgstr "Ongeldige waarde"
+
+#: validators.py:605
+msgid "Value must be one of: %(items)s (not %(value)r)"
+msgstr "Waarde moet één van %(items)s zijn (niet %(value)r)"
+
+#: validators.py:668
+msgid "Choose something"
+msgstr "Kies één van de opties"
+
+#: validators.py:669
+msgid "Enter a value from: %(items)s"
+msgstr "Voer één van de volgende waarden in: %(items)s"
+
+#: validators.py:670
+msgid "That value is not known"
+msgstr "Waarde onbekend"
+
+#: validators.py:671
+msgid "Nothing in my dictionary goes by the value %(value)s. Choose one of: %(items)s"
+msgstr "%(value)s komt niet voor. Kies één uit %(items)s"
+
+#: validators.py:732
+msgid "Must be an integer index"
+msgstr "Waarde moet een \"integer index\" zijn"
+
+#: validators.py:733
+msgid "Index out of range"
+msgstr "Waarde valt buiten het bereik"
+
+#: validators.py:734
+msgid "Item %(value)s was not found in the list"
+msgstr "%(value)s is niet gevonden in de lijst"
+
+#: validators.py:809
+msgid "Date must be after %(date)s"
+msgstr "Datum moet later dan %(date)s zijn"
+
+#: validators.py:810
+msgid "Date must be before %(date)s"
+msgstr "Datum moet vroeger dan %(date)s zijn"
+
+#: validators.py:812
+msgid "%%A, %%d %%B %%Y"
+msgstr "%%A, %%d %%B %%Y"
+
+#: validators.py:813
+msgid "The date must be sometime in the future"
+msgstr "De datum moet in de toekomst liggen"
+
+#: validators.py:913
+msgid "Please enter an integer value"
+msgstr "Voer een integer waarde in"
+
+#: validators.py:945
+msgid "Please enter a number"
+msgstr "Voer een getal in"
+
+#: validators.py:998
+msgid "Enter a value less than %(max)i characters long"
+msgstr "Maximaal %(max)i tekens"
+
+#: validators.py:999
+msgid "Enter a value %(min)i characters long or more"
+msgstr "Minimaal %(min)i tekens"
+
+#: validators.py:1050
+msgid "Invalid data or incorrect encoding"
+msgstr "Ongeldige waarde of incorrecte \"encoding\""
+
+#: validators.py:1178
+msgid "Please enter an email address"
+msgstr "Voer een geldig emailadres in"
+
+#: validators.py:1179
+msgid "An email address must contain a single @"
+msgstr "Ongeldig emailadres: een emailadres kan slechts één \"@\" teken bevatten"
+
+#: validators.py:1180
+msgid "The username portion of the email address is invalid (the portion before the @: %(username)s)"
+msgstr "Ongeldig emailadres: het deel vóór de \"@\" is incorrect"
+
+#: validators.py:1181 validators.py:1294
+msgid "An error occured when trying to connect to the server: %(error)s"
+msgstr "Fout bij het benaderen van server: %(error)s"
+
+#: validators.py:1182
+msgid "The domain portion of the email address is invalid (the portion after the @: %(domain)s)"
+msgstr "Ongeldig emailadres: het \"domain\" (het deel achter de \"@\") is incorrect"
+
+#: validators.py:1183
+msgid "The domain of the email address does not exist (the portion after the @: %(domain)s)"
+msgstr "Ongeldig emailadres: het \"domain\" (het deel achter de \"@\") bestaat niet"
+
+#: validators.py:1291
+msgid "You must start your URL with http://, https://, etc"
+msgstr "Een URL moet beginnen met \"http://\", \"https://\", \"mailto:\", etc."
+
+#: validators.py:1292
+msgid "That is not a valid URL"
+msgstr "Ongeldige URL"
+
+#: validators.py:1293
+msgid "An error occurred when trying to access the URL: %(error)s"
+msgstr "Er treedt eem fout op bij het opvragen van de URL: %(error)s"
+
+#: validators.py:1295
+msgid "The server responded that the page could not be found"
+msgstr "De server meldt dat de pagina niet gevonden kan worden"
+
+#: validators.py:1296
+msgid "The server responded with a bad status code (%(status)s)"
+msgstr "De server geeft een foutmelding (%(status)s)"
+
+#: validators.py:1399
+msgid "Please enter a state code"
+msgstr "Voer een \"state code\" in"
+
+#: validators.py:1400
+msgid "Please enter a state code with TWO letters"
+msgstr "Voer een \"state code\" in met TWEE letters"
+
+#: validators.py:1401
+msgid "That is not a valid state code"
+msgstr "Geen correct \"state code\""
+
+#: validators.py:1452
+msgid "Please enter a number, with area code, in the form ###-###-####, optionally with \"ext.####\""
+msgstr "Voer een getal in, met \"area code\", in het formaat ###-###-####, optioneel met \"ext.####\""
+
+#: validators.py:1614 validators.py:1622
+msgid "Please enter the date in the form %(format)s"
+msgstr "Voer de datum in volgens het formaat: %(format)s"
+
+#: validators.py:1615
+msgid "Please enter a month from 1 to 12"
+msgstr "Voer een maand in met een getal van 1 tot en met 12"
+
+#: validators.py:1616
+msgid "Please enter a valid day"
+msgstr "Ongeldige dag"
+
+#: validators.py:1617
+msgid "That month only has %(days)i days"
+msgstr "Deze maand heeft slechts %(days)i dagen"
+
+#: validators.py:1618
+msgid "That is not a valid day (%(exception)s)"
+msgstr "Ongeldige datum"
+
+#: validators.py:1619
+msgid "Unknown month name: %(month)s"
+msgstr "Onbekende maandnaam: %(month)s"
+
+#: validators.py:1620
+msgid "Please enter a number for the year"
+msgstr "Ongeldig jaartal"
+
+#: validators.py:1621
+msgid "Please enter a four-digit year"
+msgstr "Voer een vier-cijferig jaartal in"
+
+#: validators.py:1800
+msgid "You must indicate AM or PM"
+msgstr "Het is verplicht \"AM\" danwel \"PM\" aan te geven"
+
+#: validators.py:1801
+msgid "There are too many :'s"
+msgstr "Teveel dubbele punten \":\""
+
+#: validators.py:1802
+msgid "You may not enter seconds"
+msgstr "Seconden zijn niet toegestaan in de invoer"
+
+#: validators.py:1803
+msgid "You must enter seconds"
+msgstr "Seconden zijn verplicht"
+
+#: validators.py:1804
+msgid "You must enter minutes (after a :)"
+msgstr "Minuten zijn verplicht (na een \":\")"
+
+#: validators.py:1805
+msgid "The %(part)s value you gave is not a number: %(number)r"
+msgstr "Eén van de waarden is geen getal"
+
+#: validators.py:1806
+msgid "You must enter an hour in the range %(range)s"
+msgstr "Het uur in ongeldig"
+
+#: validators.py:1807
+msgid "You must enter a minute in the range 0-59"
+msgstr "Het aantal minuten is ongeldig"
+
+#: validators.py:1808
+msgid "You must enter a second in the range 0-59"
+msgstr "Het aantal seconden is ongeldig"
+
+#: validators.py:1962
+msgid "Please enter a zip code (5 digits)"
+msgstr "Voer een geldige postcode in"
+
+#: validators.py:1986
+msgid "The name %(name)s is missing"
+msgstr "De waarde %(name)s mist"
+
+#: validators.py:2027
+msgid "Value should be %(true)r or %(false)r"
+msgstr "De waarde moet %(true)r danwel %(false)r zijn"
+
+#: validators.py:2062
+msgid "Value does not contain a signature"
+msgstr "Waarde bevat geen signatuur"
+
+#: validators.py:2063
+msgid "Signature is not correct"
+msgstr "Signatuur is incorrect"
+
+#: validators.py:2185
+msgid "Fields do not match (should be %(match)s)"
+msgstr "Waarden komen niet overeen (zou moeten zijn: %(match)s)"
+
+#: validators.py:2186
+msgid "Fields do not match"
+msgstr "Waarden komen niet overeen"
+
+#: validators.py:2248
+msgid "Please enter only the number, no other characters"
+msgstr "Voer alleen een getal in, geen andere tekens"
+
+#: validators.py:2249
+msgid "You did not enter a valid number of digits"
+msgstr "U heeft niet het juiste aantal cijfers ingevoerd"
+
+#: validators.py:2250
+msgid "That number is not valid"
+msgstr "Ongeldig nummer"
+
+#: validators.py:2365
+msgid "Please enter numbers only for month and year"
+msgstr "Voer alleen cijfers in voor maand en jaar"
+
+#: validators.py:2366
+msgid "Invalid Expiration Date"
+msgstr "Ongeldige vervaldatum"
+
+#: validators.py:2435
+msgid "Please enter numbers only for credit card security code"
+msgstr "Voer alleen de cijfers in van de \"credit card security code\""
+
+#: validators.py:2436
+msgid "Invalid credit card security code length"
+msgstr "Incorrecte \"credit card security code\"-lengte"
Modified: FormEncode/trunk/tests/test_i18n.py
===================================================================
--- FormEncode/trunk/tests/test_i18n.py 2007-04-25 21:12:13 UTC (rev 2608)
+++ FormEncode/trunk/tests/test_i18n.py 2007-04-26 08:30:06 UTC (rev 2609)
@@ -83,3 +83,6 @@
def test_fr():
_test_lang("fr", u"Veuillez entrer une valeur")
+
+def test_nl():
+ _test_lang("nl", u"Voer een waarde in")
|