Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Global and Module MoveRefactoring #1141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 24, 2023

Conversation

lieryan
Copy link
Contributor

@lieryan lieryan commented Sep 2, 2021

Global and Module Move refactoring requires that dest be a rope
module, while Method Move refactoring requires that dest be an
attribute name.

Previously, Global Move refactoring errors out with

[Pymode]: error: Unhandled exception in Pymode: 'str' object has no attribute 'exists'

And Module Move refactoring errors out with:

[Pymode]: error: Unhandled exception in Pymode: 'str' object has no attribute 'is_folder'

To perform Global Move refactoring:

  1. create a file mod1.py and mod2.py containing
# mod1.py
import mod2
myvar = 1
def myfunc():
    pass
class MyClass:
    pass
# mod2.py
# just empty
  1. To perform Global Move refactoring, point vim cursor to myvar/myfunc/MyClass, then press <C-c>rv
  2. When the destination prompt appears, type "mod2" as destination

To perform a Module Move refactoring:

  1. create a file mod1.py and pkg/mod2.py containing
# mod1.py
import mod2
myvar = 1
def myfunc():
    print(myvar)
    print(MyClass)
class MyClass:
    pass
# pgk/__init__.py
# just empty
# mod2.py
# just empty
  1. To perform Module Move refactoring, point vim cursor to mod2, then press <C-c>rv
  2. When the destination prompt appears.. Type "pkg" as destination.

Global and Module Move refactoring requires that `dest` be a rope
module, while Method Move refactoring requires that `dest` be an
attribute name.
@lieryan lieryan force-pushed the fix-move-refactoring branch 2 times, most recently from c7f3744 to b27b45e Compare September 2, 2021 13:23
@lieryan lieryan force-pushed the fix-move-refactoring branch from b27b45e to b70ec57 Compare September 2, 2021 13:26
@diraol diraol merged commit 71a7f08 into python-mode:develop Jun 24, 2023
@lieryan lieryan deleted the fix-move-refactoring branch June 27, 2023 12:36
@lieryan
Copy link
Contributor Author

lieryan commented Jun 27, 2023

Thanks for merging this pull request @diraol

@diraol
Copy link
Contributor

diraol commented Jun 27, 2023

Thanks for merging this pull request @diraol

I am so sorry it took me so long, the parenting life is really time consuming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants