Anonymous avatar Anonymous committed 465aec3

occurrences: MultipleFinders is used only in change_signature

Comments (0)

Files changed (2)

rope/refactor/change_signature.py

             name, pyname = self.others
             constructor_finder = occurrences.create_finder(
                 self.pycore, name, pyname, only_calls=True)
-            finder = occurrences.MultipleFinders([finder, constructor_finder])
+            finder = _MultipleFinders([finder, constructor_finder])
         for file in resources:
             job_set.started_job('Working on <%s>' % file.path)
             change_calls = _ChangeCallsInModule(
         if self._lines is None:
             self._lines = self.pymodule.lines
         return self._lines
+
+class _MultipleFinders(object):
+
+    def __init__(self, finders):
+        self.finders = finders
+
+    def find_occurrences(self, resource=None, pymodule=None):
+        all_occurrences = []
+        for finder in self.finders:
+            all_occurrences.extend(finder.find_occurrences(resource, pymodule))
+        all_occurrences.sort(self._cmp_occurrences)
+        return all_occurrences
+
+    def _cmp_occurrences(self, o1, o2):
+        return cmp(o1.get_primary_range(), o2.get_primary_range())

rope/refactor/occurrences.py

         return unsure_pyname(self.get_pyname())
 
 
-class MultipleFinders(object):
-
-    def __init__(self, finders):
-        self.finders = finders
-
-    def find_occurrences(self, resource=None, pymodule=None):
-        all_occurrences = []
-        for finder in self.finders:
-            all_occurrences.extend(finder.find_occurrences(resource, pymodule))
-        all_occurrences.sort(self._cmp_occurrences)
-        return all_occurrences
-
-    def _cmp_occurrences(self, o1, o2):
-        return cmp(o1.get_primary_range(), o2.get_primary_range())
-
-
 def same_pyname(expected, pyname):
     """Check whether `expected` and `pyname` are the same"""
     if expected is None or pyname is None:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.