From: Ryan Harper <ryanh@us.ibm.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Ryan Harper <ryanh@us.ibm.com>,
Michael Goldish <mgoldish@redhat.com>,
autotest@test.kernel.org, Uri Lublin <ulublin@redhat.com>,
kvm@vger.kernel.org
Subject: Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py
Date: Wed, 9 Feb 2011 17:31:01 -0600 [thread overview]
Message-ID: <20110209233101.GG26301@us.ibm.com> (raw)
In-Reply-To: <20110209162107.GG3933@otherpad.lan.raisama.net>
* Eduardo Habkost <ehabkost@redhat.com> [2011-02-09 10:22]:
> On Wed, Feb 09, 2011 at 10:06:03AM -0600, Ryan Harper wrote:
> > >
> > > Instead of regular expressions in the filters, the following syntax is used:
> > >
> > > , means OR
> > > .. means AND
> > > . means IMMEDIATELY-FOLLOWED-BY
> >
> > Is there any reason we can't use | for or, and & for AND? I know this
> > is just nit picking, but, it certainly reads easier and doesn't need a
> > translation. AFAICT, in the implementation, we're just using .split(),
> > so, I think the delimiters aren't critical.
>
> I think the main reason is that " " also means "OR" today (as we use
> .split() and I guess we don't want to diverge too much from the previous
> format), and having C-like operators that don't allow spaces would lead
> to confusion. e.g. I am sure somebody would try to write
> "foo & bar | baz" eventually--how would we interpret that?
isn't the comma taking the place for " " as OR? Are you keeping both?
".." looks like a mistake to me where one meant to put "."
I'd suggest ignoring " " as a OR operator, then as with most operations,
you need either parens or order of operation precendence which one
can use to interpret foo & bar | baz.
>
> >
> > >
> > > Example:
> > >
> > > only qcow2..Fedora.14, RHEL.6..raw..boot, smp2..qcow2..migrate..ide
> > >
> > > means select all dicts whose names have:
> > >
> > > (qcow2 AND (Fedora IMMEDIATELY-FOLLOWED-BY 14)) OR
> > > ((RHEL IMMEDIATELY-FOLLOWED-BY 6) AND raw AND boot) OR
> > > (smp2 AND qcow2 AND migrate AND ide)
> >
> > >>> config = "qcow2&Fedora.14|RHEL.6&raw&boot|smp2&qcow2&migrate&ide"
> > >>> config
> > 'qcow2&Fedora.14|RHEL.6&raw&boot|smp2&qcow2&migrate&ide'
> > >>> config.split("|")
> > ['qcow2&Fedora.14', 'RHEL.6&raw&boot', 'smp2&qcow2&migrate&ide']
>
> What bothers me about the examples above is the absense of spaces, that
> makes it not very readable to my eyes.
I don't disagree, but the . and .. I don't find very readable either and
I need a look-up table to distinguish , from .. and . and " ". The
logical operators are well known and recognized.
>
> --
> Eduardo
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com
next prev parent reply other threads:[~2011-02-09 23:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-09 1:50 [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py Michael Goldish
2011-02-09 2:56 ` Cleber Rosa
2011-02-09 9:28 ` Avi Kivity
2011-02-09 10:07 ` Michael Goldish
2011-02-09 10:19 ` Avi Kivity
2011-02-10 1:18 ` Amos Kong
2011-02-10 12:42 ` Lucas Meneghel Rodrigues
2011-02-09 16:06 ` Ryan Harper
2011-02-09 16:21 ` Eduardo Habkost
2011-02-09 23:31 ` Ryan Harper [this message]
2011-02-10 9:14 ` Michael Goldish
2011-02-10 10:34 ` [Autotest] " Avi Kivity
2011-02-10 10:46 ` Michael Goldish
2011-02-10 10:47 ` Avi Kivity
2011-02-10 10:55 ` Michael Goldish
2011-02-10 10:57 ` [Autotest] " Michael Goldish
2011-02-10 11:03 ` Avi Kivity
2011-02-10 11:46 ` Michael Goldish
2011-02-10 13:45 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110209233101.GG26301@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=autotest@test.kernel.org \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mgoldish@redhat.com \
--cc=ulublin@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox