~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/lib2to3/fixer_base.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    explicit = False # Is this ignored by refactor.py -f all?
34
34
    run_order = 5   # Fixers will be sorted by run order before execution
35
35
                    # Lower numbers will be run first.
 
36
    _accept_type = None # [Advanced and not public] This tells RefactoringTool
 
37
                        # which node type to accept when there's not a pattern.
36
38
 
37
39
    # Shortcut for access to Python grammar symbols
38
40
    syms = pygram.python_symbols
94
96
        """
95
97
        raise NotImplementedError()
96
98
 
97
 
    def new_name(self, template="xxx_todo_changeme"):
 
99
    def new_name(self, template=u"xxx_todo_changeme"):
98
100
        """Return a string suitable for use as an identifier
99
101
 
100
102
        The new name is guaranteed not to conflict with other identifiers.
101
103
        """
102
104
        name = template
103
105
        while name in self.used_names:
104
 
            name = template + str(self.numbers.next())
 
106
            name = template + unicode(self.numbers.next())
105
107
        self.used_names.add(name)
106
108
        return name
107
109
 
120
122
        """
121
123
        lineno = node.get_lineno()
122
124
        for_output = node.clone()
123
 
        for_output.set_prefix("")
 
125
        for_output.prefix = u""
124
126
        msg = "Line %d: could not convert: %s"
125
127
        self.log_message(msg % (lineno, for_output))
126
128
        if reason: