Anonymous avatar Anonymous committed fb8c4e9

Showing the old value of dialogs confs

Comments (0)

Files changed (5)

 Uses almost the same keybinding as ropeide.
 ==============  ============================
-Key             Action
+Key             Command
 ==============  ============================
 C-x p o         rope-open-project
 C-x p k         rope-close-project
+- showing the old value of a field in dialogs : November 30, 2007
 - new file/directory/module/package; ``C-x p n [fdmp]`` : November 30, 2007
 - lucky-assist; ``M-?`` : November 29, 2007
 - find occurrences; ``C-c f`` : November 29, 2007


 class Data(object):
-    def __init__(self, prompt=None, default=None,
-                 values=None, starting=None, kind=None):
+    def __init__(self, prompt=None, default=None, values=None, kind=None):
         self.prompt = prompt
         self.default = default
         self.values = values
-        self.starting = starting
         self.kind = kind
                 conf = confs[response]
                 conf = optionals[response]
-            result[response] = askdata(conf)
+            oldvalue = result.get(response, None)
+            result[response] = askdata(conf, starting=oldvalue)
     return response, result


-def askdata(data):
+def askdata(data, starting=None):
     """`data` is a `ropemacs.dialog.Data` object"""
     ask_func = ask
-    ask_args = {'prompt': data.prompt, 'starting': data.starting,
+    ask_args = {'prompt': data.prompt, 'starting': starting,
                 'default': data.default}
     if data.values:
         ask_func = ask_values


     def _get_confs(self):
         oldname = str(self.renamer.get_old_name())
-        return {'newname': dialog.Data('New name: ', starting=oldname)}
+        return {'newname': dialog.Data('New name: ', default=oldname)}
 class RenameCurrentModule(Rename):
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
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.