rope.contrib.autoimport.pickle
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
A class for finding the module that provides a name |
Functions
|
Module Contents
- class rope.contrib.autoimport.pickle.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.
- project
- underlined = False
- names
- import_assist(starting)
Return a list of
(name, module)tuplesThis function tries to find modules that have a global name that starts with starting.
- get_modules(name)
Return the list of modules that have global name
- get_all_names()
Return the list of all cached global names
- get_name_locations(name)
Return a list of
(resource, lineno)tuples
- 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.
- generate_modules_cache(modules, underlined=None, task_handle=taskhandle.DEFAULT_TASK_HANDLE)
Generate global name cache for modules listed in modules
- clear_cache()
Clear all entries in global-name cache
It might be a good idea to use this function before regenerating global names.
- find_insertion_line(code)
Guess at what line the new import should be inserted
- update_resource(resource, underlined=None)
Update the cache for global names in resource
- update_module(modname, underlined=None)
Update the cache for global names in modname module
modname is the name of a module.
- rope.contrib.autoimport.pickle.submodules(mod)