Hi,
For the context, I'm working on Pelix (https://github.com/tcalmant/ipopo),
a service-oriented architecture framework (in GPLv3), inspired by OSGi
(from the Java world).
It runs on Python >= 2.6 (with the backport of importlib) and Python 3.1
(not tested upon this version).
It considers Python
...
Actually the main problem which I've been banging my head quite a few
days alreays is this:
--8<---cut here---start->8---
ERROR: Failure: AttributeError ('module' object has no attribute 'walk')
best way
would be to use python setup.py test, which would make everything needed
for the tests available.
The problem is that it's very slow to run and harder to integrate in
Eclipse, so I created an import hook, that tries to do a
pkg_resources.require first.
The test runner should do some
An alternative approach:
http://pastebin.com/z6pNqFYE
or:
# devpla...@gmail.com
# 2011-Nov-15
# recordimports.py
# my Import Hook Hack in response to:
#
http://groups.google.com/group/comp.lang.python/browse_thread/thread/5a5d5c724f142eb5?hl=en
# as an initial learning exercise
# This code
On 11/10/2011 05:02 PM, Eric Snow wrote:
Yeah, I'm working on a reference for imports in Python. They're just
a little too mysterious relative to the rest of the language. But
it's not too helpful yet. In the meantime...
Yes it's quite mysterious, and it's actually not as hard as it looks..
So I would really like to accomplish the following:
run a program normally and keep track of all the imports that were
actually done.
I studied the PEP 302, but I'm still a bit confused about how to do it.
I thought that instead of implementing everything I could just record
the request
and
nes/porter
Which implements an import hook (PEP 302) that can be set up to look
at an environment variable with the following format:
name=location[:name=location[:name=location[:...]]]
This is parsed into a standard dict and used for quick lookups when
possible, falling back to the standard Pyt
Thomas Heller wrote:
> There are also other ways. You could extend __path__ of foo, and the
> pkgutil module might also be useful.
The __path__ trick worked nicely, thanks. Here is the code in case anyone is
interested
# Allow veusz to be run even if not installed into PYTHONPATH
try:
impor
Alex Martelli wrote:
> Jeremy Sanders <[EMAIL PROTECTED]> wrote:
>
>> Hi - Is it possible to override the import process so that if in my program
>> I do
>>
>> import foo.bar
>>
>> Python will look for bar in a directory which isn't called foo?
>>
>> I want my module/program to be able to be ru
Jeremy Sanders <[EMAIL PROTECTED]> wrote:
> Hi - Is it possible to override the import process so that if in my program
> I do
>
> import foo.bar
>
> Python will look for bar in a directory which isn't called foo?
>
> I want my module/program to be able to be run without being installed in
> si
Jeremy Sanders wrote:
> Hi - Is it possible to override the import process so that if in my program
> I do
(...)
>
> Any ideas?
Why not handle the foo.bar/version string separately and just append
the resulting path to sys.path?
--
http://mail.python.org/mailman/listinfo/python-list
Hi - Is it possible to override the import process so that if in my program
I do
import foo.bar
Python will look for bar in a directory which isn't called foo?
I want my module/program to be able to be run without being installed in
site-packages, so by doing "import foo.bar", it should start lo
Kartic wrote:
Hi Torsten,
If you want to use other methods to import (other than good ole file
system), yes, you can create an importer class and register it as an
importer module, that import will use to search and import.
For example, it is possible to use zip imports (this functionality is
alrea
Hi Torsten,
If you want to use other methods to import (other than good ole file
system), yes, you can create an importer class and register it as an
importer module, that import will use to search and import.
For example, it is possible to use zip imports (this functionality is
already builtin)
Hi,
is there some description available to overwrite the import
hook? By googling i found out so far that i need to overwrite
__builtins__.__import__ with something else.
Can i also do this with a C function that is provided when
using an embedded python interpreter? So my own C program
15 matches
Mail list logo