Commits

holger krekel committed d83f3dc

bump to version 1.0, amend README

Comments (0)

Files changed (3)

-1.0.0b7
+1.0
 ----------------------------------------
 
 - make apipkg memorize the absolute path where a package starts
 
 - allow to alias modules
 
+- allow to use dotted names in alias specifications (thanks Ralf
+  Schmitt).
+
 1.0.0b6
 ----------------------------------------
 
     apipkg.initpkg(__name__, {
         'path': {
             'Class1': "_mypkg.somemodule:Class1",
-            'Class2': "_mypkg.othermodule:Class2",
+            'clsattr': "_mypkg.othermodule:Class2.attr",
         }
     }
 
     >>> import mypkg
     >>> mypkg.path
     <ApiModule 'mypkg.path'>
-    >>> mypkg.sub.Class1   # '_mypkg.somemodule' gets imported now
+    >>> mypkg.path.Class1   # '_mypkg.somemodule' gets imported now
     <class _mypkg.somemodule.Class1 at 0xb7d428fc>
-    >>> mypkg.sub.Class2   # '_mypkg.othermodule' gets imported now
-    <class _mypkg.somemodule.Class1 at 0xb7d428fc>
+    >>> mypkg.path.clsattr  # '_mypkg.othermodule' gets imported now
+    4 # the value of _mypkg.othermodule.Class2.attr
 
-The ``mypkg.sub`` namespace and both its classes are 
-lazy loaded.  Note that **no imports apart from the root 
-'import mypkg' is required**. This means that whoever
-uses your Api only ever needs this one import.  Of course
-you can still use the import statement like so::
+The ``mypkg.path`` namespace and its two entries are
+loaded when they are accessed.   This means:
+
+* lazy loading - only what is actually needed is ever loaded
+
+* only the root "mypkg" ever needs to be imported to get
+  access to the complete functionality.
+
+* the underlying modules are also accessible, for example::
 
     from mypkg.sub import Class1
 
 import sys
 from types import ModuleType
 
-__version__ = "1.0b7"
+__version__ = "1.0"
 
 def initpkg(pkgname, exportdefs):
     """ initialize given package from the export definitions. """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.