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 74E7C1381F3 for ; Fri, 11 Oct 2013 18:00:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0967DE0A94; Fri, 11 Oct 2013 18:00:51 +0000 (UTC) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6CB5FE0AD0 for ; Fri, 11 Oct 2013 18:00:50 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id rd3so4760115pab.4 for ; Fri, 11 Oct 2013 11:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:in-reply-to:references :mime-version:content-type; bh=G4W2WMBKIdtmmId0gVv3WiAIJAvj9jWgUzsAXbGHgLI=; b=OQvUKfs9EL6Q6hLtRS1JdIGDYW0M6rvcP2CEL9m4m5X4HRFJ28IzhxxLau4UO9M7O6 hZUzvNKS8beP5ePFIxTYZdnrqgw1v+E9e5WxsAEAfm2G3GtM/MFBlVZrE78PHsXT7Q/j jD2SOJTn6eK7IH1X/6I7XGYQqFJ7a4+3W809BKTx1yAow8i134lLd4ln0IXh/wLkQVEe N4jwp/RTdwkqQL72cW7fpZhn57LBBiFbYOPivNXR6uHZ01iQ3YBt4+UWFTJh3WhvEDLI WX8I6izXjSJtbk/cQx2fbBv1Njy4lNWXAPI/TitXwq3iXG6wmsFC8Absw90KNbK5RXP4 GXzQ== X-Received: by 10.66.178.143 with SMTP id cy15mr23233210pac.105.1381514449306; Fri, 11 Oct 2013 11:00:49 -0700 (PDT) Received: from moiraine.localnet (75-92-167-159.war.clearwire-wmx.net. [75.92.167.159]) by mx.google.com with ESMTPSA id fl3sm71790805pad.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Oct 2013 11:00:48 -0700 (PDT) From: Dylan Baker To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] Re: [PATCH 2/4] Catalyst: use a more pythonic method to import modules Date: Fri, 11 Oct 2013 11:00:35 -0700 Message-ID: <5694571.TRnE19jLVX@moiraine> User-Agent: KMail/4.11.2 (Linux/3.11.0; KDE/4.11.2; x86_64; ; ) In-Reply-To: <1381513107-17483-2-git-send-email-baker.dylan.c@gmail.com> References: <1381513107-17483-1-git-send-email-baker.dylan.c@gmail.com> <1381513107-17483-2-git-send-email-baker.dylan.c@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3991121.in3LxdvEOz"; micalg="pgp-sha1"; protocol="application/pgp-signature" X-Archives-Salt: d314a673-4588-47c2-a0f3-c6a1942305c4 X-Archives-Hash: eb51056c008e40d9a09d004c12fe6153 --nextPart3991121.in3LxdvEOz Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Friday, October 11, 2013 10:38:25 AM Dylan Baker wrote: > Rather than appending a directory to the system path, this patch adds a > __init__.py file to modules, which allows python to search it, and it's > children for python modules. This with the import...as syntax allows for > a cleaner import of python modules without changing any other parts of > the catalyst file. > --- > catalyst | 8 ++------ > modules/__init__.py | 0 > 2 files changed, 2 insertions(+), 6 deletions(-) > create mode 100644 modules/__init__.py > > diff --git a/catalyst b/catalyst > index 11560fb..be1548f 100755 > --- a/catalyst > +++ b/catalyst > @@ -11,12 +11,8 @@ import os, sys, imp, string, getopt > import pdb > import os.path > > -__selfpath__ = os.path.abspath(os.path.dirname(__file__)) > - > -sys.path.append(__selfpath__ + "/modules") > - > -import catalyst.config > -import catalyst.util > +import modules.catalyst.config as catalyst.config > +import modules.catalyst.util as catalyst.util > > __maintainer__="Catalyst " > __version__="2.0.14" > diff --git a/modules/__init__.py b/modules/__init__.py > new file mode 100644 > index 0000000..e69de29 Have you ever wondered why you had patches sitting in a branch for months without sending them to the list? It's probably because one in the middle doesn't work :(. That happens to be this one. Expect a v2 with this patch fixed. --nextPart3991121.in3LxdvEOz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) iQEcBAABAgAGBQJSWDzHAAoJEAieFpYUBojvJHkIAI5GHvaiFQ/qitE6kp0Cqoo5 fKTVwoGPUp/d661Uh4sdouYVAdkGtR2wq5vQQGh0gLG+r6F+lz4aEvtfneOxfhio oah3CZKpA8jezJgnbcUsHNoTQCVW92iADxIh6S5WalhXGrLjBGhvUZ4+dIsUPTsA AINILUdjAr17G/EvWwSSxswsb995ftKBzUTPyTZrycgi6Wd/OiXGHsnAzIrPYM4J QB/LyUKcQdnWtNe6dy7xAdZcoT3ADOI1deV9oN8iGexHNLP1MQz5U1e2ZCLl2mCg 893WIXf9XGk0QPWdBtppLkBLHMvSKYpkqpbmmdB+gHxFqb68PfX4RiuFYzYajzU= =ngAz -----END PGP SIGNATURE----- --nextPart3991121.in3LxdvEOz--