From: Dylan Baker <baker.dylan.c@gmail.com>
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 [thread overview]
Message-ID: <5694571.TRnE19jLVX@moiraine> (raw)
In-Reply-To: <1381513107-17483-2-git-send-email-baker.dylan.c@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]
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 <catalyst@gentoo.org>"
> __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.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2013-10-11 18:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 17:38 [gentoo-catalyst] [PATCH 1/4] catalyst: Specify python2 rather than the generic python Dylan Baker
2013-10-11 17:38 ` [gentoo-catalyst] [PATCH 2/4] Catalyst: use a more pythonic method to import modules Dylan Baker
2013-10-11 18:00 ` Dylan Baker [this message]
2013-10-11 17:38 ` [gentoo-catalyst] [PATCH 3/4] catalyst: split combined import Dylan Baker
2013-10-11 17:38 ` [gentoo-catalyst] [PATCH 4/4] catalyst: Remove commented sections of code Dylan Baker
2013-10-11 18:15 ` [gentoo-catalyst] [PATCH 1/4] catalyst: Specify python2 rather than the generic python Brian Dolbec
2013-10-11 19:28 ` Matt Turner
2013-10-11 21:11 ` Brian Dolbec
2013-10-11 21:58 ` Matt Turner
2013-10-13 9:19 ` Dylan Baker
2013-10-13 16:33 ` Brian Dolbec
2013-10-13 20:52 ` Dylan Baker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5694571.TRnE19jLVX@moiraine \
--to=baker.dylan.c@gmail.com \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox