[Templates] configuration files
Cahill, Earl
earl@aboutws.com
Tue, 28 Oct 2003 18:42:05 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C39DAD.17CD9D40
Content-Type: text/plain;
charset="ISO-8859-1"
Sorry if this is a dumb question, but I have read through some of the
documentation and a couple months of archives and couldn't really see
anything.
Two questions
1. I am wondering about a good way to handle conf files. I would like to
be able to do something like this
--index.html
[% conf = INCLUDE values.conf %]
...
bgcolor = [% conf.bgcolor %]
...
--values.conf
[% {
bgcolor => 'white',
} %]
2. I would like to have key fallback on conf files. So tt will keep
processing conf files till it finds my key. Then I could do something like
this
--/tmp/over/values.conf
lots of values including bgcolor = white
--/tmp/default/values.conf
only the value bgcolor = white
then my INCLUDE_PATH looks like ['/tmp/over', '/tmp/default']. Otherwise,
it sure seems like I would have to duplicate the default conf, in which case
I have information in two different places, which I am not a fan of. The
best I could come up with is to have the overriding conf file include the
default conf file, but it would have to use full path to do so, since the
overriding conf wins on the fallback.
Thanks,
Earl
------_=_NextPart_001_01C39DAD.17CD9D40
Content-Type: text/html;
charset="ISO-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META content="MSHTML 6.00.2800.1264" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>Sorry if this is a
dumb question, but I have read through some of the documentation and a couple
months of archives and couldn't really see anything.</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>Two
questions</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>1. I am
wondering about a good way to handle conf files. I would like to be able
to do something like this</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2></FONT></SPAN><SPAN
class=789082323-28102003><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>--index.html</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>[% conf = INCLUDE
values.conf %]</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>...</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>bgcolor = [%
conf.bgcolor %] </FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>...</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>--values.conf</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>[%
{</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2> bgcolor =>
'white',</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>}
%]</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>2. I would
like to have key fallback on conf files. So tt will keep processing conf
files till it finds my key. Then I could do something like
this</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>--/tmp/over/values.conf</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>lots of values
including bgcolor = white</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>--/tmp/default/values.conf</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>only the value
bgcolor = white</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial size=2>then my INCLUDE_PATH
looks like ['/tmp/over', '/tmp/default']. Otherwise, it sure seems like I
would have to duplicate the default conf, in which case I have information in
two different places, which I am not a fan of. The best I could come up
with is to have the overriding conf file include the default conf file, but it
would have to use full path to do so, since the overriding conf wins on the
fallback.</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=789082323-28102003><FONT face=Arial
size=2>Earl</FONT></SPAN></DIV></BODY></HTML>
------_=_NextPart_001_01C39DAD.17CD9D40--