[PATCH] Add "Starting installer..." messages
Will Woods
wwoods at redhat.com
Thu Jul 19 15:16:37 UTC 2012
On Thu, 2012-07-19 at 10:25 -0400, Chris Lumens wrote:
> > @@ -708,6 +710,13 @@ if __name__ == "__main__":
> > from pyanaconda import vnc
> > from pyanaconda import kickstart
> >
> > + print "anaconda %s for %s %s%s started." % (
> > + getAnacondaVersion(),
> > + product.productName,
> > + product.productVersion,
> > + " (pre-release)" if not product.isFinal else "",
> > + )
> > +
> > # to set UTF8 mode on the terminal, we need LANG to be set usefully
> > if os.environ.get("LANG", "C") == "C":
> > os.environ['LANG'] = DEFAULT_LANG
>
> I'm still not a fan of that syntax.
It's basically the C ternary conditional operator, but reordered:
cond ? a : b → a if cond else b
but then, lots of people aren't fans of the C operator either, so I can
understand that.
So, which would be better:
prerel = ""
if product.isFinal:
prerel = " (pre-release)"
print "anaconda %s for %s %s%s started." % (
getAnacondaVersion(),
product.productName,
product.productVersion,
prerel,
)
Or:
verdesc = "%s for %s %s" % (getAnacondaVersion(),
product.productName, product.productVersion)
if product.isFinal:
print "anaconda %s started." % verdesc
else:
print "anaconda %s (pre-release) started." % verdesc
I think I prefer the latter.
-w
More information about the anaconda-patches
mailing list