New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored and improved Qt console's HTML export facility #281
Conversation
When saving to HTML with inline png images from the Pyside version, I get: Traceback (most recent call last): File "/home/fperez/ipython/ipython/IPython/frontend/qt/rich_text.py", line 115, in export title = self.window().windowTitle() AttributeError: 'HtmlExporter' object has no attribute 'window' Do you know what this is? |
I fixed the immediate problem, which I hadn't encountered because my exports weren't failing. It seems to be working on both PySide and PyQt4; I had to manually raise an exception for this code path to be exercised. This means that there is potentially some other problem behind your error. In any case, now you should be able to see what it is. |
Hi Evan, now I get this message: Error exporting HTML to /home/fperez/tmp/junk/ipython2.html 'PySide.QtGui.QImage' object has no attribute 'toPyObject' but in a popup dialog box whose title is "Error". The saved file is created but with 0 size. The session only had this in two cells: #1 plot(rand(100)) #2 for i in range(10): print i, and I requested inline png images. The session had been started with '--pylab inline'. I'm running pyside from trunk, with the most recent commit I have being: commit c3d180fdc269183cb4f46ee773bb8521f283bff0 Author: Renato Araujo Oliveira Filho Date: Thu Feb 10 14:01:59 2011 -0300 Created unit test for bug #671. I'm leaving now for the SIAM conference, so I will likely not be able to do much testing until next weekend, unfortunately, but I'll try. |
I'm not sure how I missed this, but thanks for your thoroughness Fernando. It should work now. |
# Imports | ||
#----------------------------------------------------------------------------- | ||
|
||
from __future__ import with_statement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import isn't necessary anymore: we depend on python >= 2.6, so the with statement is always available to us.
Very minor fixes (see my comments inline). Once you address those easy ones, merge away. And thanks for the good work! Sorry for the delayed review, last week's travels did a number on my schedule. |
Hello, Is there a way to use the export as HTML + base64 png facilities from a script? I would like to run the script from the command line, to make it generate ex script.py: import ??? ex usage: python ./myscript.py then I see a report.html in that folder... (I guess what I want is a %run that outputs to HTML) Ivan |
In an effort to reduce the size of ConsoleWidget, which has grown to behemoth proportions, I have moved most of the HTML exportation code into a separate file. Specifically, I have: