Bug in overriding configuration variables in config.flav?
Robert Wall <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
I have recently set up a pyblosxom based weblog (actually it's an
automatic cross reference of bugs referenced in Mozilla checkins with
the bug details in bugzilla, to see it in action go to:
http://backprop.net/mozilla/bonsaibugs/pyblosxom.cgi). It is running
the pyblosxom code from CVS (checkout on 17/7).
My configuration of this system is probably somewhat unusual. The
problem for me is that I would like to limit the depth and number of
entries on certain flavours and not others. The overring mechanism
should be perfect! (I had tried it once before with 0.7beta code but not
until Wari suggested it again recently in a private e-mail did I try it
with CVS code. BTW, Wari the other code you suggested worked perfectly).
Unfortuntely the overriding doesn't work. I have created my files
config.flav with entries of the form:
depth 0
num_entries 999
The code that is reading these entries can be seen on lines 88-94 of
pyblosxom/Pyblosxom/renderers/blosxom.py and is quoted below:
# Check for any configuration override in flavours
if flavours[taste].has_key('config'):
for s in flavours[taste]['config'].split('\n'):
if s.strip() != '':
match = re.match(r'(\w+)\s+(.*)', s)
if match:
config[match.groups()[0]] = match.groups()[1].strip()
From what I can see/guess (I haven't read all related code), this code
is assuming that all config values will be strings. This is plainly not
true in my case. I have verified that for one of my flavours (rss) I
can get it to load correctly with only a single entry if I wrap the last
expression with int(). A second config.flav file (a custom index
flavour) I have which relies on two integer values (like the example
above) is not being working. I have not yet tracked down why this is so.
Sorry for the such a long, e-mail. I hope that this really is a bug and
not my mistake!
Robert
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01