[Python-checkins] r57919 - in sandbox/trunk/2to3: README examples fixes/fix_ws_comma.py

collin.winter python-checkins at python.org
Mon Sep 3 08:08:27 CEST 2007


Author: collin.winter
Date: Mon Sep  3 08:08:09 2007
New Revision: 57919

Added:
   sandbox/trunk/2to3/fixes/fix_ws_comma.py
      - copied, changed from r57893, sandbox/trunk/2to3/examples/fix_ws_comma.py
Removed:
   sandbox/trunk/2to3/examples/
Modified:
   sandbox/trunk/2to3/README
Log:
Now that we have the ability to exempt certain fixers from '-f all', move fix_ws_comma back into fixes/; remove examples/.

Modified: sandbox/trunk/2to3/README
==============================================================================
--- sandbox/trunk/2to3/README	(original)
+++ sandbox/trunk/2to3/README	Mon Sep  3 08:08:09 2007
@@ -36,7 +36,6 @@
 pgen2/         - Parser generator and driver ([1]_, [2]_)
 fixes/         - Individual transformations
 tests/         - Test files for pytree, fixers, grammar, etc
-examples/      - Fixers that while neat, we don't want run by refactor's -f all
 
 
 Capabilities

Copied: sandbox/trunk/2to3/fixes/fix_ws_comma.py (from r57893, sandbox/trunk/2to3/examples/fix_ws_comma.py)
==============================================================================
--- sandbox/trunk/2to3/examples/fix_ws_comma.py	(original)
+++ sandbox/trunk/2to3/fixes/fix_ws_comma.py	Mon Sep  3 08:08:09 2007
@@ -11,6 +11,8 @@
 
 class FixWsComma(basefix.BaseFix):
 
+  explicit = True # The user must ask for this fixers
+
   PATTERN = """
   any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
   """
@@ -19,7 +21,7 @@
   COLON = pytree.Leaf(token.COLON, ":")
   SEPS = (COMMA, COLON)
 
-  def transform(self, node):
+  def transform(self, node, results):
     new = node.clone()
     comma = False
     for child in new.children:


More information about the Python-checkins mailing list