|
|
|
|
|
|
|
|
|
|
xen-tools
[Xen-tools] Re: [Xen-devel] [PATCH] rework xen/xm/main.py to be more str
> 3) Have --help be generated based on the contents of
> xmlib.__dict__[cmd].__doc__
>
> #3 has the nice side-effect of ensuring that xmlib is completely
> documented which makes xmlib the perfect python interface for management
> tools. It would be even nicer if the arguments were expanded instead of
> passed as a list so the functions could be called in a more natural way.
>
> A short help can be autogenerated by only grabbing the first sentence of
> __doc__.
This sounds reasonable, although I'm slightly wary of mixing user command docs
in programmer API doc strings.
> One thing this would break is abbrevation but I'm quite sure Mark is the
> only one using them :-)
I'd rather keep abbreviations - they don't hurt people who don't know they're
there and they make it that little bit easier for those who do. However, if
nobody wants to support it, it'll be easy for me to patch my local tools :-)
Cheers,
Mark
> Regards,
>
> Anthony Liguori
>
> Sean Dague wrote:
> >The following patch is a major restructuring of main.py to be more
> > straight forward, and remove as much code as possible. It does a number
> > of things:
> >
> >* It implements the standardized options proposed via my RFC for xm
> >* It restructures the calling of these functions to be function pointers
> > out of a dictionary, instead of subclasses found through inspection * It
> > consolidates all help info, making it easier to see that the help screen
> > looks consistent across commands
> >* It moves object importing into the functions that require them only,
> > allowing commands like "xm help" to be runable as non root
> >* It adds command aliasing to provide backwards compatibility with many
> > commands (i.e. xm balloon)
> >* It provides more useful error messages is most fail cases
> >* It implements a short help by default (which takes < 24 screen lines) as
> > requested by Mark W at OLS
> >* It attempts to trap more exceptions than before and provide useful
> > errors based on them (this requires more testing)
> >
> >It also has the added benefit of dropping the total size of main.py from
> >935 lines to 694 lines.
> >
> >This patch makes no changes to any other elements of xen/xm, and works
> > with all other objects and libraries as is.
_______________________________________________
Xen-tools mailing list
Xen-tools@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-tools
|
|
|
|
|