项目作者: jurev

项目描述 :
Knockout aims to extend the basic importing mechanisms in Python3 by allowing more exotic stuff to be added to sys.path.
高级语言: Python
项目地址: git://github.com/jurev/knockout.git
创建时间: 2010-10-22T21:36:01Z
项目社区:https://github.com/jurev/knockout

开源协议:

下载


Knockout

Knockout aims to extend the basic importing mechanisms in Python3 by allowing more exotic stuff to be added to sys.path.

TODO

  • add tests
  • PyPy support with sandbox mode
  • Hy support

Importers

Currently, the available importer is:

  • urlimport.py: Import modules from anywhere on the web by adding URLs to sys.path.

Importing modules from the web

  1. >>> from knockout import urlimport
  2. >>> urlimport.register()
  3. Url importing enabled. Add urls to sys.path.
  4. A valid url looks like this: http://example.com/path/to/repository/#packagename
  5. This stuff is experimental, use at your own risk. Enjoy.
  6. >>> import sys
  7. >>> sys.path.insert(0, 'http://localhost:8000/#import_me')
  8. >>> import import_me
  9. ...