rope.contrib.autoimport.pickle ============================== .. py:module:: rope.contrib.autoimport.pickle .. autoapi-nested-parse:: IMPORTANT: This is a deprecated implementation of autoimport using pickle-based storage. This pickle-based autoimport is provided only for backwards compatibility purpose and will be removed and the sqlite backend will be the new default implementation in the future. If you are still using this module, you should migrate to the new and improved sqlite-based storage backend (rope.contrib.autoimport.sqlite.AutoImport). Classes ------- .. autoapisummary:: rope.contrib.autoimport.pickle.AutoImport Functions --------- .. autoapisummary:: rope.contrib.autoimport.pickle.submodules Module Contents --------------- .. py:class:: AutoImport(project, observe=True, underlined=False) A class for finding the module that provides a name This class maintains a cache of global names in python modules. Note that this cache is not accurate and might be out of date. .. py:attribute:: project .. py:attribute:: underlined :value: False .. py:attribute:: names .. py:method:: import_assist(starting) Return a list of ``(name, module)`` tuples This function tries to find modules that have a global name that starts with `starting`. .. py:method:: get_modules(name) Return the list of modules that have global `name` .. py:method:: get_all_names() Return the list of all cached global names .. py:method:: get_name_locations(name) Return a list of ``(resource, lineno)`` tuples .. py:method:: generate_cache(resources=None, underlined=None, task_handle=taskhandle.DEFAULT_TASK_HANDLE) Generate global name cache for project files If `resources` is a list of `rope.base.resource.File`, only those files are searched; otherwise all python modules in the project are cached. .. py:method:: generate_modules_cache(modules, underlined=None, task_handle=taskhandle.DEFAULT_TASK_HANDLE) Generate global name cache for modules listed in `modules` .. py:method:: clear_cache() Clear all entries in global-name cache It might be a good idea to use this function before regenerating global names. .. py:method:: find_insertion_line(code) Guess at what line the new import should be inserted .. py:method:: update_resource(resource, underlined=None) Update the cache for global names in `resource` .. py:method:: update_module(modname, underlined=None) Update the cache for global names in `modname` module `modname` is the name of a module. .. py:function:: submodules(mod)