[Twisted-Python] twisted.python.usage.Options Questions

Justin Johnson justinjohnson at fastmail.fm
Fri May 16 19:45:12 EDT 2003


> > I was thinking it would make sense to grab the doc from the class that
> > handles the options for the particular subcommand, since it is the only
> > class/function that we already know the name of and that is already
> > associated with the subcommand.
> > [snip]
> >
> > Does that make sense?  Is that something you can do, or should I get
> > familiar with the code and submit a patch?
> > Thanks for your other suggestions as well.
> 
>   This is just what I was thinking.  If the change to make was obvious to
> me, I'd do it, but after a quick look I find that I don't entirely
> remember
> how this code works.  Could you come up with a patch for this?

Yeah, not till next week though.  I think __str__ needs to change.

    443         if not (getattr(self, "longdesc", None) is None):
    444             longdesc = self.longdesc
    445         else:
    446             import __main__
    447             if getattr(__main__, '__doc__', None):
    448                 longdesc = __main__.__doc__
    449             else:
    450                 longdesc = ''

Probably needs to change to check self.subCommands[2].__doc__ if it
exists, or something like that.  I'll take a look next week.

-Justin




More information about the Twisted-Python mailing list