Ali Gholami Rudi  committed 08c437a

evaluate: renamed get_primary_and_pyname_at() to eval_location2

  • Participants
  • Parent commits ba7f543
  • Branches trunk

Comments (0)

Files changed (4)

File rope/base/

 BadIdentifierError = exceptions.BadIdentifierError
-def get_primary_and_pyname_at(pymodule, offset):
+def eval_location(pymodule, offset):
+    """Find the pyname at the offset"""
+    return eval_location2(pymodule, offset)[1]
+def eval_location2(pymodule, offset):
     """Find the primary and pyname at offset"""
     pyname_finder = ScopeNameFinder(pymodule)
     return pyname_finder.get_primary_and_pyname_at(offset)
-def eval_location(pymodule, offset):
-    """Find the pyname at the offset"""
-    return get_primary_and_pyname_at(pymodule, offset)[1]
 def get_statement_result(scope, node):
     """Evaluate a `ast.AST` node and return a PyName

File rope/contrib/

     name = worder.get_name_at(resource, offset)
     this_pymodule = project.pycore.resource_to_pyobject(resource)
-    primary, pyname = rope.base.evaluate.get_primary_and_pyname_at(
+    primary, pyname = rope.base.evaluate.eval_location2(
         this_pymodule, offset)
     def is_match(occurrence):
         return unsure

File rope/refactor/

     def _set_name_and_pyname(self): = worder.get_name_at(self.resource, self.offset)
         this_pymodule = self.pycore.resource_to_pyobject(self.resource)
-        self.primary, self.pyname = evaluate.get_primary_and_pyname_at(
+        self.primary, self.pyname = evaluate.eval_location2(
             this_pymodule, self.offset)
         if self.pyname is None:

File rope/refactor/

             self.old_name = worder.get_name_at(self.resource, offset)
             this_pymodule = self.pycore.resource_to_pyobject(self.resource)
             self.old_instance, self.old_pyname = \
-                evaluate.get_primary_and_pyname_at(this_pymodule, offset)
+                evaluate.eval_location2(this_pymodule, offset)
             if self.old_pyname is None:
                 raise exceptions.RefactoringError(
                     'Rename refactoring should be performed'