[Checkins] SVN: zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/fields.py PEP8, avoid re-binding Bool.

Tres Seaver cvs-admin at zope.org
Wed May 9 20:24:03 UTC 2012


Log message for revision 125786:
  PEP8, avoid re-binding Bool.

Changed:
  U   zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/fields.py

-=-
Modified: zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/fields.py
===================================================================
--- zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/fields.py	2012-05-09 20:23:54 UTC (rev 125785)
+++ zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/fields.py	2012-05-09 20:23:59 UTC (rev 125786)
@@ -18,7 +18,7 @@
 import warnings
 
 from zope.interface import implementer
-from zope.schema import Bool
+from zope.schema import Bool as schema_Bool
 from zope.schema import Field
 from zope.schema import InterfaceField
 from zope.schema import List
@@ -34,6 +34,7 @@
 PYIDENTIFIER_REGEX = u('\\A[a-zA-Z_]+[a-zA-Z0-9_]*\\Z')
 pyidentifierPattern = re.compile(PYIDENTIFIER_REGEX)
 
+
 @implementer(IFromUnicode)
 class PythonIdentifier(TextLine):
     """This field describes a python identifier, i.e. a variable name.
@@ -46,6 +47,7 @@
         if pyidentifierPattern.match(value) is None:
             raise ValidationError(value)
 
+
 @implementer(IFromUnicode)
 class GlobalObject(Field):
     """An object that can be accessed as a module global.
@@ -74,12 +76,15 @@
         self.validate(value)
         return value
 
+
+ at implementer(IFromUnicode)
 class GlobalInterface(GlobalObject):
     """An interface that can be accessed from a module.
     """
     def __init__(self, **kw):
         super(GlobalInterface, self).__init__(InterfaceField(), **kw)
 
+
 @implementer(IFromUnicode)
 class Tokens(List):
     """A list that can be read from a space-separated string.
@@ -103,6 +108,7 @@
 
         return values
 
+
 @implementer(IFromUnicode)
 class Path(Text):
     """A file path name, which may be input as a relative path
@@ -118,7 +124,7 @@
 
 
 @implementer(IFromUnicode)
-class Bool(Bool):
+class Bool(schema_Bool):
     """A boolean value
 
     Values may be input (in upper or lower case) as any of:
@@ -132,6 +138,7 @@
             return False
         raise ValidationError
 
+
 @implementer(IFromUnicode)
 class MessageID(Text):
     """Text string that should be translated.
@@ -145,7 +152,7 @@
     def fromUnicode(self, u):
         context = self.context
         domain = getattr(context, 'i18n_domain', '')
-        if not domain:
+        if not doain:
             domain = 'untranslated'
             warnings.warn(
                 "You did not specify an i18n translation domain for the "\



More information about the checkins mailing list