Anonymous avatar Anonymous committed 98eae55

pyobjects: _PyModule.invalidate() no longer used

Comments (0)

Files changed (4)

rope/base/pycore.py

 
     def _invalidate_resource(self, resource):
         if resource in self.module_map:
-            self.module_map[resource].invalidate()
             self.forget_all_data()
             self.observer.remove_resource(resource)
             del self.module_map[resource]

rope/base/pyobjects.py

     def __init__(self, pycore, ast_node, resource):
         self.resource = resource
         self.concluded_data = []
-        self._is_valid = True
         AbstractModule.__init__(self)
         PyDefinedObject.__init__(self, pycore, ast_node, None)
 
     def get_resource(self):
         return self.resource
 
-    def is_valid(self):
-        return self._is_valid
-
-    def invalidate(self):
-        self._is_valid = False
-
 
 class PyModule(_PyModule):
     """Only a placeholder"""

ropetest/advanced_oi_test.py

         var_pyname = pymod1['var']
         self.assertEquals(c_class, var_pyname.get_object().get_type())
         mod2.write('import mod1\n\nmod1.l.append("")\n')
-        # Either `pymod1` should be invalid or should not reference to `pymod2`
-        if pymod1.is_valid():
-            self.assertNotEquals(c_class, var_pyname.get_object().get_type(),
-                                 'Class `C` no more exists')
+        self.assertNotEquals(c_class, var_pyname.get_object().get_type(),
+                             'Class `C` no more exists')
 
     def test_always_returning_containing_class_for_selfs(self):
         code = 'class A(object):\n    def f(p):\n        return p\n' \

ropetest/pycoretest.py

         mod1.write('class A(object):\n    def func2(self):\n        pass\n')
         self.assertTrue('func2' in b_class)
 
-    def test_simple_module(self):
-        mod = testutils.create_module(self.project, 'mod')
-        pymod = self.pycore.resource_to_pyobject(mod)
-        self.assertTrue(pymod.is_valid())
-        mod.write('a = 1\n')
-        self.assertFalse(pymod.is_valid())
-
 
 class ClassHierarchyTest(unittest.TestCase):
 
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.