agr / ropemode (http://rope.sf.net/ropemacs.html)

Common parts of ropemacs and ropevim.

Clone this repository (size: 43.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/agr/ropemode/
commit 11: daed99bd38f5
parent 10: a25694db2e67
branch: trunk
interface: removed Environment.askdata
Ali Gholami Rudi
22 months ago

Changed (Δ421 bytes):

raw changeset »

ropemode/interface.py (12 lines added, 2 lines removed)

ropemode/refactor.py (1 lines added, 1 lines removed)

Up to file-list ropemode/interface.py:

@@ -190,7 +190,7 @@ class RopeMode(object):
190
190
        resource, offset = self._get_location()
191
191
192
192
        action, values = dialog.show_dialog(
193
            self.env.askdata, ['search', 'cancel'], optionals=optionals)
193
            self._askdata, ['search', 'cancel'], optionals=optionals)
194
194
        if action == 'search':
195
195
            kwds = get_kwds(values)
196
196
            def calculate(handle):
@@ -368,7 +368,7 @@ class RopeMode(object):
368
368
                parentname.title() + ' Folder: ',
369
369
                default=self.project.address, kind='directory')}
370
370
        action, values = dialog.show_dialog(
371
            self.env.askdata, ['perform', 'cancel'], confs, optionals)
371
            self._askdata, ['perform', 'cancel'], confs, optionals)
372
372
        if action == 'perform':
373
373
            parent = libutils.path_to_resource(
374
374
                self.project, values.get(parentname, self.project.address))
@@ -441,6 +441,16 @@ class RopeMode(object):
441
441
                resource.project == self.project and
442
442
                self.project.pycore.is_python_file(resource))
443
443
444
    def _askdata(self, data, starting=None):
445
        ask_func = self.env.ask
446
        ask_args = {'prompt': data.prompt, 'starting': starting,
447
                    'default': data.default}
448
        if data.values:
449
            ask_func = self.env.ask_values
450
            ask_args['values'] = data.values
451
        elif data.kind == 'directory':
452
            ask_func = self.env.ask_directory
453
        return ask_func(**ask_args)
444
454
445
455
446
456
class _CodeAssist(object):

Up to file-list ropemode/refactor.py:

@@ -31,7 +31,7 @@ class Refactoring(object):
31
31
        self.interface._save_buffers(only_current=not self.saveall)
32
32
        self._create_refactoring()
33
33
        action, result = dialog.show_dialog(
34
            self.env.askdata, ['perform', 'preview', 'cancel'],
34
            self.interface._askdata, ['perform', 'preview', 'cancel'],
35
35
            self._get_confs(), self._get_optionals(),
36
36
            initial_asking=initial_asking)
37
37
        if action == 'cancel':