Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78894

Re: how to add custom importer after the normal imports

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.046
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'interpreter': 0.05; 'python': 0.11; '2.7': 0.14; 'scripts.': 0.16; 'subject:after': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'seems': 0.21; 'example': 0.22; 'import': 0.22; 'email addr:gmail.com&gt;': 0.22; 'question': 0.24; '&gt;': 0.26; 'equivalent': 0.26; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'equivalent.': 0.31; 'skip:_ 10': 0.34; 'subject:the': 0.34; 'received:google.com': 0.35; 'there': 0.35; 'project': 0.37; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'kind': 0.63; 'more': 0.64; 'deeply': 0.69; 'expose': 0.84; 'subject:add': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=qscoYLFlx2LAMVEejA98gy3RjKsbr+ISjssMX6bfWP4=; b=KB57KID62sCi9N8wZpTqGVqWvQkshjhfp1JqbKdiw3j7DlUTKIehhuno6tacDlO6LZ M9HStvAkgZilO6W7bY/2Ecq4ARuCNPZQBtQAo+UeKcveiqaLjiY0Lfge91C7OJS9qJ9g ho8YQCl9n+wp2v+25OURagXatW5BX7cpKemMV0VrcuQAaqRQolRGTlGAO8Fwt1QAbmC1 QMe9cXCEdftXwppsPR5q1JqP3S3zLRfCXgPM3YDQHCWl3HZf6bNg/aGSSVVXMD7i/6xO YWy+t7IG/gVDrhP88aE+2wHpEFqqLpuUsMO6RAllBAT9dEvclWsOcwf3mA/pCJuKHEHf A0Iw==
MIME-Version 1.0
X-Received by 10.68.249.101 with SMTP id yt5mr42542pbc.156.1412864069825; Thu, 09 Oct 2014 07:14:29 -0700 (PDT)
In-Reply-To <m160c7$ne3$1@ger.gmane.org>
References <m1353n$dpu$1@ger.gmane.org> <CALwzidnxJs8U+vsG7b6=W8TnRRHROBo0UMQc_uFqjx_t-5Fgkw@mail.gmail.com> <m160c7$ne3$1@ger.gmane.org>
Date Thu, 9 Oct 2014 08:14:29 -0600
Subject Re: how to add custom importer after the normal imports
From Ian Kelly <ian.g.kelly@gmail.com>
To Python <python-list@python.org>
Content-Type multipart/alternative; boundary=047d7b671d76ff7d050504fe0c81
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14716.1412864078.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1412864078 news.xs4all.nl 2931 [2001:888:2000:d::a6]:32835
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78894

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Oct 9, 2014 6:53 AM, "Gelonida N" <gelonida@gmail.com> wrote:
> I'm using Puthon 2.7 for the given project and there sys.meta_path is [].
>
> Just for fun I started Python3.3 and looked at it's meta_path, which
contained for example _frozen_importlib.PathFinder
>
> Unfortunately python 2.7 does not seem to have the package
_frozen_importlib
>
> So now the question seems to boil down to looking for the 2.7 equivalent
of python 3.3's _frozen_importlib.PathFinder

There is no equivalent. Prior to 3.3 that code was buried deeply in the
interpreter and not available to scripts. The reason for the change was to
expose more of the import machinery for exactly this kind of manipulation.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: how to add custom importer after the normal imports Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-09 08:14 -0600

csiph-web