Re: [Pydev-code] Getting started with PyDev scripting
Brought to you by:
fabioz
|
From: Joel H. <yo...@if...> - 2006-04-13 13:38:55
|
Hi!
I've cooked up a new version of my 'Assign method parameters to attributes of
self' script. This one should be saner, neater, more helpful, and respectful of
indent. I'm still very thankful for any hints or comments regarding anything in
this code.
I also have a few questions:
1)
Is there some way of detecting whether or not there's a syntax error on the
current line at sript execution? In the current form my script will happily
propagate syntax errors from the def line, e.g:
class moo:
def cow(self, 1):
(gives self.1 = 1 on execution)
2) Is there a bug in getInsideParentesisToks?
If called with the string "(foo,)" then (the equivalent of) ['foo'] is
returned. If called with the string "(foo, )" then (the equivalent of) ['foo',
''] is returned. The input values are equivalent in python, so shouldn't the
returned values be equal?
The reason I ask is related to my comment at line 71 in my attached script:
# This can happen with legal def lines such as "def moo(self, ):"
3)
Right now my script activates on "Ctrl-2" followed by "a<Enter>". I think what
we initially discussed was having this as "Ctrl-2" followed by "a", which just
requires swapping the True at the final line for a False.
Which one should I use? The latter seems more convenient for me right now, but
using it makes it impossible to execute other scripts whose names begin with
"a". Is there an easy way for users to rebind script names to their needs? Who
decides which script should have what name?
Anyway, I'm really starting to like this pydev scripting thing. This'll be
good, I'm sure. :-)
Take care!
/Joel Hedlund
|