From 5655042dc8b63d04bf6e5ac822e33349e1cd9cd2 Mon Sep 17 00:00:00 2001 From: Sengian Date: Tue, 11 Jan 2011 20:28:13 +0100 Subject: [PATCH] Modify rtf2xml debug parameters (2) --- src/calibre/ebooks/rtf/input.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/rtf/input.py b/src/calibre/ebooks/rtf/input.py index 981a930d54..915ca55fc1 100644 --- a/src/calibre/ebooks/rtf/input.py +++ b/src/calibre/ebooks/rtf/input.py @@ -77,18 +77,19 @@ class RTFInput(InputFormatPlugin): def generate_xml(self, stream): from calibre.ebooks.rtf2xml.ParseRtf import ParseRtf - debug_dir = getattr(self.opts, 'debug_pipeline', None) + ofile = 'dataxml.xml' run_lev = 1 - if debug_dir is not None: + if hasattr(self.opts, 'debug_pipeline'): try: - debug_dir = os.path.normpath('rtfdebug/') + debug_dir = 'rtfdebug' os.mkdir(debug_dir) run_lev = 4 except OSError, ( errno, strerror ): print strerror print errno debug_dir = None - ofile = 'dataxml.xml' + else: + debug_dir = None parser = ParseRtf( in_file = stream, out_file = ofile,