Patch
James Vasile <james <at> hackervisions.org>
2009-08-20 20:25:18 GMT
One of the neat things about Planet is that it passes channel settings
in the config.ini through to the template. This makes the face
settings possible without any reference to faces in the code. It's
cool.
For some reason, we don't do that with planet-level settings. I have
some custom fields in config.ini that I want the template to see, so I
adjusted tmpl.py to pass config.planet_options() to the template.
Patch is below. Released uner GPL and Python license.
Regards,
James Vasile
=== modified file 'planet/shell/tmpl.py'
--- planet/shell/tmpl.py 2009-01-09 08:11:16 +0000
+++ planet/shell/tmpl.py 2009-08-20 20:15:44 +0000
<at> <at> -182,6 +182,16 <at> <at>
context.sources.append(context.source)
del context['source']
+def merge_dict(a, b):
+ """Return a hash containing all the keys and vals of a and all
+ those of b that don't clash with a. Modifies a in place and also
+ returns a."""
+
+ for key in b.keys():
+ if not a.has_key(key):
+ a[key] = b[key]
+ return a
(Continue reading)