Commits

Anonymous committed ae5e96e

utils: renamed cacheit decorator to saveit

Comments (0)

Files changed (10)

rope/base/builtins.py

         return self.name.split('.')[-1]
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def attributes(self):
         result = _object_attributes(self.module, self)
         result.update(self.initial)
         return result
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def module(self):
         try:
             result = __import__(self.name)
         pyobjects.AbstractClass.__init__(self)
         self.initial = attributes
 
-    @utils.cacheit
+    @utils.saveit
     def get_attributes(self):
         result = _object_attributes(self.builtin, self)
         result.update(self.initial)

rope/base/change.py

         return []
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def _operations(self):
         return _ResourceOperations(self.resource.project)
 

rope/base/project.py

         pass
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def history(self):
         return history.History(self)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def pycore(self):
         return pycore.PyCore(self)
 
         self.needs_gc = True
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def observer(self):
         rawobserver = ResourceObserver(
             self._changed, self._moved, self._created,

rope/base/pyobjectsdef.py

         return rope.base.pyscopes.GlobalScope(self.pycore, self)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def lines(self):
         """A `SourceLinesAdapter`"""
         return rope.base.codeanalyze.SourceLinesAdapter(self.source_code)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def logical_lines(self):
         """A `LogicalLinesFinder`"""
         return rope.base.codeanalyze.CachingLogicalLineFinder(self.lines)

rope/base/pyscopes.py

         """The same as ``key in self.get_names()``"""
         return key in self.get_names()
 
-    @utils.cacheit
+    @utils.saveit
     def get_scopes(self):
         """Return the subscopes of this scope
 
         pymodule = self._get_global_scope().pyobject
         return pymodule.logical_lines.logical_line_in(self.logical_end)[1]
 
-    @utils.cacheit
+    @utils.saveit
     def get_logical_end(self):
         global_scope = self._get_global_scope()
         return global_scope._scope_finder.find_scope_end(self)
         return self._scope_finder.get_holding_scope_for_offset(self, offset)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def _scope_finder(self):
         return _HoldingScopeFinder(self.pyobject)
 

rope/base/utils.py

 import warnings
 
 
-def cacheit(func):
+def saveit(func):
     """A decorator that caches the return value of a function"""
 
     name = '_' + func.__name__

rope/refactor/change_signature.py

         return change_collector.get_changed()
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def pymodule(self):
         return self.pycore.resource_to_pyobject(self.resource)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def source(self):
         if self.resource is not None:
             return self.resource.read()
             return self.pymodule.source_code
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def lines(self):
         return self.pymodule.lines
 

rope/refactor/encapsulate_field.py

         return self.worder.is_assigned_in_a_tuple_assignment(offset)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def source(self):
         if self.resource is not None:
             return self.resource.read()
             return self.pymodule.source_code
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def lines(self):
         if self.pymodule is None:
             self.pymodule = self.pycore.resource_to_pyobject(self.resource)
         return self.pymodule.lines
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def worder(self):
         return worder.Worder(self.source)

rope/refactor/importutils/module_imports.py

         self.filter = import_filter
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def imports(self):
         finder = _GlobalImportFinder(self.pymodule, self.pycore)
         result = finder.find_import_statements()

rope/refactor/occurrences.py

         self.offset = offset
         self.resource = tools.resource
 
-    @utils.cacheit
+    @utils.saveit
     def get_word_range(self):
         return self.tools.word_finder.get_word_range(self.offset)
 
-    @utils.cacheit
+    @utils.saveit
     def get_primary_range(self):
         return self.tools.word_finder.get_primary_range(self.offset)
 
-    @utils.cacheit
+    @utils.saveit
     def get_pyname(self):
         try:
             return self.tools.name_finder.get_pyname_at(self.offset)
         except exceptions.BadIdentifierError:
             pass
 
-    @utils.cacheit
+    @utils.saveit
     def get_primary_and_pyname(self):
         try:
             return self.tools.name_finder.get_primary_and_pyname_at(self.offset)
         except exceptions.BadIdentifierError:
             pass
 
-    @utils.cacheit
+    @utils.saveit
     def is_in_import_statement(self):
         return (self.tools.word_finder.is_from_statement(self.offset) or
                 self.tools.word_finder.is_import_statement(self.offset))
         return unsure_pyname(self.get_pyname())
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def lineno(self):
         offset = self.get_word_range()[0]
         return self.tools.pymodule.lines.get_line_number(offset)
         self.docs = docs
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def name_finder(self):
         return evaluate.ScopeNameFinder(self.pymodule)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def source_code(self):
         if self.__resource is not None:
             return self.resource.read()
             return self.pymodule.source_code
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def word_finder(self):
         return worder.Worder(self.source_code, self.docs)
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def resource(self):
         if self.__resource is not None:
             return self.__resource
             return self.__pymodule.resource
 
     @property
-    @utils.cacheit
+    @utils.saveit
     def pymodule(self):
         if self.__pymodule is not None:
             return self.__pymodule
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.