[Checkins] SVN: zope.fixers/trunk/ Fixed naming.
Lennart Regebro
regebro at gmail.com
Mon Apr 6 19:59:13 EDT 2009
Log message for revision 98956:
Fixed naming.
Changed:
U zope.fixers/trunk/CHANGES.txt
U zope.fixers/trunk/README.txt
U zope.fixers/trunk/zope/fixers/fix_implements.py
U zope.fixers/trunk/zope/fixers/tests.py
-=-
Modified: zope.fixers/trunk/CHANGES.txt
===================================================================
--- zope.fixers/trunk/CHANGES.txt 2009-04-06 23:47:07 UTC (rev 98955)
+++ zope.fixers/trunk/CHANGES.txt 2009-04-06 23:59:13 UTC (rev 98956)
@@ -6,4 +6,4 @@
==================
Initial release. Includes the implements fix to change implements(IFoo)
-class body call to @implementor(IFoo) class decorator.
\ No newline at end of file
+class body call to @implementer(IFoo) class decorator.
\ No newline at end of file
Modified: zope.fixers/trunk/README.txt
===================================================================
--- zope.fixers/trunk/README.txt 2009-04-06 23:47:07 UTC (rev 98955)
+++ zope.fixers/trunk/README.txt 2009-04-06 23:59:13 UTC (rev 98956)
@@ -5,7 +5,7 @@
Currently, there is only one fixer, fix_implements. This fixer will change
all uses of implements(IFoo) in a class body to the class decorator
- at implementor(IFoo), which is the most likely Python 3 syntax for
+ at implementer(IFoo), which is the most likely Python 3 syntax for
zope.interfaces implements statements.
Modified: zope.fixers/trunk/zope/fixers/fix_implements.py
===================================================================
--- zope.fixers/trunk/zope/fixers/fix_implements.py 2009-04-06 23:47:07 UTC (rev 98955)
+++ zope.fixers/trunk/zope/fixers/fix_implements.py 2009-04-06 23:59:13 UTC (rev 98956)
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Fixer for implements(IX) -> @implementor(IX).
+"""Fixer for implements(IX) -> @implementer(IX).
$Id$
"""
@@ -94,7 +94,7 @@
if 'name' in results:
# This matched an import statement. Fix that up:
name = results["name"]
- name.replace(Name("implementor", prefix=name.get_prefix()))
+ name.replace(Name("implementer", prefix=name.get_prefix()))
if 'rename' in results:
# The import statement use import as
self._add_pattern("'%s'" % results['rename'].value)
@@ -112,13 +112,13 @@
statement = [x.clone() for x in statement]
# Get rid of leading whitespace:
statement[0].prefix = ''
- # Rename implements to implementor:
+ # Rename implements to implementer:
if statement[-1].children:
implements = statement[-1].children[-1]
else:
implements = statement[-1]
if implements.value == 'implements':
- implements.value = 'implementor'
+ implements.value = 'implementer'
interface = results['interface']
if not isinstance(interface, list):
Modified: zope.fixers/trunk/zope/fixers/tests.py
===================================================================
--- zope.fixers/trunk/zope/fixers/tests.py 2009-04-06 23:47:07 UTC (rev 98955)
+++ zope.fixers/trunk/zope/fixers/tests.py 2009-04-06 23:59:13 UTC (rev 98956)
@@ -12,12 +12,12 @@
"""
imports_target = """
-from zope.interface import Interface, implementor, providedBy
-from zope.interface import providedBy, implementor, Interface
-from zope.interface import providedBy, implementor
-from zope.interface import implementor, Interface
-from zope.interface import implementor
-from zope.interface import implementor as renamed
+from zope.interface import Interface, implementer, providedBy
+from zope.interface import providedBy, implementer, Interface
+from zope.interface import providedBy, implementer
+from zope.interface import implementer, Interface
+from zope.interface import implementer
+from zope.interface import implementer as renamed
"""
# Test a simple case.
@@ -34,12 +34,12 @@
"""
simple_target = """
-from zope.interface import implementor
+from zope.interface import implementer
class IFoo(Interface):
pass
- at implementor(IFoo)
+ at implementer(IFoo)
class Foo:
"An IFoo class"
"""
@@ -61,7 +61,7 @@
"""
multi_target = """
-from zope.interface import implementor
+from zope.interface import implementer
class IFoo(Interface):
pass
@@ -69,7 +69,7 @@
class IBar(Interface):
pass
- at implementor(IFoo, IBar)
+ at implementer(IFoo, IBar)
class Foo:
"An IFoo class"
"""
@@ -88,7 +88,7 @@
"""
renamed_target = """
-from zope.interface import implementor as renamed
+from zope.interface import implementer as renamed
class IBar(Interface):
pass
@@ -117,7 +117,7 @@
class IFoo(Interface):
pass
- at interface.implementor(IFoo)
+ at interface.implementer(IFoo)
class Foo:
"An IFoo class"
"""
@@ -141,7 +141,7 @@
class IFoo(Interface):
pass
- at zopeinterface.implementor(IFoo)
+ at zopeinterface.implementer(IFoo)
class Foo:
"An IFoo class"
"""
@@ -165,7 +165,7 @@
class IFoo(Interface):
pass
- at zope.interface.implementor(IFoo)
+ at zope.interface.implementer(IFoo)
class Foo:
"An IFoo class"
"""
@@ -188,7 +188,7 @@
class IFoo(Interface):
pass
- at zope.interface.implementor(IFoo)
+ at zope.interface.implementer(IFoo)
class Foo:
pass
@@ -217,11 +217,11 @@
pass
def forceindent():
- @zope.interface.implementor(IFoo)
+ @zope.interface.implementer(IFoo)
class Foo:
pass
- @zope.interface.implementor(IFoo)
+ @zope.interface.implementer(IFoo)
class Bar:
pass
More information about the Checkins
mailing list