# HG changeset patch # User gibus # Date 1359371951 -3600 # Node ID 6b3d72136e850634f85724d53ce816cf12a4720b # Parent 32c402ed2f14a9bb1b52c4d3f585112fc869e77f Use libreoffice to convert html to pdf when abiword crashes. diff -r 32c402ed2f14 -r 6b3d72136e85 src/cm/converters/oo_converters.py --- a/src/cm/converters/oo_converters.py Mon Jan 28 10:44:48 2013 +0100 +++ b/src/cm/converters/oo_converters.py Mon Jan 28 12:19:11 2013 +0100 @@ -75,7 +75,7 @@ processing = 0 # timeout : kill oo -PROCESSING_TIMEOUT = 20.0 +PROCESSING_TIMEOUT = 120.0 def oo_process_controller(code): """ @@ -84,7 +84,7 @@ global processing logging.info('oo_process_controller') if processing == code: - logging.error('--> oo_process_controller : killing !') + logging.error('--> oo_process_controller timeout %s: killing !' %PROCESSING_TIMEOUT) kill_oo() def kill_oo(): diff -r 32c402ed2f14 -r 6b3d72136e85 src/cm/views/export.py --- a/src/cm/views/export.py Mon Jan 28 10:44:48 2013 +0100 +++ b/src/cm/views/export.py Mon Jan 28 12:19:11 2013 +0100 @@ -78,7 +78,13 @@ if USE_ABI: from cm.converters.abi_converters import AbiFileConverter converter = AbiFileConverter() - export_content = converter.convert_from_html(fix_content, format) + try: + export_content = converter.convert_from_html(fix_content, format) + except: + from cm.converters.oo_converters import combine_css_body + fix_content = combine_css_body(content, '') + from cm.converters.oo_converters import convert_html as oo_convert + export_content = oo_convert(fix_content, format) else: from cm.converters.oo_converters import convert_html as oo_convert export_content = oo_convert(fix_content, format)