Skip to content

Commit b5b03ff

Browse files
committed
Merge pull request python-mode#457 from brakhane/develop
add class hierarchy support to rename
2 parents 7937826 + b2de6b0 commit b5b03ff

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

pymode/rope.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,19 @@ def run(self):
465465
if not input_str:
466466
return False
467467

468-
changes = self.get_changes(refactor, input_str)
469-
470468
action = env.user_input_choices(
471-
'Choose what to do:', 'perform', 'preview')
469+
'Choose what to do:', 'perform', 'preview',
470+
'perform in class hierarchy',
471+
'preview in class hierarchy')
472+
473+
in_hierarchy = action.endswith("in class hierarchy")
474+
475+
changes = self.get_changes(refactor, input_str, in_hierarchy)
472476

473477
if not action:
474478
return False
475479

476-
if action == 'preview':
480+
if action.startswith('preview'):
477481
print("\n ")
478482
print("-------------------------------")
479483
print("\n%s\n" % changes.get_description())
@@ -505,15 +509,15 @@ def get_input_str(refactor, ctx):
505509
return True
506510

507511
@staticmethod
508-
def get_changes(refactor, input_str):
512+
def get_changes(refactor, input_str, in_hierarchy=False):
509513
""" Get changes.
510514
511515
:return Changes:
512516
513517
"""
514518
progress = ProgressHandler('Calculate changes ...')
515519
return refactor.get_changes(
516-
input_str, task_handle=progress.handle)
520+
input_str, task_handle=progress.handle, in_hierarchy = in_hierarchy)
517521

518522

519523
class RenameRefactoring(Refactoring):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy