2005-10-02 Tzanko Matev * testtools.py: Added some tools for automatic testing of functions. See the documentation of testtools.reverse_verifier for more info and Sheet.InsertCell for an example of how to use them. Also fixed a small bug in the xxxNotebookViewPlugin.Close() methods of all plugins which was found when I added the verification to InsertCell * tutorial.pybk: Changed the tutorial to an ordinary notebook and added some more text. The old tutorial is in old_tutorial.pybk. I did this because the old tutorial was too confusing for novice users (as Robert pointed out). 2005-09-19 Robert Kern * IPythonLog.py (IPythonLog.__init__, displayhook, __run): Restored output cache and input history functionality via the In and Out variables. 2005-09-18 Tzanko Matev * Sheet.py (Sheet._update_celllist): Fixed two bugs in the xml to nbshell blocks converter, one of which was ticket #36 2005-09-17 Tzanko Matev * Sheet.py (Sheet._update_celllist): * PythonPlugin.py (PythonPluginFactory.get_matchers): * FigurePlugin.py (FigurePluginFactory.get_matchers): * textplugin.py (TextPluginFactory.get_matchers): * PlainTextPlugin.py (PlainTextPluginFactory.get_matchers): Rewrote the algorithm for converting a ElementTree structure to a list of nbshell blocks. Now each plugin must give a method which decides if a given element must be handled by that plugin. As a result this part of the sheet is now independant of the specific plugins (except for the raw xml plugin). Also adding complex tests for parts of the xml tree is much easier than before. The text plugin now matches only elements with no subelements which fixes ticket #34 * ipnNotebookWidget.py (CellCtrlBase.OnKeyDown): Fixed an indentation bug where the given method was considered a function in another method 2005-09-13 Tzanko Matev * editwindow.py (EditWindow.__config): Turned Python lexer off. It caused lagging, and was the reason for the performance issues described in ticket #11. This should solve the problem * IPythonLog.py (IPythonLog.filename_iter): Changed generation of figure names to avoid 'filename.nbk_1.png' names. This resolves ticket #29. * PythonPlugin.py (PythonNotebookViewPlugin): * PythonWidget.py (Shell.OnKeyDown): Added history. The user can access it using Ctrl-Up/Alt-P, Ctrl-Down/Alt-N. This resolves ticket #12. * PythonPlugin.py (PythonNotebookView.Update, PromptLen, CanEdit): Added a variable self.promptlens, which contains the lenghts of the prompts and is generated when Update is called. This slightly optimizes PromptLen and CanEdit. Added other small optimisations to CanEdit. As a result typing should get a bit faster. See ticket #11 for more info. 2005-09-12 Tzanko Matev * nbdoc/notebook.py (Notebook.__init__): Changed to support multiple logs in a document * nbshell/Sheet.py (Sheet.InsertXML): * nbshell/frame.py (ipnFrame.SetUpMenu, ipnFrame.OnInsertXML): Added a way to insert xml editing controls, using the Insert menu. An xml editing control has a red margin. * nbshell/frame.py (ipnFrame.SetUpMenu): Changed terminology in menu items and status lins messages, "cell" is replaced with "block" * tutorial.pybk: Started making a tutorial. It shows how you can use the __app object in the log namespace to make the notebooks more dynamic. 2005-09-12 Tzanko Matev * Sheet.py (Sheet.__update_celllist): Fixed a bug where a text window would not be created if the list of elements was at the end of the document * textplugin.py (TextDocumentPlugin.get_xml_text): Fixed escaping of the test string. * PlainTextPlugin.py (PlainTextCtrl.__init__): Changed the colour of the margin to pale red. Windows of this type cannot be created by nbshell interface at the moment, however they will be shown if a tag in the notebook document is unsupported. 2005-09-12 Tzanko Matev * textplugin.py: * Main.py (App.RegisterPlugins): Added a text plugin which converts plain text to a list of elements in the xml code. It is used instead of the old plaintext plugin, which will soon be renamed. This resolves ticket #9 * Sheet.py (Sheet.UpdateDoc): * PlainTextPlugin.py (PlainTextDocumentPlugin.get_xml_text): * PythonPlugin.py (PythonDocumentPlugin.get_xml_text): * FigurePlugin.py (FigureDocumentPlugin.get_xml_text): * textplugin.py (TextDocumentPlugin.get_xml_text): Moved the code that generates xml from plugin data to the plugins. Sheet.UpdateDoc does not depend on the specific plugins anymore. * Sheet.py (Sheet.__update_celllist): Changed to create instance of the new text plugin when encounters a list of elements in a sheet * Sheet.py (Sheet.InsertText): Changed method to create an instance ot the new text plugin 2005-09-11 Tzanko Matev * nbshell/frame.py (ipnFrame.__init__): Moved printing initialization to ipnFrame.OnPrint to avoid a strange warning message python gave me * nbshell/IPythonLog.py (IPythonLog.__init__): * nbshell/Main.py: Moved the code that sets the excepthook to Main.py. * IPython/tzanko/Shell.py (IPShellGUI.runlines): Also fixed runlines to restore genutils.Term when done, because FormattedTB uses it. * nbshell/PythonPlugin.py (PythonNotebookViewPlugin.InsertLineBreak): Fixed a bug where an additional newline would be added if the current line was empty. * nbshell/PythonPlugin.py (PythonNotebookViewPlugin.Copy): Changed behaviour. Now a codetext object (text of cells without the prompts) is always created and is used when user tries to paste within a cell. This mostly fixes ticket #13 but now there is no direct way to paste a list of cells after the last cell. I wanted to fix this by adding an additional empty line after the last cell, but this introduced more problems than it solved. For the moment, I'll consider the ticket closed. * nbshell/utils.py: Added functions delta_time() and reset_timer() which can be used for very simple profiling. I use them in Main to see how fast nbshell loads. * nbshell/Sheet.py: * nbshell/ipnDocument.py: Deleted some unnecessary code and changed Sheet.Clear() a little, which slightly decreased loading time. * IPython/tzanko/genutils.py (IOStream.write): Managed to reach code which noone has run before in write(), and found and fixed a small bug there. 2005-09-10 Robert Kern * README: * ez_setup.py: * setup.py: Removed ez_setup stuff. 2005-09-10 Tzanko Matev * nbdoc/notebook.py (Notebook.default_sheet): Changed behaviour so it doesn't put the zero cell in the default sheet. * nbshell/IPythonLog.py (IPythonLog.__init__): Reverted Fernando's changes about the In[0] cell. We need to allow the user to choose if they need plotting turned on, and which library to use by default, maybe through an additional File->New menu. Also we should store the default settings in a configuration file. But the actual initialization code must be in the notebook. * nbshell/PythonPlugin.py (PythonNotebookViewPlugin.Update): Reverted part of Fernando's changes and added a comment why the strange code was needed. 2005-09-10 Fernando Perez * nbshell/plotting_backends/matplotlib_backend.py (PlotLibraryInterface.grab_png): Added dpi and number options to grab_png and grab_figure. * nbshell/PythonPlugin.py (PythonNotebookViewPlugin.Update): Removed code which was causing the spurious newline problem. I cut out a whole section which seemed a no-op to me. Tzanko: please double check that I didn't screw up (I'm just starting to learn the code). 2005-09-09 Fernando Perez * nbshell/PythonPlugin.py (PythonNotebookViewPlugin.__init__): Set the in/out prompt templates to an instance variable. Eventually we'll need to support the dynamic ipython prompts, but only once they've been abstracted out from their current tangled mess. At least now this gives slightly cleaner code which is consistent with previous (default) ipython. * nbshell/IPythonLog.py (IPythonLog.__init__): Added a formatted traceback printer into sys.excepthook for easier debugging. Removed the In[0] cell with the visible mpl hack, now that hack is tucked inside. We'll need to clean this up later, once we support ipython profiles (matplotlib should NOT be a dependency, in case people want to use this for non-plotting work). 09.07.2005: * Fixed a bug in copy/paste according to ticket #13 * Deleted help message in the beginning (ticket #16) 09.05.2005: * Added status bar * Fixed a bug in grab_figure which threw an exception when called without an active figure * Now stdout and stderr are also wrapped as the output. Before when one of these were too long, the window displaying the block would not change its size properly so scrolling inside a block would occur. As a result parts of the text would be hidden. * Fixed a bug that the caret would not show automatically when a document is created or loaded * Fixed a bug in scrolling, the current line would be partially hidden if at the bottom at the window * Changed genutils.shell in IPython to put the output of a command in sys.stdout and sys.stderr 08.30.2005: * Added copy/pasting. Currently you can only make selections inside one block. * Added cutting and deleting parts of a cell and a list of cells inside a block 08.26.2005: * Added advanced reexecution of cells. Use the new NBShell->Rerun menu. 08.25.2005 * Added printing support * Added support for exporting notebooks using nbdoc * Ctrl-Enter now reruns the current cell and all cells after it 08.22.2005 * Changed NewCell to Cell to match the cleanup in nbdoc --antont * Fixed some UI glitches * Added a CellCtrlBase class which will be a base class for all controlls used for displaying parts of the notebook * Added mouse wheel support * Added proper support for deleting characters in a Python code block using the Delete and Backspace keys 08.18.2005: * Fixed a bug in DeleteCell * Changed nbshell to use the NewCell class in nbdoc 08.17.2005: * Added tests for deleting and inserting blocks * Fixed some bugs 08.16.2005: * Added deletion of cells * Added some testing framework and one test * Added some methods for testing the notebook format 08.13.2005: * Changed format of notebook files. Now nbshell supports the docbook format. * Refactored methods for inserting cells in the notebook and added UI to use them 08.10.2005: * Added a type variable in each XXXDocumnetPlugin class the current types are 'python', 'plaintext' and 'figure' * Added a property currentcell in the sheet, whichs points to the active cell, and a property position in the python and plaintext plugins which returns the current position in the plugin. * Fixed a bug where the last input disappears after a save * Changed bahaviour. Now the cell with number 0 contains code which should not be displayed on the sheet. However the default_sheet method in notabene.notebook.Notebook does display this cell on the sheet. * Added support for the Matplotlib plotting library. Currently a function grab_figure(caption=None) is exposed in the user namespace which will get the current figure and place it after the input cell where grab_figure() was called. Check figuretest.nbk in the tests dirrectory. The API for adding other plotting libraries is not yet ready. 08.07.2005: * Added support for insertion of cells. Now when you are in a text cell and press Ctrl-I a code cell will be inserted at the place of the cursor. When in a code cell, a text cell is inserted * Fixed selection in code cells. Now only whole elements can be selected. * Added last inputs. Now for each log there is a cell with empty input which is displayed in the sheet.This cell always has the largest number in the log. It is added after the nbk file is loaded and removed before it is saved. It is used to append code to the log. * Added support for figures in the sheet. * Added directory tests for test notebooks 08.01.2005: * Changed behaviour to suport multiline inputs. Now when the user presses Enter, we simply insert a new line at the place of the cursor. Input is executed when the user presses Shift-Enter * Added support for editing and execution of arbitrary input cells. 07.31.2005: * Changed PythonPlugin to support the format of elements in * Changed the algorithm by which outputs are displayed after a cell is rerun