From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXmir-0001fq-Fc for qemu-devel@nongnu.org; Fri, 04 Sep 2015 04:51:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXmil-0001N1-Mf for qemu-devel@nongnu.org; Fri, 04 Sep 2015 04:51:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXmil-0001MP-Hc for qemu-devel@nongnu.org; Fri, 04 Sep 2015 04:51:43 -0400 Date: Fri, 4 Sep 2015 09:51:39 +0100 From: "Daniel P. Berrange" Message-ID: <20150904085139.GE25525@redhat.com> References: <1441290623-13631-1-git-send-email-armbru@redhat.com> <1441290623-13631-3-git-send-email-armbru@redhat.com> <20150903161141.GM31547@redhat.com> <878u8mirp2.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <878u8mirp2.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Fri, Sep 04, 2015 at 09:12:09AM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" 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 :|