示例#1
0
 def refactor(self):
     '''Perform refactorings.'''
     proj = self.proj
     m = proj.get_resource(self.path('leoAtFile.py'))
     s = m.read()
     # Important: get an offset in actual code.
     s = rope.base.simplify.real_code(s)
     tag1 = 'atFile'
     tag2 = g.pep8_class_name(tag1)
     offset = s.find(tag1)
     if offset > -1:
         changes = rope.refactor.rename.Rename(proj, m, offset).get_changes(tag2)
         g.trace(changes.get_description())
     else:
         g.trace('not found', tag1)
示例#2
0
 def refactor(self):
     '''Perform refactorings.'''
     proj = self.proj
     m = proj.get_resource(self.path('leoAtFile.py'))
     s = m.read()
     # Important: get an offset in actual code.
     s = rope.base.simplify.real_code(s)
     tag1 = 'atFile'
     tag2 = g.pep8_class_name(tag1)
     offset = s.find(tag1)
     if offset > -1:
         changes = rope.refactor.rename.Rename(proj,m,offset).get_changes(tag2)
         g.trace(changes.get_description())
     else:
         g.trace('not found',tag1)