[Pydev-code] New pydev jython script: Assign variable to attribute of self
Brought to you by:
fabioz
From: Joel H. <yo...@if...> - 2006-09-08 15:53:56
|
Hello! I've dropped from radar for a while since I've been busy coding stuff for my work, but I figured I should share a litte pydev jython hack that I whipped up. This one lets you assign the value of a variable to an attribute of self with the same name, pretty much as you could do with method parameters using my old "Assign params to attribs of self" hack that was included in pydev 1.0.6. The old one was good for avoiding repetitive typing when coding large constructors and such. This one comes in handy for smaller changes, say when you add a parameter to the constructor. It's nothing major, but along with code completion, it saves more typing than you'd think. In the attached code I've bound the jython script to 'a' ('a' for 'assign'), which is the same letter as my old hack. I figured that letter would be up for grabs now that my old hack has been integrated into the quick code assistant. So copy it to your pydev jython script dir, open a new editor and hit "Ctrl-2 a" and see what you make of it. Let me know what you think! Cheers! /Joel |