1. zjes
  2. rope_py3k

Commits

Ali Gholami Rudi  committed 30b81ff

pycore: added soa_followed_calls project config

  • Participants
  • Parent commits 359ddf7
  • Branches trunk

Comments (0)

Files changed (2)

File rope/base/default_config.py

View file
 
     # If `True`, rope analyzes each module when it is being saved.
     prefs['automatic_soa'] = True
+    # The depth of calls to follow in static object analysis
+    prefs['soa_followed_calls'] = 0
 
     # If `False` when running modules or unit tests "dynamic object
     # inference" is turned off.  This makes them much faster.

File rope/base/pycore.py

View file
         return runner
 
     def analyze_module(self, resource, should_analyze=lambda py: True,
-                       search_subscopes=lambda py: True, followed_calls=0):
+                       search_subscopes=lambda py: True, followed_calls=None):
         """Analyze `resource` module for static object inference
 
         This function forces rope to analyze this module to collect
         That is it is assumed that `should_analyze` returns `False for
         all of its subscopes.
 
+        `followed_calls` override the value of ``soa_followed_calls``
+        project config.
         """
+        if followed_calls is None:
+            followed_calls = self.project.prefs.get('soa_followed_calls', 0)
         pymodule = self.resource_to_pyobject(resource)
         self.module_cache.forget_all_data()
         rope.base.oi.soa.analyze_module(