pycrust-cvs Mailing List for PyCrust
Brought to you by:
pobrien
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(49) |
Apr
(45) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <po...@us...> - 2003-04-08 04:07:08
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv28548 Modified Files: editor.py Log Message: event.Skip() Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** editor.py 7 Apr 2003 22:45:07 -0000 1.27 --- editor.py 8 Apr 2003 04:07:05 -0000 1.28 *************** *** 116,120 **** interp = interpreter.Interpreter(locals={}) self.editor = Editor(interp=interp, parent=self, filename=filename) - self.editor.SetSize(self.GetClientSize()) # Hack for MS Windows. self._buffer = self.editor.buffer self._buffers[self._buffer.id] = self._buffer --- 116,119 ---- *************** *** 252,256 **** self._buffers[self._buffer.id] = self._buffer self._buffer.editor.SetFocus() - self.crust.Show() # Hack for MS Windows. def _bufferChange(self, buffer): --- 251,254 ---- *************** *** 293,297 **** """Destroy the current buffer.""" selection = self._notebook.GetSelection() ! print "Destroy Selection:", selection if selection > 0: # Don't destroy the PyCrust tab. if self._buffer: --- 291,295 ---- """Destroy the current buffer.""" selection = self._notebook.GetSelection() ! ## print "Destroy Selection:", selection if selection > 0: # Don't destroy the PyCrust tab. if self._buffer: *************** *** 329,353 **** def OnPageChanging(self, event): """Page changing event handler.""" ! ## old = event.GetOldSelection() ! ## print "Changing:", old ! ## if old > -1: ! ## oldpage = self.GetPage(old) ! ## oldpage.Hide() ! ## print "Hiding:", old ! if wx.wxPlatform == '__WXMSW__': ! for n in range(self.GetPageCount()): ! page = self.GetPage(n) ! ## print "Hiding:", n ! page.Hide() def OnPageChanged(self, event): """Page changed event handler.""" new = event.GetSelection() ! ## print "Changed To Selection:", new page = self.GetPage(new) - page.Show() buffer = page.buffer buffer.editor.SetFocus() dispatcher.send(signal='BufferChange', sender=self, buffer=buffer) --- 327,347 ---- def OnPageChanging(self, event): """Page changing event handler.""" ! ## old = event.GetOldSelection() ! ## print "Changing from old:", old ! ## new = event.GetOldSelection() ! ## print "Changing to new:", new ! event.Skip() def OnPageChanged(self, event): """Page changed event handler.""" + ## old = event.GetOldSelection() + ## print "Changed from:", old new = event.GetSelection() ! ## print "Changed to new:", new page = self.GetPage(new) buffer = page.buffer buffer.editor.SetFocus() dispatcher.send(signal='BufferChange', sender=self, buffer=buffer) + event.Skip() *************** *** 468,478 **** def OnPageChanged(self, event): """Page changed event handler.""" ! selection = event.GetSelection() ! print "Changed To Selection:", selection ! page = self.GetPage(selection) buffer = page.buffer subselection = page.GetSelection() page.focus(subselection) dispatcher.send(signal='BufferChange', sender=self, buffer=buffer) --- 462,475 ---- def OnPageChanged(self, event): """Page changed event handler.""" ! ## old = event.GetOldSelection() ! ## print "Changed from old:", old ! new = event.GetSelection() ! ## print "Changed to new:", new ! page = self.GetPage(new) buffer = page.buffer subselection = page.GetSelection() page.focus(subselection) dispatcher.send(signal='BufferChange', sender=self, buffer=buffer) + event.Skip() *************** *** 517,520 **** --- 514,518 ---- selection = event.GetSelection() self.focus(selection) + event.Skip() def focus(self, selection): |
From: <po...@us...> - 2003-04-07 22:45:15
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv26633 Modified Files: editor.py Log Message: Fixed OnClose and bufferSuggestSave. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** editor.py 7 Apr 2003 18:35:14 -0000 1.26 --- editor.py 7 Apr 2003 22:45:07 -0000 1.27 *************** *** 59,62 **** --- 59,63 ---- """Event handler for closing.""" for buffer in self._buffers.values(): + self._buffer = buffer if buffer.hasChanged(): cancel = self.bufferSuggestSave() *************** *** 198,203 **** """Suggest saving changes. Return True if user selected Cancel.""" result = messageDialog(parent=None, ! message='The current file has changed.\n' ! 'Would you like to save it first?', title='Save current file?') if result.positive: --- 199,205 ---- """Suggest saving changes. Return True if user selected Cancel.""" result = messageDialog(parent=None, ! message='%s has changed.\n' ! 'Would you like to save it first' ! '?' % self._buffer.name, title='Save current file?') if result.positive: |
From: <po...@us...> - 2003-04-07 22:28:01
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv20300 Modified Files: filling.py Log Message: Minor tweak to sash position. Index: filling.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/filling.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** filling.py 7 Apr 2003 22:15:13 -0000 1.57 --- filling.py 7 Apr 2003 22:27:55 -0000 1.58 *************** *** 291,295 **** static=static) self.text = FillingText(parent=self, static=static) ! self.SplitVertically(self.tree, self.text, 200) self.SetMinimumPaneSize(1) # Override the filling so that descriptions go to FillingText. --- 291,295 ---- static=static) self.text = FillingText(parent=self, static=static) ! self.SplitVertically(self.tree, self.text, 130) self.SetMinimumPaneSize(1) # Override the filling so that descriptions go to FillingText. |
From: <po...@us...> - 2003-04-07 22:15:18
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv14693 Modified Files: filling.py Log Message: Minor tweak with None object Index: filling.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/filling.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** filling.py 1 Apr 2003 00:09:06 -0000 1.56 --- filling.py 7 Apr 2003 22:15:13 -0000 1.57 *************** *** 167,172 **** self.setText('') obj = self.GetPyData(item) ! if obj is None: # Windows bug fix. ! return self.SetItemHasChildren(item, self.objHasChildren(obj)) otype = type(obj) --- 167,173 ---- self.setText('') obj = self.GetPyData(item) ! if wx.wxPlatform == '__WXMSW__': ! if obj is None: # Windows bug fix. ! return self.SetItemHasChildren(item, self.objHasChildren(obj)) otype = type(obj) |
From: <po...@us...> - 2003-04-07 18:35:19
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv32374 Modified Files: editor.py Log Message: Forgot those self.Layouts were in there. They didn't help. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** editor.py 7 Apr 2003 18:18:45 -0000 1.25 --- editor.py 7 Apr 2003 18:35:14 -0000 1.26 *************** *** 119,123 **** self._buffers[self._buffer.id] = self._buffer self._buffer.editor.SetFocus() - self.Layout() def bufferDestroy(self): --- 119,122 ---- *************** *** 288,292 **** select=True) self._buffer.editor.SetFocus() - self.Layout() def bufferDestroy(self): --- 287,290 ---- |
From: <po...@us...> - 2003-04-07 18:18:55
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv23278 Modified Files: editor.py Log Message: Don't destroy the PyCrust tab. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** editor.py 7 Apr 2003 18:15:46 -0000 1.24 --- editor.py 7 Apr 2003 18:18:45 -0000 1.25 *************** *** 294,298 **** selection = self._notebook.GetSelection() print "Destroy Selection:", selection ! if selection > -1: if self._buffer: del self._buffers[self._buffer.id] --- 294,298 ---- selection = self._notebook.GetSelection() print "Destroy Selection:", selection ! if selection > 0: # Don't destroy the PyCrust tab. if self._buffer: del self._buffers[self._buffer.id] |
From: <po...@us...> - 2003-04-07 18:15:51
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv21789 Modified Files: editor.py Log Message: Keep the MSW hacks to themselves since they mess up Gtk. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** editor.py 7 Apr 2003 17:56:31 -0000 1.23 --- editor.py 7 Apr 2003 18:15:46 -0000 1.24 *************** *** 119,122 **** --- 119,123 ---- self._buffers[self._buffer.id] = self._buffer self._buffer.editor.SetFocus() + self.Layout() def bufferDestroy(self): *************** *** 287,290 **** --- 288,292 ---- select=True) self._buffer.editor.SetFocus() + self.Layout() def bufferDestroy(self): *************** *** 333,340 **** ## oldpage.Hide() ## print "Hiding:", old ! for n in range(self.GetPageCount()): ! page = self.GetPage(n) ! ## print "Hiding:", n ! page.Hide() def OnPageChanged(self, event): --- 335,343 ---- ## oldpage.Hide() ## print "Hiding:", old ! if wx.wxPlatform == '__WXMSW__': ! for n in range(self.GetPageCount()): ! page = self.GetPage(n) ! ## print "Hiding:", n ! page.Hide() def OnPageChanged(self, event): |
From: <po...@us...> - 2003-04-07 17:56:37
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv12463 Modified Files: editor.py Log Message: Windows bug fix hacks. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** editor.py 6 Apr 2003 04:29:43 -0000 1.22 --- editor.py 7 Apr 2003 17:56:31 -0000 1.23 *************** *** 115,118 **** --- 115,119 ---- interp = interpreter.Interpreter(locals={}) self.editor = Editor(interp=interp, parent=self, filename=filename) + self.editor.SetSize(self.GetClientSize()) # Hack for MS Windows. self._buffer = self.editor.buffer self._buffers[self._buffer.id] = self._buffer *************** *** 249,252 **** --- 250,254 ---- self._buffers[self._buffer.id] = self._buffer self._buffer.editor.SetFocus() + self.crust.Show() # Hack for MS Windows. def _bufferChange(self, buffer): *************** *** 288,297 **** def bufferDestroy(self): """Destroy the current buffer.""" - if self._buffer: - del self._buffers[self._buffer.id] - self._buffer = None # Do this before DeletePage(). selection = self._notebook.GetSelection() print "Destroy Selection:", selection ! self._notebook.DeletePage(selection) def bufferNew(self): --- 290,300 ---- def bufferDestroy(self): """Destroy the current buffer.""" selection = self._notebook.GetSelection() print "Destroy Selection:", selection ! if selection > -1: ! if self._buffer: ! del self._buffers[self._buffer.id] ! self._buffer = None # Do this before DeletePage(). ! self._notebook.DeletePage(selection) def bufferNew(self): *************** *** 319,329 **** """Create a BufferNotebook instance.""" wx.wxNotebook.__init__(self, parent, id=-1) wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) def OnPageChanged(self, event): """Page changed event handler.""" ! selection = event.GetSelection() ! print "Changed To Selection:", selection ! page = self.GetPage(selection) buffer = page.buffer buffer.editor.SetFocus() --- 322,347 ---- """Create a BufferNotebook instance.""" wx.wxNotebook.__init__(self, parent, id=-1) + wx.EVT_NOTEBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging) wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) + def OnPageChanging(self, event): + """Page changing event handler.""" + ## old = event.GetOldSelection() + ## print "Changing:", old + ## if old > -1: + ## oldpage = self.GetPage(old) + ## oldpage.Hide() + ## print "Hiding:", old + for n in range(self.GetPageCount()): + page = self.GetPage(n) + ## print "Hiding:", n + page.Hide() + def OnPageChanged(self, event): """Page changed event handler.""" ! new = event.GetSelection() ! ## print "Changed To Selection:", new ! page = self.GetPage(new) ! page.Show() buffer = page.buffer buffer.editor.SetFocus() |
From: <po...@us...> - 2003-04-06 04:29:49
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv7864 Modified Files: editor.py Log Message: Make the first tab a PyCrust session. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** editor.py 5 Apr 2003 02:22:41 -0000 1.21 --- editor.py 6 Apr 2003 04:29:43 -0000 1.22 *************** *** 9,16 **** --- 9,18 ---- import base import buffer + import crust import dispatcher import frame import interpreter import shell + import version try: *************** *** 25,29 **** def __init__(self, parent=None, id=-1, title='PyAlaCarte', ! pos=wx.wxDefaultPosition, size=(600, 400), style=wx.wxDEFAULT_FRAME_STYLE, filename=None): """Create an EditorFrame instance.""" --- 27,31 ---- def __init__(self, parent=None, id=-1, title='PyAlaCarte', ! pos=wx.wxDefaultPosition, size=(800, 600), style=wx.wxDEFAULT_FRAME_STYLE, filename=None): """Create an EditorFrame instance.""" *************** *** 36,40 **** wx.EVT_IDLE(self, self.OnIdle) self._setup() ! self.bufferCreate(filename) def _setup(self): --- 38,43 ---- wx.EVT_IDLE(self, self.OnIdle) self._setup() ! if filename: ! self.bufferCreate(filename) def _setup(self): *************** *** 215,219 **** def __init__(self, parent=None, id=-1, title='PyAlaMode', ! pos=wx.wxDefaultPosition, size=(600, 400), style=wx.wxDEFAULT_FRAME_STYLE, filename=None): """Create an EditorNotebookFrame instance.""" --- 218,222 ---- def __init__(self, parent=None, id=-1, title='PyAlaMode', ! pos=wx.wxDefaultPosition, size=(800, 600), style=wx.wxDEFAULT_FRAME_STYLE, filename=None): """Create an EditorNotebookFrame instance.""" *************** *** 228,231 **** --- 231,252 ---- dispatcher.connect(receiver=self._bufferChange, signal='BufferChange', sender=self._notebook) + intro = 'PyCrust %s' % version.VERSION + import imp + module = imp.new_module('__main__') + import __builtin__ + module.__dict__['__builtins__'] = __builtin__ + namespace = module.__dict__.copy() + self.crust = crust.Crust(parent=self._notebook, intro=intro, locals=namespace) + self.shell = self.crust.shell + # Override the filling so that status messages go to the status bar. + self.crust.filling.tree.setStatusText = self.SetStatusText + # Override the shell so that status messages go to the status bar. + self.shell.setStatusText = self.SetStatusText + # Fix a problem with the sash shrinking to nothing. + self.crust.filling.SetSashPosition(200) + self._notebook.AddPage(page=self.crust, text='PyCrust', select=True) + self._buffer = self.crust.buffer + self._buffers[self._buffer.id] = self._buffer + self._buffer.editor.SetFocus() def _bufferChange(self, buffer): *************** *** 492,496 **** """Create a Editor instance.""" base.Editor.__init__(self, parent, id, pos, size, style) - self.confirmed = False self.interp = interp # Find out for which keycodes the interpreter will autocomplete. --- 513,516 ---- |
From: <po...@us...> - 2003-04-06 04:27:44
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv7549 Modified Files: buffer.py Log Message: Minor tweak. Index: buffer.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/buffer.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** buffer.py 4 Apr 2003 04:25:23 -0000 1.3 --- buffer.py 6 Apr 2003 04:27:40 -0000 1.4 *************** *** 124,128 **** code = self.editor.GetText() module = imp.new_module(str(self.modulename)) ! namespace = module.__dict__ try: try: --- 124,128 ---- code = self.editor.GetText() module = imp.new_module(str(self.modulename)) ! namespace = module.__dict__.copy() try: try: *************** *** 132,136 **** return False else: ! self.interp.locals = namespace.copy() return True finally: --- 132,136 ---- return False else: ! self.interp.locals = namespace return True finally: |
From: <po...@us...> - 2003-04-06 04:26:28
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv7387 Modified Files: crust.py Log Message: Convenience pointer to buffer so crust can be used in PyAlaMode. Index: crust.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/crust.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** crust.py 4 Apr 2003 04:23:52 -0000 1.38 --- crust.py 6 Apr 2003 04:26:25 -0000 1.39 *************** *** 39,42 **** --- 39,43 ---- locals=locals, InterpClass=InterpClass, *args, **kwds) + self.buffer = self.shell.buffer if rootObject is None: rootObject = self.shell.interp.locals |
From: <po...@us...> - 2003-04-06 04:25:02
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv7132 Modified Files: __init__.py Log Message: Import all the basic modules in the package. Index: __init__.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/__init__.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** __init__.py 3 Aug 2001 20:30:37 -0000 1.1.1.1 --- __init__.py 6 Apr 2003 04:24:58 -0000 1.2 *************** *** 1 **** ! # Orbtech python package. \ No newline at end of file --- 1,20 ---- ! """Python package.""" ! ! __author__ = "Patrick K. O'Brien <po...@or...>" ! __cvsid__ = "$Id$" ! __revision__ = "$Revision$"[11:-2] ! ! import base ! import buffer ! import crust ! import dispatcher ! import document ! import editor ! import filling ! import frame ! import images ! import interpreter ! import introspect ! import pseudo ! import shell ! import version |
From: <po...@us...> - 2003-04-05 21:49:57
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv472 Modified Files: shell.py Log Message: Removed a wart. Index: shell.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/shell.py,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** shell.py 4 Apr 2003 04:23:52 -0000 1.121 --- shell.py 5 Apr 2003 21:49:53 -0000 1.122 *************** *** 20,23 **** --- 20,24 ---- import base + import buffer import dispatcher import frame *************** *** 83,103 **** def __init__(self, other): """Create a ShellFacade instance.""" - methods = [ - 'about', - 'ask', - 'clear', - 'pause', - 'prompt', - 'quit', - 'redirectStderr', - 'redirectStdin', - 'redirectStdout', - 'run', - 'runfile', - 'wrap', - 'zoom', - ] - for method in methods: - self.__dict__[method] = getattr(other, method) d = self.__dict__ d['other'] = other --- 84,87 ---- *************** *** 148,158 **** def _getAttributeNames(self): """Return list of magic attributes to extend introspection.""" ! list = ['autoCallTip', ! 'autoComplete', ! 'autoCompleteCaseInsensitive', ! 'autoCompleteIncludeDouble', ! 'autoCompleteIncludeMagic', ! 'autoCompleteIncludeSingle', ! ] list.sort() return list --- 132,156 ---- def _getAttributeNames(self): """Return list of magic attributes to extend introspection.""" ! list = [ ! 'about', ! 'ask', ! 'autoCallTip', ! 'autoComplete', ! 'autoCompleteCaseInsensitive', ! 'autoCompleteIncludeDouble', ! 'autoCompleteIncludeMagic', ! 'autoCompleteIncludeSingle', ! 'clear', ! 'pause', ! 'prompt', ! 'quit', ! 'redirectStderr', ! 'redirectStdin', ! 'redirectStdout', ! 'run', ! 'runfile', ! 'wrap', ! 'zoom', ! ] list.sort() return list *************** *** 195,198 **** --- 193,199 ---- stderr=PseudoFileErr(self.writeErr), *args, **kwds) + # Set up the buffer. + self.buffer = buffer.Buffer(editor=self, interp=self.interp, + filename=None) # Find out for which keycodes the interpreter will autocomplete. self.autoCompleteKeys = self.interp.getAutoCompleteKeys() |
From: <po...@us...> - 2003-04-05 20:21:02
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv2178 Modified Files: document.py Log Message: Read and write in binary and let wxSTC worry about line endings. Index: document.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/document.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** document.py 3 Apr 2003 02:34:48 -0000 1.1 --- document.py 5 Apr 2003 20:20:55 -0000 1.2 *************** *** 40,44 **** """Write text to file.""" try: ! f = file(self.filepath, 'w') f.write(text) finally: --- 40,44 ---- """Write text to file.""" try: ! f = file(self.filepath, 'wb') f.write(text) finally: |
From: <po...@us...> - 2003-04-05 02:22:45
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv22687 Modified Files: editor.py Log Message: More familiar, one editor per tab interface. No shells at all. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** editor.py 4 Apr 2003 23:20:25 -0000 1.20 --- editor.py 5 Apr 2003 02:22:41 -0000 1.21 *************** *** 212,215 **** --- 212,314 ---- class EditorNotebookFrame(EditorFrame): + """Frame containing one or more editors in a notebook.""" + + def __init__(self, parent=None, id=-1, title='PyAlaMode', + pos=wx.wxDefaultPosition, size=(600, 400), + style=wx.wxDEFAULT_FRAME_STYLE, filename=None): + """Create an EditorNotebookFrame instance.""" + EditorFrame.__init__(self, parent, id, title, pos, + size, style, filename) + + def _setup(self): + """Setup prior to first buffer creation. + + Useful for subclasses.""" + self._notebook = BufferNotebook(parent=self) + dispatcher.connect(receiver=self._bufferChange, + signal='BufferChange', sender=self._notebook) + + def _bufferChange(self, buffer): + """Buffer change signal receiver.""" + self._buffer = buffer + + def OnAbout(self, event): + """Display an About window.""" + title = 'About PyAlaMode' + text = 'Another fine, flaky program.' + dialog = wx.wxMessageDialog(self, text, title, + wx.wxOK | wx.wxICON_INFORMATION) + dialog.ShowModal() + dialog.Destroy() + + def _updateTitle(self): + """Show current title information.""" + title = self.GetTitle() + if self.bufferHasChanged(): + if title.startswith('* '): + pass + else: + self.SetTitle('* ' + title) + else: + if title.startswith('* '): + self.SetTitle(title[2:]) + + def bufferCreate(self, filename=None): + """Create new buffer.""" + interp = interpreter.Interpreter(locals={}) + editor = Editor(interp=interp, parent=self._notebook, + filename=filename) + self._buffer = editor.buffer + self._buffers[self._buffer.id] = self._buffer + self._notebook.AddPage(page=editor, text=self._buffer.name, + select=True) + self._buffer.editor.SetFocus() + + def bufferDestroy(self): + """Destroy the current buffer.""" + if self._buffer: + del self._buffers[self._buffer.id] + self._buffer = None # Do this before DeletePage(). + selection = self._notebook.GetSelection() + print "Destroy Selection:", selection + self._notebook.DeletePage(selection) + + def bufferNew(self): + """Create new buffer.""" + self.bufferCreate() + cancel = False + return cancel + + def bufferOpen(self): + """Open file in buffer.""" + filedir = '' + if self._buffer and self._buffer.doc.filedir: + filedir = self._buffer.doc.filedir + result = openMultiple(directory=filedir) + for path in result.paths: + self.bufferCreate(path) + cancel = False + return cancel + + + class BufferNotebook(wx.wxNotebook): + """A notebook containing a page for each buffer.""" + + def __init__(self, parent): + """Create a BufferNotebook instance.""" + wx.wxNotebook.__init__(self, parent, id=-1) + wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) + + def OnPageChanged(self, event): + """Page changed event handler.""" + selection = event.GetSelection() + print "Changed To Selection:", selection + page = self.GetPage(selection) + buffer = page.buffer + buffer.editor.SetFocus() + dispatcher.send(signal='BufferChange', sender=self, buffer=buffer) + + + class BufferEditorShellNotebookFrame(EditorFrame): """Frame containing one or more editor notebooks.""" *************** *** 218,222 **** style=wx.wxDEFAULT_FRAME_STYLE, filename=None, singlefile=False): ! """Create an EditorNotebookFrame instance.""" self._singlefile = singlefile EditorFrame.__init__(self, parent, id, title, pos, --- 317,321 ---- style=wx.wxDEFAULT_FRAME_STYLE, filename=None, singlefile=False): ! """Create a BufferEditorShellNotebookFrame instance.""" self._singlefile = singlefile EditorFrame.__init__(self, parent, id, title, pos, *************** *** 261,269 **** if self._singlefile: self.bufferDestroy() ! notebook = self._notebook = EditorNotebook(parent=self, ! filename=filename) else: ! notebook = EditorNotebook(parent=self._notebook, ! filename=filename) self._buffer = notebook.buffer if not self._singlefile: --- 360,368 ---- if self._singlefile: self.bufferDestroy() ! notebook = self._notebook = EditorShellNotebook(parent=self, ! filename=filename) else: ! notebook = EditorShellNotebook(parent=self._notebook, ! filename=filename) self._buffer = notebook.buffer if not self._singlefile: *************** *** 317,325 **** ! class BufferNotebook(wx.wxNotebook): """A notebook containing a page for each buffer.""" def __init__(self, parent): ! """Create a BufferNotebook instance.""" wx.wxNotebook.__init__(self, parent, id=-1) wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) --- 416,424 ---- ! class BufferEditorShellNotebook(wx.wxNotebook): """A notebook containing a page for each buffer.""" def __init__(self, parent): ! """Create a BufferEditorShellNotebook instance.""" wx.wxNotebook.__init__(self, parent, id=-1) wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) *************** *** 336,344 **** ! class EditorNotebook(wx.wxNotebook): """A notebook containing an editor page and a shell page.""" def __init__(self, parent, filename=None): ! """Create an EditorNotebook instance.""" wx.wxNotebook.__init__(self, parent, id=-1) usePanels = True --- 435,443 ---- ! class EditorShellNotebook(wx.wxNotebook): """A notebook containing an editor page and a shell page.""" def __init__(self, parent, filename=None): ! """Create an EditorShellNotebook instance.""" wx.wxNotebook.__init__(self, parent, id=-1) usePanels = True |
From: <po...@us...> - 2003-04-04 23:20:29
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv28186 Modified Files: frame.py editor.py Log Message: Veto problem fixed. Index: frame.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/frame.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** frame.py 4 Apr 2003 04:22:46 -0000 1.7 --- frame.py 4 Apr 2003 23:20:25 -0000 1.8 *************** *** 219,223 **** def OnExit(self, event): ! self.Close(True) def OnUndo(self, event): --- 219,223 ---- def OnExit(self, event): ! self.Close(False) def OnUndo(self, event): Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** editor.py 4 Apr 2003 22:20:35 -0000 1.19 --- editor.py 4 Apr 2003 23:20:25 -0000 1.20 *************** *** 55,59 **** def OnClose(self, event): """Event handler for closing.""" - print "CanVeto:", event.CanVeto() for buffer in self._buffers.values(): if buffer.hasChanged(): --- 55,58 ---- |
From: <po...@us...> - 2003-04-04 22:20:42
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv30013 Modified Files: editor.py Log Message: Debugging tab deletion problem. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** editor.py 4 Apr 2003 21:26:34 -0000 1.18 --- editor.py 4 Apr 2003 22:20:35 -0000 1.19 *************** *** 283,287 **** self._notebook = None else: ! self._notebook.DeletePage(self._notebook.GetSelection()) def bufferNew(self): --- 283,289 ---- self._notebook = None else: ! selection = self._notebook.GetSelection() ! print "Destroy Selection:", selection ! self._notebook.DeletePage(selection) def bufferNew(self): *************** *** 327,331 **** """Page changed event handler.""" selection = event.GetSelection() ! print "Page", selection page = self.GetPage(selection) buffer = page.buffer --- 329,333 ---- """Page changed event handler.""" selection = event.GetSelection() ! print "Changed To Selection:", selection page = self.GetPage(selection) buffer = page.buffer |
From: <po...@us...> - 2003-04-04 21:26:39
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv3961 Modified Files: editor.py Log Message: Trying to debug veto problem. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** editor.py 4 Apr 2003 20:18:00 -0000 1.17 --- editor.py 4 Apr 2003 21:26:34 -0000 1.18 *************** *** 55,58 **** --- 55,59 ---- def OnClose(self, event): """Event handler for closing.""" + print "CanVeto:", event.CanVeto() for buffer in self._buffers.values(): if buffer.hasChanged(): *************** *** 60,63 **** --- 61,65 ---- if cancel and event.CanVeto(): event.Veto() + return self.Destroy() *************** *** 117,126 **** def bufferDestroy(self): """Destroy the current buffer.""" - if self.editor: - self.editor.Destroy() - self.editor = None if self._buffer: del self._buffers[self._buffer.id] self._buffer = None def bufferHasChanged(self): --- 119,128 ---- def bufferDestroy(self): """Destroy the current buffer.""" if self._buffer: del self._buffers[self._buffer.id] self._buffer = None + if self.editor: + self.editor.Destroy() + self.editor = None def bufferHasChanged(self): *************** *** 325,333 **** """Page changed event handler.""" selection = event.GetSelection() page = self.GetPage(selection) buffer = page.buffer dispatcher.send(signal='BufferChange', sender=self, buffer=buffer) - selection = page.GetSelection() - page.focus(selection) --- 327,336 ---- """Page changed event handler.""" selection = event.GetSelection() + print "Page", selection page = self.GetPage(selection) buffer = page.buffer + subselection = page.GetSelection() + page.focus(subselection) dispatcher.send(signal='BufferChange', sender=self, buffer=buffer) |
From: <po...@us...> - 2003-04-04 20:18:10
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv7976 Modified Files: editor.py Log Message: Parent class method is same, so deleted this one. Index: editor.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/editor.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** editor.py 4 Apr 2003 04:28:50 -0000 1.16 --- editor.py 4 Apr 2003 20:18:00 -0000 1.17 *************** *** 244,257 **** dialog.Destroy() - def OnClose(self, event): - """Event handler for closing.""" - for buffer in self._buffers.values(): - if buffer.hasChanged(): - cancel = self.bufferSuggestSave() - if cancel: - if event.CanVeto(): - event.Veto() - self.Destroy() - def _updateTitle(self): """Show current title information.""" --- 244,247 ---- |
From: <po...@us...> - 2003-04-04 16:52:16
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv23939 Modified Files: CHANGES.txt Log Message: Updated Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pycrust/PyCrust/CHANGES.txt,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** CHANGES.txt 3 Apr 2003 15:57:12 -0000 1.31 --- CHANGES.txt 4 Apr 2003 16:52:11 -0000 1.32 *************** *** 20,24 **** Added documentation files: ! * PyCrust.txt (in PyCrust) * wxPython.txt (in PyCrust/wxd) * wx.txt (in wx) --- 20,24 ---- Added documentation files: ! * MANUAL.txt (in PyCrust) * wxPython.txt (in PyCrust/wxd) * wx.txt (in wx) *************** *** 29,32 **** --- 29,38 ---- Major refactoring to support editor and shell from the same base. + Renamed program files: + + * PyCrustApp.py to PyCrust.py + * PyFillingApp.py to PyFilling.py + * PyShellApp.py to PyShell.py + * wrap.py to PyWrap.py |
From: <po...@us...> - 2003-04-04 16:49:31
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv22717 Modified Files: MANUAL.txt Log Message: Minor change. Index: MANUAL.txt =================================================================== RCS file: /cvsroot/pycrust/PyCrust/MANUAL.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MANUAL.txt 4 Apr 2003 15:25:14 -0000 1.1 --- MANUAL.txt 4 Apr 2003 16:49:26 -0000 1.2 *************** *** 71,76 **** PyCrust shell, the local variable ``app`` is assigned to your application instance. In this way you can introspect your entire ! application within the PyCrust shell and the PyCrust namespace viewer. ! And through the use of the PyCrust decorator classes, PyCrust can display wxPython function and method signatures as well as docstrings for the entire wxPython library. --- 71,76 ---- PyCrust shell, the local variable ``app`` is assigned to your application instance. In this way you can introspect your entire ! application within the PyCrust shell and the PyFilling namespace ! viewer. And through the use of the Py decorator classes, PyCrust can display wxPython function and method signatures as well as docstrings for the entire wxPython library. |
From: <po...@us...> - 2003-04-04 16:18:28
|
Update of /cvsroot/pycrust/PyCrust/tests In directory sc8-pr-cvs1:/tmp/cvs-serv10100/tests Modified Files: test_version.py test_pseudo.py test_introspect.py test_interpreter.py Log Message: Changed import to use parent dir. Index: test_version.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/tests/test_version.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_version.py 28 Mar 2002 17:42:41 -0000 1.4 --- test_version.py 4 Apr 2003 16:18:16 -0000 1.5 *************** *** 6,19 **** import unittest ! from PyCrust import version import types """ ! self.fail(msg=None): ! self.failIf(expr, msg=None): ! self.assert_(expr, msg=None): ! self.assertEqual(first, second, msg=None): ! self.assertRaises(excClass, callableObj, *args, **kwargs): """ class ModuleTestCase(unittest.TestCase): --- 6,32 ---- import unittest ! import types + # Import from this module's parent directory. + import os + import sys + sys.path.insert(0, os.pardir) + import version + del sys.path[0] + del sys + del os + + """ ! These unittest methods are preferred: ! ------------------------------------- ! self.assert_(expr, msg=None) ! self.assertEqual(first, second, msg=None) ! self.assertRaises(excClass, callableObj, *args, **kwargs) ! self.fail(msg=None) ! self.failIf(expr, msg=None) """ + class ModuleTestCase(unittest.TestCase): Index: test_pseudo.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/tests/test_pseudo.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_pseudo.py 29 Mar 2002 20:39:51 -0000 1.5 --- test_pseudo.py 4 Apr 2003 16:18:16 -0000 1.6 *************** *** 6,18 **** import unittest ! from PyCrust import pseudo """ ! self.fail(msg=None): ! self.failIf(expr, msg=None): ! self.assert_(expr, msg=None): ! self.assertEqual(first, second, msg=None): ! self.assertRaises(excClass, callableObj, *args, **kwargs): """ class ModuleTestCase(unittest.TestCase): --- 6,30 ---- import unittest ! ! # Import from this module's parent directory. ! import os ! import sys ! sys.path.insert(0, os.pardir) ! import pseudo ! del sys.path[0] ! del sys ! del os ! """ ! These unittest methods are preferred: ! ------------------------------------- ! self.assert_(expr, msg=None) ! self.assertEqual(first, second, msg=None) ! self.assertRaises(excClass, callableObj, *args, **kwargs) ! self.fail(msg=None) ! self.failIf(expr, msg=None) """ + class ModuleTestCase(unittest.TestCase): Index: test_introspect.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/tests/test_introspect.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_introspect.py 21 Mar 2003 05:57:20 -0000 1.24 --- test_introspect.py 4 Apr 2003 16:18:16 -0000 1.25 *************** *** 6,18 **** import unittest ! from PyCrust import introspect """ ! self.fail(msg=None): ! self.failIf(expr, msg=None): ! self.assert_(expr, msg=None): ! self.assertEqual(first, second, msg=None): ! self.assertRaises(excClass, callableObj, *args, **kwargs): """ class ModuleTestCase(unittest.TestCase): --- 6,30 ---- import unittest ! ! # Import from this module's parent directory. ! import os ! import sys ! sys.path.insert(0, os.pardir) ! import introspect ! del sys.path[0] ! del sys ! del os ! """ ! These unittest methods are preferred: ! ------------------------------------- ! self.assert_(expr, msg=None) ! self.assertEqual(first, second, msg=None) ! self.assertRaises(excClass, callableObj, *args, **kwargs) ! self.fail(msg=None) ! self.failIf(expr, msg=None) """ + class ModuleTestCase(unittest.TestCase): Index: test_interpreter.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/tests/test_interpreter.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_interpreter.py 28 Mar 2002 17:42:41 -0000 1.4 --- test_interpreter.py 4 Apr 2003 16:18:17 -0000 1.5 *************** *** 6,18 **** import unittest ! from PyCrust import interpreter """ ! self.fail(msg=None): ! self.failIf(expr, msg=None): ! self.assert_(expr, msg=None): ! self.assertEqual(first, second, msg=None): ! self.assertRaises(excClass, callableObj, *args, **kwargs): """ class ModuleTestCase(unittest.TestCase): --- 6,30 ---- import unittest ! ! # Import from this module's parent directory. ! import os ! import sys ! sys.path.insert(0, os.pardir) ! import interpreter ! del sys.path[0] ! del sys ! del os ! """ ! These unittest methods are preferred: ! ------------------------------------- ! self.assert_(expr, msg=None) ! self.assertEqual(first, second, msg=None) ! self.assertRaises(excClass, callableObj, *args, **kwargs) ! self.fail(msg=None) ! self.failIf(expr, msg=None) """ + class ModuleTestCase(unittest.TestCase): |
From: <po...@us...> - 2003-04-04 16:09:37
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv6240 Removed Files: PyCrust.ico Log Message: Renamed --- PyCrust.ico DELETED --- |
From: <po...@us...> - 2003-04-04 16:08:46
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv5762 Added Files: Py.ico Log Message: Renamed --- NEW FILE: Py.ico --- (This appears to be a binary file; contents omitted.) |
From: <po...@us...> - 2003-04-04 15:44:13
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv25872 Removed Files: wrap.py PyShellApp.py PyFillingApp.py PyCrustApp.py PyCrust.txt Log Message: Renamed. --- wrap.py DELETED --- --- PyShellApp.py DELETED --- --- PyFillingApp.py DELETED --- --- PyCrustApp.py DELETED --- --- PyCrust.txt DELETED --- |