Browse Source

Improve API docs

Thomas Kluyver 11 years ago
parent
commit
31fb3801f0
4 changed files with 32 additions and 3 deletions
  1. 24 0
      doc/api/copymodules.rst
  2. 1 0
      doc/api/index.rst
  3. 5 1
      nsist/__init__.py
  4. 2 2
      nsist/copymodules.py

+ 24 - 0
doc/api/copymodules.rst

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

+ 1 - 0
doc/api/index.rst

@@ -6,3 +6,4 @@ Python API
 
    main
    nsiswriter
+   copymodules

+ 5 - 1
nsist/__init__.py

@@ -39,7 +39,11 @@ else:
     DEFAULT_BITNESS = 32
 
 class InstallerBuilder(object):
-    """Controls building an installer.
+    """Controls building an installer. This includes three main steps:
+    
+    1. Arranging the necessary files in the build directory.
+    2. Filling out the template NSI file to control NSIS.
+    3. Running ``makensis`` to build the installer.
     
     :param str appname: Application name
     :param str version: Application version

+ 2 - 2
nsist/copymodules.py

@@ -169,8 +169,8 @@ else:
 def copy_modules(modnames, target, py_version, path=None):
     """Copy the specified importable modules to the target directory.
     
-    By default, it finds modules in sys.path - this can be overridden by passing
-    the path parameter.
+    By default, it finds modules in :data:`sys.path` - this can be overridden
+    by passing the path parameter.
     """
     mc = ModuleCopier(py_version, path)
     files_in_target_noext = [os.path.splitext(f)[0] for f in os.listdir(target)]