changeset 40:0b2019d0af98

finalize (hopefully) decorator syntax
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 08 Jun 2011 08:36:32 -0700
parents db095765807d
children 2c228e3cd6d8
files README.txt
diffstat 1 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/README.txt	Tue Jun 07 22:08:57 2011 -0700
+++ b/README.txt	Wed Jun 08 08:36:32 2011 -0700
@@ -84,10 +84,36 @@
 INI files have a few convenience variables:
 
 - %(here)s : the location of the directory the .ini file lives in
-- %(app)s : used for wrappers
+- %(object)s : used for wrappers
 
 Additional variables may be provided by the consumer.
 
+Summary of .ini decorator syntax
+--------------------------------
+
+1. ``[foo:%(here)s/objects.py:MyClass]``: create object ``foo`` of type
+   ``MyClass`` using arguments given from the section
+
+2. ``[foo:bar]``: create object ``foo`` using the pattern from section
+   ``bar`` but overriding any arguments in the ``bar`` section with
+   those from this section 
+
+3. ``[foo:bar:%(here)s/objects.py:MyClass]``: create object ``foo``
+   which is an instance of ``MyClass`` wrapped in the object created by
+   the ``bar`` pattern. ``bar`` is passed a special argument,
+   ``%(object)s`` which is the instance of the wrapped object (the
+   ``MyClass`` instance). Internally, the wrapped object is known by
+   the whole section name (``foo:bar:%(here)s/objects.py:MyClass``). The 
+   arguments in this section apply to ``MyClass(...)``
+
+4. ``[foo:bar:app=%(object)s,value=1:%(here)s/objects.py:MyClass]``:
+   the same as 3. but override the values in the ``bar`` section with
+   ``app=%(object)s`` and ``value=1``
+
+* ``[name:path]``
+* ``[name:decorator:path]``
+* ``[name:decorator:overrides:path]``
+
 ----
 
 Jeff Hammel