credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #05658
[Branch ~credativ/openobject-addons/6.1] Rev 7056: [FIX] Fixed typo in error message, also converted tabs to spaces.
------------------------------------------------------------
revno: 7056
committer: Tom Pickering <tpi@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
branch nick: addons-fixes-6.1
timestamp: Tue 2013-11-26 09:41:41 +0000
message:
[FIX] Fixed typo in error message, also converted tabs to spaces.
modified:
report_webkit/webkit_report.py
--
lp:~credativ/openobject-addons/6.1
https://code.launchpad.net/~credativ/openobject-addons/6.1
Your team credativ is subscribed to branch lp:~credativ/openobject-addons/6.1.
To unsubscribe from this branch go to https://code.launchpad.net/~credativ/openobject-addons/6.1/+edit-subscription
=== modified file 'report_webkit/webkit_report.py'
--- report_webkit/webkit_report.py 2013-11-21 11:32:58 +0000
+++ report_webkit/webkit_report.py 2013-11-26 09:41:41 +0000
@@ -160,20 +160,20 @@
file_to_del.append(html_file.name)
command.append(html_file.name)
command.append(out_filename)
- stderr_fd, stderr_path = tempfile.mkstemp(text=True)
- file_to_del.append(stderr_path)
- try:
+ stderr_fd, stderr_path = tempfile.mkstemp(text=True)
+ file_to_del.append(stderr_path)
+ try:
status = subprocess.call(command, stderr=stderr_fd)
- os.close(stderr_fd) # ensure flush before reading
- stderr_fd = None # avoid closing again in finally block
- fobj = open(stderr_path, 'r')
- error_message = fobj.read()
+ os.close(stderr_fd) # ensure flush before reading
+ stderr_fd = None # avoid closing again in finally block
+ fobj = open(stderr_path, 'r')
+ error_message = fobj.read()
fobj.close()
- if not error_message:
- error_message = _('No diagnosis message was provided')
- else:
- error_message = _('The following diagnosis message was provided:\n') + error_message
- if status :
+ if not error_message:
+ error_message = _('No diagnosis message was provided')
+ else:
+ error_message = _('The following diagnosis message was provided:\n') + error_message
+ if status :
raise except_osv(_('Webkit error' ),
_("The command 'wkhtmltopdf' failed with error code = %s. Message: %s") % (status, error_message))
pdf_file = open(out_filename, 'rb')
@@ -181,14 +181,14 @@
pdf_file.close()
except OSError as exc:
raise except_osv(_('Conversion to PDF failed at the OS level.'),
- _('Please ensure both that wkhtmltopdf is installed on your' \
- ' system (\'sudo apt-get install wkhtmltopdf\' or download from' \
- ' http://code.google.com/p/wkhtmltopdf/downloads/list) and that the' \
+ _('Please ensure both that wkhtmltopdf is installed on your' \
+ ' system (\'sudo apt-get install wkhtmltopdf\' or download from' \
+ ' http://code.google.com/p/wkhtmltopdf/downloads/list) and that' \
' the ir.config_parameter with the key \'webkit_path\' is set as' \
- ' the correct path to wkhtmltopdf.' \
+ ' the correct path to wkhtmltopdf.' \
' Minimal version is 0.9.9.' \
- ' Error code ' + str(exc.errno) + ': ' + exc.strerror
- ))
+ ' Error code ' + str(exc.errno) + ': ' + exc.strerror
+ ))
finally:
if stderr_fd is not None:
os.close(stderr_fd)