[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation |
Date: |
Fri, 4 Sep 2015 09:51:39 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Sep 04, 2015 at 09:12:09AM +0200, Markus Armbruster wrote:
> "Daniel P. Berrange" <address@hidden> writes:
>
> > On Thu, Sep 03, 2015 at 04:29:53PM +0200, Markus Armbruster wrote:
> > Python has a nice tool called pep8 which can apply a
> > configurable bunch of style checks, it is probably
> > worth someone wiring it up to make check in QEMU, since
> > we have an increasing amount of python code. An exercise
> > for a motivated reader.....
>
> I've been using pylint (and dear-oh-dear how much pre-existing lint it
> finds!), wasn't aware of pep8, can throw it in.
The pep8 tool is design around checking the "official" python style
rules as defined by Guido, and seems to be more commonly used than
pylint IME.
> Automatic checking would be nice, but our current code is probably too
> untidy for that. Besides, I don't have the time and energy to set it
> up now.
Yeah, no big deal.
> >> +class QAPISchema(object):
> >> + def __init__(self, fname):
> >> + try:
> >> + self.exprs = check_exprs(QAPISchemaParser(open(fname, "r")).exprs)
> >> + except (QAPISchemaError, QAPIExprError), err:
> >
> > Preferred syntax for exceptions these days is
> >
> > except Foo as err
> >
> > instead of
> >
> > except Foo, err
> >
> > since the former is portable to Python3, should we need to consider
> > that in future. Again, not a show stopper.
>
> Does it work with Python 2.4? That's where we're currently stuck.
Urgh, that's a shame, what distro requires such an ancient
python ? That syntax is only valid from 2.6 onwards.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
- Re: [Qemu-devel] [PATCH RFC v4 04/32] qapi: New QAPISchemaVisitor, (continued)
- [Qemu-devel] [PATCH RFC v4 08/32] Revert "qapi: Generate comments to simplify splitting for review", Markus Armbruster, 2015/09/03
- [Qemu-devel] [PATCH RFC v4 14/32] qapi-event: Eliminate global variable event_enum_value, Markus Armbruster, 2015/09/03
- [Qemu-devel] [PATCH RFC v4 20/32] qapi-visit: Rearrange code a bit, Markus Armbruster, 2015/09/03
- [Qemu-devel] [PATCH RFC v4 10/32] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Markus Armbruster, 2015/09/03
- [Qemu-devel] [PATCH RFC v4 23/32] qapi: De-duplicate parameter list generation, Markus Armbruster, 2015/09/03
- [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation, Markus Armbruster, 2015/09/03
- Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation, Eric Blake, 2015/09/03
- Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation, Eric Blake, 2015/09/04
- Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation, Markus Armbruster, 2015/09/04
- [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects., Eric Blake, 2015/09/04
- Re: [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects., Eric Blake, 2015/09/05
- Re: [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects., Eric Blake, 2015/09/05
- Re: [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects., Eric Blake, 2015/09/05
- Re: [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects., Markus Armbruster, 2015/09/07
- Re: [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects., Markus Armbruster, 2015/09/07