[Checkins] SVN: zope.fixers/trunk/ Applied Martin v L?\195?\182wis patch to make it run on Python 3.1.
Lennart Regebro
regebro at gmail.com
Sat Sep 12 06:35:55 EDT 2009
Log message for revision 103858:
Applied Martin v L?\195?\182wis patch to make it run on Python 3.1.
Changed:
U zope.fixers/trunk/README.txt
U zope.fixers/trunk/zope/fixers/base.py
-=-
Modified: zope.fixers/trunk/README.txt
===================================================================
--- zope.fixers/trunk/README.txt 2009-09-12 10:10:41 UTC (rev 103857)
+++ zope.fixers/trunk/README.txt 2009-09-12 10:35:54 UTC (rev 103858)
@@ -8,7 +8,9 @@
@implementer(IFoo), which is the most likely Python 3 syntax for
zope.interfaces implements statements.
+zope.fixers requires Python 3.1.
+
Usage
-----
Modified: zope.fixers/trunk/zope/fixers/base.py
===================================================================
--- zope.fixers/trunk/zope/fixers/base.py 2009-09-12 10:10:41 UTC (rev 103857)
+++ zope.fixers/trunk/zope/fixers/base.py 2009-09-12 10:35:54 UTC (rev 103858)
@@ -90,7 +90,7 @@
if 'name' in results:
# This matched an import statement. Fix that up:
name = results["name"]
- name.replace(Name(self.DECORATOR_NAME, prefix=name.get_prefix()))
+ name.replace(Name(self.DECORATOR_NAME, prefix=name.prefix))
if 'rename' in results:
# The import statement use import as
self._add_pattern("'%s'" % results['rename'].value)
@@ -128,8 +128,8 @@
# Take the current class constructor prefix, and stick it into
# the decorator, to set the decorators indentation.
- nodeprefix = node.get_prefix()
- decorator.set_prefix(nodeprefix)
+ nodeprefix = node.prefix
+ decorator.prefix = nodeprefix
# Preserve only the indent:
if '\n' in nodeprefix:
nodeprefix = nodeprefix[nodeprefix.rfind('\n')+1:]
@@ -137,7 +137,7 @@
# Then find the last line of the previous node and use that as
# indentation, and add that to the class constructors prefix.
- previous = node.get_prev_sibling()
+ previous = node.prev_sibling
if previous is None:
prefix = ''
else:
@@ -148,14 +148,14 @@
if not prefix or prefix[0] != '\n':
prefix = '\n' + prefix
- node.set_prefix(prefix)
+ node.prefix = prefix
new_node = Node(syms.decorated, [decorator, node.clone()])
# Look for the actual function calls in the new node and remove it.
for node in new_node.post_order():
for pattern in self.function_patterns:
if pattern.match(node, results):
parent = node.parent
- previous = node.get_prev_sibling()
+ previous = node.prev_sibling
# Remove the node
node.remove()
if not str(parent).strip():
@@ -175,4 +175,4 @@
previous.remove()
return new_node
-
\ No newline at end of file
+
More information about the checkins
mailing list