Anonymous avatar Anonymous committed daed99b

interface: removed Environment.askdata

Comments (0)

Files changed (2)

ropemode/interface.py

         resource, offset = self._get_location()
 
         action, values = dialog.show_dialog(
-            self.env.askdata, ['search', 'cancel'], optionals=optionals)
+            self._askdata, ['search', 'cancel'], optionals=optionals)
         if action == 'search':
             kwds = get_kwds(values)
             def calculate(handle):
                 parentname.title() + ' Folder: ',
                 default=self.project.address, kind='directory')}
         action, values = dialog.show_dialog(
-            self.env.askdata, ['perform', 'cancel'], confs, optionals)
+            self._askdata, ['perform', 'cancel'], confs, optionals)
         if action == 'perform':
             parent = libutils.path_to_resource(
                 self.project, values.get(parentname, self.project.address))
                 resource.project == self.project and
                 self.project.pycore.is_python_file(resource))
 
+    def _askdata(self, data, starting=None):
+        ask_func = self.env.ask
+        ask_args = {'prompt': data.prompt, 'starting': starting,
+                    'default': data.default}
+        if data.values:
+            ask_func = self.env.ask_values
+            ask_args['values'] = data.values
+        elif data.kind == 'directory':
+            ask_func = self.env.ask_directory
+        return ask_func(**ask_args)
 
 
 class _CodeAssist(object):

ropemode/refactor.py

         self.interface._save_buffers(only_current=not self.saveall)
         self._create_refactoring()
         action, result = dialog.show_dialog(
-            self.env.askdata, ['perform', 'preview', 'cancel'],
+            self.interface._askdata, ['perform', 'preview', 'cancel'],
             self._get_confs(), self._get_optionals(),
             initial_asking=initial_asking)
         if action == 'cancel':
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.