From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0DAC6138A1A for ; Sun, 15 Feb 2015 07:54:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 815C1E084D; Sun, 15 Feb 2015 07:54:39 +0000 (UTC) Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 05541E084D for ; Sun, 15 Feb 2015 07:54:38 +0000 (UTC) Received: from [IPv6:2a01:e35:8bb2:53e0:366d:946e:fb09:dc15] (unknown [IPv6:2a01:e35:8bb2:53e0:366d:946e:fb09:dc15]) by smtp5-g21.free.fr (Postfix) with ESMTP id BFA18D48012 for ; Sun, 15 Feb 2015 08:54:27 +0100 (CET) Message-ID: <54E050BD.5010209@gentoo.org> Date: Sun, 15 Feb 2015 08:54:37 +0100 From: =?UTF-8?B?UsOpbWkgQ2FyZG9uYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-releng@lists.gentoo.org Reply-to: gentoo-releng@lists.gentoo.org MIME-Version: 1.0 To: gentoo-releng@lists.gentoo.org Subject: Re: [gentoo-releng] Enable USE_EXPAND support in catalyst References: <54DF9C00.4010008@opensource.dyc.edu> In-Reply-To: <54DF9C00.4010008@opensource.dyc.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 37f4b485-03e3-49e2-b711-fa7d3a5eb9f2 X-Archives-Hash: 2ac171f11f87371af5399dc919db8c49 Le 14/02/2015 20:03, Anthony G. Basile a écrit : > In the last chunk of modules/generic_stage_target.py: * type(var) == types.DictType can be replaced with isinstance(var, dict). Same thing for StringType/str, ListType/list and BooleanType/bool. This is how simple types were checked before Python 2.2 (around 2002). * string.replace has been deprecated for ages, use str.replace directly: varname2="clst_"+string.replace(y,"/","_") varname2=string.replace(varname2,"-","_") varname2=string.replace(varname2,".","_") becomes varname2 = "clst_" + y.replace("/", "_") varname2 = varname2.replace("-", "_") varname2 = varname2.replace(".", "_") * string.join is also deprecated, use ' '.join() instead * dict objects are iterable (and they return keys). This means that string.join(self.settings[x].keys()) can be written (with the join suggestion above): ' '.join(self.settings[x]) * You may want to use dict.items() to get both the key and the associated value: for y in self.settings[x].keys(): becomes: for y, val in self.settings[x].items(): which should allow you to replace "self.settings[x][y]" with "val" Cheers, Rémi