Commits

Anonymous committed 9af57e1

autoimport: added ropemacs-autoimport-modules variable

Comments (0)

Files changed (1)

ropemacs/interface.py

         self.project = None
         self.old_content = None
         lisp(DEFVARS)
+        #lisp['pymacs-forget-mutability'] = True
 
         self.global_keys = [
             ('o', lisp.rope_open_project),
             else:
                 proposal = lisputils.ask_values('Which to import: ',
                                                 proposals)
-            name, module = proposal.rsplit(' :', 1)
+            name, module = proposal.rsplit(' : ', 1)
             lisp.insert(name[len(starting):])
             self._insert_import(name, module)
         else:
             return
         for file in self.project.pycore.get_python_files():
             self.autoimport.update_resource(file)
+        modules = lisp['ropemacs-autoimport-modules'].value()
+        if modules:
+            for i in range(len(modules)):
+                modname = modules[i]
+                if not isinstance(modname, basestring):
+                    modname = modname.value()
+                self.autoimport.update_module(modname)
 
     def _insert_import(self, name, module):
         current = lisp.point()
 
 (defcustom ropemacs-enable-autoimport 'nil
   "Specifies whether autoimport should be enabled.")
+(defcustom ropemacs-autoimport-modules nil
+  "The name of modules whose global names should be cached.
+
+The `rope-generate-autoimport-cache' reads this list and fills its
+cache.")
 
 (make-obsolete-variable
   'rope-confirm-saving 'ropemacs-confirm-saving)
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.