Dave Swegen wrote:
Is there any way for a pydcmp to get hold of the value of docroot? At
the moment I'm having to hardcode the value in, which is somewhat ugly.
Sure.
from SkunkWeb import Configuration
doSomethingWith(Configuration.documentRoot)
The Configuration object is generally speaking a treasure trove of
such information. Be aware that it is a "scopeable" object, meaning
that it can be configured to return different values for different
variables depending on the request; the documentRoot, for instance,
may not always be the same, so you wouldn't want to cache any
component whose output is dependent on an internally-accessed
Configuration variable that may be scoped. It is safer, therefore, to
pass in the value of a Configuration variable as an argument to the
component.
7)