diff options
author | martin f. krafft <madduck@madduck.net> | 2008-03-21 19:12:12 +0100 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-03-21 15:07:10 -0400 |
commit | e3624de63c799427fbd95fa5bbef9462f95912c6 (patch) | |
tree | 532425e6ec54e0d039091582f44782081353f8ef /plugins/pythondemo | |
parent | 99fce0af0d4e99bc81ef7847bfbe77662763e805 (diff) |
Allow external plugins to return no value
Instead of using the XML-RPC v2 extension <nil/>, which Perl's
XML::RPC::Parser does not (yet) support (Joey's patch is pending), we
agreed on a sentinel: {'null':''}, that is, a hash with a single key
"null" pointing to the empty string.
The Python proxy automatically converts None appropriately and raises an
exception if a hook function should, by weird coincidence, attempt to
return {'null':''}.
Signed-off-by: martin f. krafft <madduck@madduck.net>
Diffstat (limited to 'plugins/pythondemo')
-rwxr-xr-x | plugins/pythondemo | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/pythondemo b/plugins/pythondemo index 6d632d524..5038c603b 100755 --- a/plugins/pythondemo +++ b/plugins/pythondemo @@ -151,7 +151,7 @@ def htmlize_demo(*args): kwargs = _arglist_to_dict(args) debug("hook `htmlize' called with arguments %s" % kwargs) return kwargs['content'] -proxy.hook('htmlize', htmlize_demo) +#proxy.hook('htmlize', htmlize_demo) def pagetemplate_demo(*args): # Templates are filled out for many different things in ikiwiki, like @@ -178,12 +178,10 @@ def templatefile_demo(*args): # change the default ("page.tmpl"). Template files are looked for in # /usr/share/ikiwiki/templates by default. # - # TODO: we cannot really pass undef/None via xml-rpc, so what to do? kwargs = _arglist_to_dict(args) debug("hook `templatefile' called with arguments %s" % kwargs) - raise NotImplementedError return None -#proxy.hook('templatefile', templatefile_demo) +proxy.hook('templatefile', templatefile_demo) def sanitize_demo(*args): # Use this to implement html sanitization or anything else that needs to |