X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/1fac30a0698f9d001efa1190ba39bbdaad2492cc..2317ce58b0bdda0ba850bae938e3b36715bb258a:/plugins/proxy.py diff --git a/plugins/proxy.py b/plugins/proxy.py old mode 100755 new mode 100644 index cf5588b24..6f9b1f852 --- a/plugins/proxy.py +++ b/plugins/proxy.py @@ -88,7 +88,7 @@ class _IkiWikiExtPluginXMLRPCHandler(object): @staticmethod def _write(out_fd, data): - out_fd.write(data) + out_fd.write(str(data)) out_fd.flush() @staticmethod @@ -108,7 +108,7 @@ class _IkiWikiExtPluginXMLRPCHandler(object): def send_rpc(self, cmd, in_fd, out_fd, **kwargs): xml = xmlrpclib.dumps(sum(kwargs.iteritems(), ()), cmd) - self._debug_fn('sending xml to ikiwiki to call procedure %s: [%s]' % (cmd, xml)) + self._debug_fn("calling ikiwiki procedure `%s': [%s]" % (cmd, xml)) _IkiWikiExtPluginXMLRPCHandler._write(out_fd, xml) self._debug_fn('reading response from ikiwiki...') @@ -151,7 +151,7 @@ class IkiWikiProcedureProxy(object): self._xmlrpc_handler = _IkiWikiExtPluginXMLRPCHandler(self._debug_fn) self._xmlrpc_handler.register_function(self._importme, name='import') - def register_hook(self, type, function): + def hook(self, type, function): self._hooks.append((type, function.__name__)) self._xmlrpc_handler.register_function(function) @@ -171,5 +171,8 @@ class IkiWikiProcedureProxy(object): return time.sleep(LOOP_DELAY) except Exception, e: - self._debug_fn('uncaught exception: %s' % e) + print >>sys.stderr, 'uncaught exception: %s' % e + import traceback + print >>sys.stderr, traceback.format_exc(sys.exc_info()[2]) + import posix sys.exit(posix.EX_SOFTWARE)