On Sat, Dec 14, 2013 at 06:33:43AM -0800, Dylan Baker wrote:
> I'd also suggest using the str.format() method instead of
> concatenating a large number of strings and variables, it's much
> more readable IMHO:
>
> self.settings["snapshot_path"] = os.path.normpath(
>       "{0}/snapshots/{1}{2}.tar.xz".format(
>               self.settings["storedir"], self.settings["snapshot_name"],
>               self.settings["snapshot"]))

I love format().  In fact, I'd suggest:

  normpath('{storedir}/snapshots/{snapshot_name}{snapshot}.tar.xz'.format(
      **self.settings))

However, the string formatting syntax is orthogonal to the
snapshot_name setting, which is what Brian's adding in this patch.  I
think a refactor that converts Catalyst to format() would be great,
but it should probably wait until after Brian's rewrite lands.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to