# HG changeset patch # User Jeff Hammel # Date 1307547392 25200 # Node ID 0b2019d0af98d354e5294f77d10be891bd735c7d # Parent db095765807d50e0edb672c7eb1d0a25b0566473 finalize (hopefully) decorator syntax diff -r db095765807d -r 0b2019d0af98 README.txt --- 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