copymodules.rst 726 B

123456789101112131415161718192021222324
  1. Copying Modules and Packages
  2. ============================
  3. .. module:: nsist.copymodules
  4. .. class:: ModuleCopier(py_version, path=None)
  5. Finds and copies importable Python modules and packages.
  6. There is a Python 3 implementation using :mod:`importlib`, and a Python 2
  7. implementation using :mod:`imp`.
  8. .. method:: copy(modname, target)
  9. Copy the importable module 'modname' to the directory 'target'.
  10. modname should be a top-level import, i.e. without any dots.
  11. Packages are always copied whole.
  12. This can currently copy regular filesystem files and directories,
  13. and extract modules and packages from appropriately structured zip
  14. files.
  15. .. autofunction:: copy_modules