From 97aeb18b20f901950da0355471fdc17055f3f4a8 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 26 Jun 2009 09:27:50 -0400 Subject: Added ability to handle non text/* MIME types. The main problem was the encoding/decoding that was happening to _all_ input/output. Now many I/O activities have a `binary' option to disable any encoding/decoding. The `binary' flag is set whenever the comment content-type is not a text/* type. In order to print valid XML (and make life easy on xml/be-xml-to-mbox), non text/* types are printed out as base64-encoded MIME messages, so be list --xml | be-xml-to-mbox | catmutt works as you'd expect. With the standard (non-XML) output from `be show', we just print a message telling the user that we can't reasonably display the MIME type and that they should use the XML output if they want to see it. --- libbe/bzr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libbe/bzr.py') diff --git a/libbe/bzr.py b/libbe/bzr.py index 98ca571..21030e2 100644 --- a/libbe/bzr.py +++ b/libbe/bzr.py @@ -56,9 +56,9 @@ class Bzr(RCS): self._u_invoke_client("remove", "--force", path) def _rcs_update(self, path): pass - def _rcs_get_file_contents(self, path, revision=None): + def _rcs_get_file_contents(self, path, revision=None, binary=False): if revision == None: - return RCS._rcs_get_file_contents(self, path, revision) + return RCS._rcs_get_file_contents(self, path, revision, binary=binary) else: status,output,error = \ self._u_invoke_client("cat","-r",revision,path) -- cgit