[Subversion] / Contextual / README.txt  

Diff of /Contextual/README.txt

Parent Directory | Revision Log

version 2295, Wed Feb 28 04:16:39 2007 UTC version 2297, Sat Mar 3 17:41:05 2007 UTC
Line 85 
Line 85 
 instance for the current thread or task.  Want to use a fresh counter for  instance for the current thread or task.  Want to use a fresh counter for
 a test?  Just do this::  a test?  Just do this::
   
     with Counter():      with Counter.new():
         # code that uses the standard count.* API          # code that uses the standard count.* API
   
 Within the ``with`` block, any code that refers to ``count`` will be using the  Within the ``with`` block, any code that refers to ``count`` will be using the
Line 96 
Line 96 
     >>> Counter.value     # before using a different counter      >>> Counter.value     # before using a different counter
     1      1
   
     >>> @context.call_with(Counter())      >>> @context.call_with(Counter.new())
     ... def do_it(c):      ... def do_it(c):
     ...     print Counter.value      ...     print Counter.value
     0      0
Line 124 
Line 124 
   
 To use it, just do::  To use it, just do::
   
     with DoubleCounter():      with DoubleCounter.new():
         # code in this block that calls ``Counter.inc()`` will be incrementing          # code in this block that calls ``Counter.inc()`` will be incrementing
         # a ``DoubleCounter`` instance by 2          # a ``DoubleCounter`` instance by 2
   
 Or, in Python 2.4, you can do something like::  Or, in Python 2.4, you can do something like::
   
     >>> @context.call_with(DoubleCounter())      >>> @context.call_with(DoubleCounter.new())
     ... def do_it(c):      ... def do_it(c):
     ...     print Counter.value      ...     print Counter.value
     ...     Counter.inc()      ...     Counter.inc()
Line 152 
Line 152 
 want.  You can even take a snapshot of the entire current context and restore  want.  You can even take a snapshot of the entire current context and restore
 all the previous values::  all the previous values::
   
     with context.swap():      with context.only():
         # code to read config file and set up services          # code to read config file and set up services
         # code that uses the configured services          # code that uses the configured services
   
Line 182 
Line 182 
 * ``namespace`` would be better off not being a proxy, and should maybe accept  * ``namespace`` would be better off not being a proxy, and should maybe accept
   type info.    type info.
   
 * Configuration files and "how to specify values" protocol -- e.g. parameter  * Configuration files and "how to specify values" protocol
   should probably accept param(value) vs. param(lambda: value)  
   
 * Scoped services  
   
 * Components w/state binding and **kw attrs update on init  * Components w/state binding and **kw attrs update on init
   
 * Force Action __exit__ operations to occur in a purely static context (i.e.  * State __enter__ should lock the state to the current thread, w/o __exit__ or
   no dynamic state available) to avoid re-registration, indirect access to    swap() or on_exit being possible from other threads, so that they will be
   finalized resources, etc.    thread-safe.
   
 * Detect value calculation cycles  * Detect value calculation cycles
   


Generate output suitable for use with a patch program
Legend:
Removed from v.2295  
changed lines
  Added in v.2297

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help