eric ide


Title: rope plugin doesn't work
Type: behavior Product: eric4 plug-in: Rope Refactoring
Priority: critical    
Status: closed Resolution: fixed
Superseder: Nosy List: detlev, roperuser
Assigned to: detlev Keywords:

Created on 2013-02-07.06:23:16 by roperuser, last changed by roperuser.

File Name Uploaded Description Remove
change_signature_and_extract_method.png roperuser, 2013-02-08.11:56:11 roperuser, 2013-02-08.11:28:00
Messages (9.0)
msg286 (view) Author: roperuser Date: 2013-02-09.16:57:49
Great! Thank you.
Today is our traditional New Year. Happy Spring Festival and Best Wishes!
msg285 (view) Author: detlev Date: 2013-02-09.10:40:51
All observed issues were caused by the same problem. rope uses 'universal
linefeeds' internally. That means, the cr-lf and lf are treated the same and are
counted as one character. The plug-in treated them differently. Issue is fixed
and a new plug-in version is available via the plug-in repository.
msg284 (view) Author: roperuser Date: 2013-02-09.04:52:47
Fine, it works while higlight the complete line to change signature.

While, I had tried the RopeIDE using the same version rope library as this 
plugin (v0.9.4, I simplely copyed the "Lib\site-
packages\eric4plugins\RefactoringRope\rope" to "Lib\site-packages\rope"). It 
worked fine:
"Rename" worked and won't fall into infinite loop.
"Change Method Signature" would worked even the only method name was 
"Extract Method" also worked.

msg282 (view) Author: detlev Date: 2013-02-08.18:53:07
2) Change Signature (msg280)
rope seems to be a bit picky here. I had to change the code in the plug-in a
little bit to make it work. Meanwhile just highlight the complete line with the
method definition.
msg281 (view) Author: detlev Date: 2013-02-08.18:42:57
1) Issue with Rename (msg279)
I analysed that issue and it fails over here as well. It seems that the rope
library enters an infinite loop. rope is a third party library I include in the
plug-in as is. Please report this issue with your test script to the rope
developers via the rope mailing list (rope-dev at

Unfortunately there is nothing I can do about it.
msg280 (view) Author: roperuser Date: 2013-02-08.11:56:11
Sorry, I have missed to mention install the plugin "Refactoring, Rope" after 
install eric4. It was installed by using "Plugins -> Plugin Repository...". 
And the Version is 1.2.0.

# Change Signature
Select and highlight the identifier "makeSense" at line 16.
Select "Refactoring -> Refactoring -> Change Method Signature".
Then the rope error pops up: "Change method signature should be performed on 

# Extract Method
Select and highlight the two lines: line 12 and line 13.
Select "Refactoring -> Refactoring -> Extract Method".
Type a method name, eg. "testfunc".
The checkbox "Extract similar expressions/statements" was checked by default.
Click "OK" or "Preview" button.
Then the rope error pops up: "Extracted piece should contain complete 

As the attachment "change_signature_and_extract_method.png".
msg279 (view) Author: roperuser Date: 2013-02-08.11:28:00
OK, let's be more patient.

I must reiterate the environment again. I think the rope error is irrelevant 
completely, which made me impatient yesterday. I guess maybe there's 
environment difference which made it didn't work for me. 

My OS is 32bit Windows-7, then intall the "python-2.7.3.msi", then install 
the "PyQt-Py2.7-x86-gpl-4.9.6-1.exe", then extract the "" and 
then then run the "eric4-4.5.8\".

Run the "eric4-4.5.8\eric\eric4.pyw".
Create a project named "test1".
Create a new file named "" and with content as the attachment.
Select and highlight the identifier "sense" at line 12.
Select "Refactoring -> Refactoring -> Rename".
While the check box "Rename occurrences in strings and comments" was checked 
by default.
Type a new name such as "testnewname" at the pop-up dialog.
Click the "OK" or "Preview" button.
Then eric4 the whole program die away. Check the "Windows Task Manager" will 
find a process named "pythonw.exe" occupy a whole core of CPU (eg. 25% for 
quard core CPU).

While if the checkbox "Rename occurrences in strings and comments" was made 
unchecked, eric4 won't die away, but it do nothing at all. Both the 
identifier "sense" remain no change.

# I'll describe the rest at next replay soon.
msg278 (view) Author: detlev Date: 2013-02-07.17:22:30
Please be a bit more specific and give info about the steps you did (e.g.
selected the method name, pressed "Rename", ...).

The "Rope error:..." tell you, what you did wrong. If you correct your error,
the function will work (at least they did I used them last time).
msg277 (view) Author: roperuser Date: 2013-02-07.06:23:16
refactor,rope 1.2.0 / eric4-4.5.8(r4410) / pyqt-py2.7-4.9.6-1 / python2.7.3 / 
win7 x86

There's no such a single function could work. Is it a trick? I don't think 
it's for human use.
"Rename" will cause the whole program die away.
"Extract Method" will pop-up a error "Rope error: Extracted piece should 
contain complete statements.".
"Change Method Signature" will pop-up a error "Rope error: Change method 
signature should be performed on functions".
In a word, there's no such a single function could work. Can it be worse on 
Date User Action Args
2013-02-09 16:57:49roperusersetmessage_count: 8.0 -> 9.0
messages: + msg286
2013-02-09 10:40:51detlevsetmessage_count: 7.0 -> 8.0
messages: + msg285
resolution: fixed
status: open -> closed
2013-02-09 04:52:47roperusersetmessage_count: 6.0 -> 7.0
messages: + msg284
2013-02-09 04:50:54roperusersetmessage_count: 7.0 -> 6.0
messages: - msg283
2013-02-09 03:32:46roperusersetmessage_count: 6.0 -> 7.0
messages: + msg283
2013-02-08 18:53:08detlevsetmessage_count: 5.0 -> 6.0
messages: + msg282
2013-02-08 18:42:57detlevsetmessage_count: 4.0 -> 5.0
messages: + msg281
2013-02-08 11:56:11roperusersetfiles: + change_signature_and_extract_method.png
message_count: 3.0 -> 4.0
messages: + msg280
2013-02-08 11:28:00roperusersetfiles: +
message_count: 2.0 -> 3.0
messages: + msg279
2013-02-07 17:22:30detlevsetassignedto: detlev
message_count: 1.0 -> 2.0
messages: + msg278
nosy: + detlev
status: new -> open
2013-02-07 06:23:16roperusercreate