Commits

Anonymous committed 2970be2

fixmodnames: passing the fixer function to get_changes()

Comments (0)

Files changed (1)

rope/contrib/fixmodnames.py

     def __init__(self, project):
         self.project = project
 
-    def get_changes(self):
+    def get_changes(self, fix=str.lower):
         stack = changestack.ChangeStack(self.project, 'Fixing module names')
         try:
             while True:
                     modname = resource.name.rsplit('.', 1)[0]
                     if modname == '__init__':
                         modname = resource.parent.name
-                    if not modname.islower():
+                    if modname != fix(modname):
                         renamer = rename.Rename(self.project, resource)
                         changes = renamer.get_changes(modname.lower())
                         stack.push(changes)