On Sun, Feb 28, 2010 at 2:16 PM, Terry Brown <[email protected]> wrote:
> Personally I prefer
>
> theResult = obPartA + obPartB / someOtherOb
>
> to
>
> the_result = ob_part_A + ob_part_B / some_other_ob
I did too, or thought I did. However, the great advantage of a single
style is that I won't have to remember if it is aB or a_b.
>> Practically speaking, packaging issues will be significant,
>> including command-line args.
>
> Significant even with optparse?
Yes. From my study of pychecker and pylint, I know that handling args
is a large part of any checker. Pylint has hundreds of args.
optparse is handy for overriding defaults, but that's just a small
part of the problem.
On my walk today I "invented" the simplest thing that could possibly
work. Passes 1 and 2 are similar. Here is pass2:
def pass2 (self,d,fd):
'''For each file in fd.keys(),
use the global symbol table d to munge names. '''
for fn in fd.keys():
# Perform the global fixes for this file.
s = fd.get(fn)
s = PythonScanner().scan(d,fn,s,pass_n=2)
I plan to add the following single statement at the start of the loop:
self.setConfig(fn)
This will set the config object self.config, to the settings in effect
for the file whose name is fn. The ivars of this object correspond to
all the various user settings. setConfig will init the object using
per-file settings if they exist, otherwise global settings, otherwise
default settings. So setConfig is a bit complex, but the result is as
simple as possible.
Each fixer will get a setting x by examining self.config.x. It can't
get any easier than that.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.