Anonymous avatar Anonymous committed 3e301f6

evaluate: renamed get_pyname_in_scope() to eval_str

Comments (0)

Files changed (4)


     return evaluator.old_result, evaluator.result
-def get_pyname_in_scope(holding_scope, name):
+def eval_str(holding_scope, name):
     return get_primary_and_pyname_in_scope(holding_scope, name)[1]


     def _dotted_completions(self, module_scope, holding_scope):
         result = {}
-        pyname_finder = rope.base.evaluate.ScopeNameFinder(module_scope.pyobject)
-        found_pyname = rope.base.evaluate.get_pyname_in_scope(
-            holding_scope, self.expression)
+        found_pyname = rope.base.evaluate.eval_str(holding_scope,
+                                                   self.expression)
         if found_pyname is not None:
             element = found_pyname.get_object()
             for name, pyname in element.get_attributes().items():
             primary = word_finder.get_primary_at(function_parens - 1)
                 function_pyname = rope.base.evaluate.\
-                    get_pyname_in_scope(scope, primary)
+                    eval_str(scope, primary)
             except exceptions.BadIdentifierError, e:
                 return {}
             if function_pyname is not None:
         expression = expression.replace('\\\n', ' ').replace('\n', ' ')
         lineno = source_code.count('\n', 0, offset)
         scope = pymodule.get_scope().get_inner_scope_for_line(lineno)
-        return rope.base.evaluate.get_pyname_in_scope(scope, expression)
+        return rope.base.evaluate.eval_str(scope, expression)
     def new_pyname():
         return rope.base.evaluate.eval_location(pymodule, offset)
     new_code = pymodule.source_code


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


            isinstance(expression.ctx, ast.Store):
             start, end = patchedast.node_region(expression)
             text = pymodule.source_code[start:end]
-            return evaluate.get_pyname_in_scope(scope, text)
+            return evaluate.eval_str(scope, text)
             return evaluate.eval_node(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
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.