[Checkins] SVN: zope.schema/branches/jinty-native_string/src/zope/schema/_ Expose NativeString

Brian Sutherland cvs-admin at zope.org
Mon Apr 9 10:25:23 UTC 2012


Log message for revision 125116:
  Expose NativeString

Changed:
  U   zope.schema/branches/jinty-native_string/src/zope/schema/__init__.py
  U   zope.schema/branches/jinty-native_string/src/zope/schema/_field.py

-=-
Modified: zope.schema/branches/jinty-native_string/src/zope/schema/__init__.py
===================================================================
--- zope.schema/branches/jinty-native_string/src/zope/schema/__init__.py	2012-04-09 10:18:05 UTC (rev 125115)
+++ zope.schema/branches/jinty-native_string/src/zope/schema/__init__.py	2012-04-09 10:25:20 UTC (rev 125116)
@@ -17,6 +17,7 @@
 from zope.schema._field import MinMaxLen, Choice
 from zope.schema._field import Bytes, ASCII, BytesLine, ASCIILine
 from zope.schema._field import Text, TextLine, Bool, Int, Float, Decimal
+from zope.schema._field import NativeString, NativeStringLine
 from zope.schema._field import Tuple, List, Set, FrozenSet
 from zope.schema._field import Password, Dict, Datetime, Date, Timedelta
 from zope.schema._field import Time, SourceText

Modified: zope.schema/branches/jinty-native_string/src/zope/schema/_field.py
===================================================================
--- zope.schema/branches/jinty-native_string/src/zope/schema/_field.py	2012-04-09 10:18:05 UTC (rev 125115)
+++ zope.schema/branches/jinty-native_string/src/zope/schema/_field.py	2012-04-09 10:25:20 UTC (rev 125116)
@@ -107,12 +107,12 @@
 
 # for things which are of the str type on both Python 2 and 3
 if PY3:
-    _Str = Text
+    NativeString = Text
 else:
-    _Str = Bytes
+    NativeString = Bytes
 
 @implementer(IASCII)
-class ASCII(_Str):
+class ASCII(NativeString):
     __doc__ = IASCII.__doc__
 
     def _validate(self, value):
@@ -152,9 +152,9 @@
 
 # for things which are of the str type on both Python 2 and 3
 if PY3:
-    _StrLine = TextLine
+    NativeStringLine = TextLine
 else:
-    _StrLine = BytesLine
+    NativeStringLine = BytesLine
 
 @implementer(IASCIILine)
 class ASCIILine(ASCII):
@@ -654,7 +654,7 @@
 
 
 @implementer(IId, IFromUnicode)
-class Id(_StrLine):
+class Id(NativeStringLine):
     """Id field
 
     Values of id fields must be either uris or dotted names.
@@ -705,7 +705,7 @@
 
 
 @implementer(IDottedName)
-class DottedName(_StrLine):
+class DottedName(NativeStringLine):
     """Dotted name field.
 
     Values of DottedName fields must be Python-style dotted names.



More information about the checkins mailing list