Gentoo Archives: gentoo-catalyst

From: "W. Trevor King" <wking@×××××××.us>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
Date: Sun, 15 Dec 2013 00:05:11
Message-Id: 20131215000506.GF25409@odin.tremily.us
In Reply to: Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults by Dylan Baker
1 On Sat, Dec 14, 2013 at 06:33:43AM -0800, Dylan Baker wrote:
2 > I'd also suggest using the str.format() method instead of
3 > concatenating a large number of strings and variables, it's much
4 > more readable IMHO:
5 >
6 > self.settings["snapshot_path"] = os.path.normpath(
7 > "{0}/snapshots/{1}{2}.tar.xz".format(
8 > self.settings["storedir"], self.settings["snapshot_name"],
9 > self.settings["snapshot"]))
10
11 I love format(). In fact, I'd suggest:
12
13 normpath('{storedir}/snapshots/{snapshot_name}{snapshot}.tar.xz'.format(
14 **self.settings))
15
16 However, the string formatting syntax is orthogonal to the
17 snapshot_name setting, which is what Brian's adding in this patch. I
18 think a refactor that converts Catalyst to format() would be great,
19 but it should probably wait until after Brian's rewrite lands.
20
21 Cheers,
22 Trevor
23
24 --
25 This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
26 For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachments

File name MIME type
signature.asc application/pgp-signature