Anonymous avatar Anonymous committed e245200

evaluate: renamed get_string_result()

evaluate.get_pyname_in_scope() can be used, instead.

Comments (0)

Files changed (3)

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):

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)

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)
 
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.