importhook default behavior

Discussion in 'Python' started by Pete Shinners, Jun 17, 2004.

  1. I have a situation where I am wanting strict control over handling
    multiple installed versions of the same modules.

    All I really want to do is map a package name to a directory special
    directory, and from there allow the standard python importing to continue.

    I've got it working for the simple case, but it seems up to my
    importhook to duplicate a lot of the standard import functionality.
    Especially if it comes to importing subpackages of packages inside my
    magic versioned package.

    What I'd like to do is determine the real directory to use, and make a
    call to the regular python importing tools. Is there somewhere in Python
    I can find an importhook object that represents the default python behavior?

    I suppose the ZipImport has all the functionality I'd need, but it seems
    odd to be recode all that logic (.pyc or .pyo first, .dll or .so, .py,
    or if directory look for __init__.[anyext]. recursive). Maybe that isn't
    so hard after all.
     
    Pete Shinners, Jun 17, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Walch

    Disabling default button behavior

    Stephen Walch, Nov 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    3,099
    Alvin Bruney
    Nov 3, 2003
  2. Stephen F Zelonis

    Strange Behavior on Default Web page

    Stephen F Zelonis, Apr 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    315
    Stephen F Zelonis
    Apr 5, 2004
  3. Denis Remezov
    Replies:
    4
    Views:
    357
  4. Mantorok Redgormor
    Replies:
    70
    Views:
    1,766
    Dan Pop
    Feb 17, 2004
  5. Replies:
    2
    Views:
    612
Loading...

Share This Page