Commits

Ali Gholami Rudi  committed e245200

evaluate: renamed get_string_result()

evaluate.get_pyname_in_scope() can be used, instead.

  • Participants
  • Parent commits 0513789

Comments (0)

Files changed (3)

File rope/base/evaluate.py

     return get_primary_and_result(holding_scope, node)
 
 
-def get_string_result(scope, string):
-    """use `get_pyname_in_scope` instead"""
-    evaluator = StatementEvaluator(scope)
-    node = ast.parse(string)
-    ast.walk(node, evaluator)
-    return evaluator.result
-
-
 class ScopeNameFinder(object):
 
     def __init__(self, pymodule):

File rope/refactor/importutils/__init__.py

 
     def _rename_in_module(self, pymodule, name, new_name, till_dot=False):
         old_name = name.split('.')[-1]
-        old_pyname = rope.base.evaluate.get_string_result(
+        old_pyname = rope.base.evaluate.get_pyname_in_scope(
             pymodule.get_scope(), name)
         occurrence_finder = occurrences.create_finder(
             self.pycore, old_name, old_pyname, imports=False)

File rope/refactor/wildcards.py

            isinstance(expression.ctx, ast.Store):
             start, end = patchedast.node_region(expression)
             text = pymodule.source_code[start:end]
-            return evaluate.get_string_result(scope, text)
+            return evaluate.get_pyname_in_scope(scope, text)
         else:
             return evaluate.get_statement_result(scope, expression)