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


Groups > comp.lang.python > #78837

how to add custom importer after the normal imports

Path csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'advance': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '*before*': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:after': 0.16; 'implementing': 0.19; 'import': 0.22; 'install': 0.23; 'header:User-Agent:1': 0.23; 'header:X -Complaints-To:1': 0.27; "skip:' 10": 0.31; 'allows': 0.31; 'this.': 0.32; 'received:fr': 0.33; 'subject:the': 0.34; 'problem': 0.35; 'anybody': 0.35; 'add': 0.35; 'entry': 0.36; 'thanks': 0.36; 'hi,': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; 'first': 0.61; 'such': 0.63; 'default': 0.69; 'received:109': 0.72; 'subject:add': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Gelonida N <gelonida@gmail.com>
Subject how to add custom importer after the normal imports
Date Wed, 08 Oct 2014 12:53:41 +0200
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 1-75-190-109.dsl.ovh.fr
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
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.14681.1412765637.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1412765637 news.xs4all.nl 2864 [2001:888:2000:d::a6]:60564
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78837

Show key headers only | View raw


Hi,


I just read about sys.meta_path, which allows to install custom 
importers *BEFORE* the default importers.

However I have a use case where I would like to add a custom importer 
*AFTER* all other import methods have failed.

Does anybody know how to do this.

One way of implementing this would be to add the default importer as 
first entry in sys.meta_path. My only problem is, that I don't know how 
to create a 'default-importer', such that I can add it into sys.meta_path

Thanks in advance for any suggestions

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


Thread

how to add custom importer after the normal imports Gelonida N <gelonida@gmail.com> - 2014-10-08 12:53 +0200

csiph-web