[Subversion] / PEAK / setup.py  

Revision 1315


Jump to revision:
Previous Next
Author: pje
Date: Sat Aug 2 20:41:06 2003 UTC (20 years, 8 months ago)

Log Message:

Lots of peak.web enhancements for resources and templates:

- Added 'web.bindResource("name")'.

- Documented IWebTraversable.preTraverse() better.

- Made IWebTraversable.getObject() take the interaction as a parameter;
  this is ugly but was necessary in order to get bindResource to work.

- Added TestInteraction.simpleTraverse(), to minimize duplicated code in
  interaction-driven tests.

- Made interactions deal in lists of objects traversed so far, rather
  than keeping only the last object.  This was needed so that resources
  used as methods can be bound to their context (the object whose method
  they are) rather than their container (a layer of the skin).  This is
  also ugly but necessary.  :(

- Added caching to ResourceDirectory and Skin, to prevent repeated
  object creation and retrievals.

- Created 'TemplateResource', so you can 'bindResource()' to peak.web
  template files.  Made '.pwt' file extension map to 'TemplateResource'.

At this point, it's clear to me that the traversal mechanisms used by
'peak.web' are ugly as sin and need critical review.  It is *very*
hard to reason clearly about what traversal components do, in part
because they may or may not be decorators over some "real" object.

Skins and Resources further complicate matters by possibly having
different parents, or mixing MultiTraversers into the mix.  Right
now, things seem to work okay, but I'd feel more comfortable if I
could predict/visualize *how* they work.  I keep finding things not
working as I expect, and although I'm able to understand how they
actually work long enough to make them do what I want, I forget soon
afterwards because it's just too darn complicated!

On the bright side, we now have the minimum required functionality, so
perhaps we can now understand the detailed requirements enough to be
able to refactor the implementation appropriately.

Changed paths:

Path Action Text Changes Prop Changes Diff to Previous
PEAK/setup.py modified X   (diff to previous)
PEAK/src/peak/web/interfaces.py modified X   (diff to previous)
PEAK/src/peak/web/places.py modified X   (diff to previous)
PEAK/src/peak/web/publish.py modified X   (diff to previous)
PEAK/src/peak/web/resource_defaults.ini modified X   (diff to previous)
PEAK/src/peak/web/resources.py modified X   (diff to previous)
PEAK/src/peak/web/skins.py modified X   (diff to previous)
PEAK/src/peak/web/templates.py modified X   (diff to previous)
PEAK/src/peak/web/tests/__init__.py modified X   (diff to previous)
PEAK/src/peak/web/tests/template1.pwt added X X  
PEAK/src/peak/web/tests/test_resources.py added X X  
PEAK/src/peak/web/tests/test_templates.py modified X   (diff to previous)

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help