pycrust-cvs Mailing List for PyCrust (Page 3)
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-03-30 20:47:30
|
Update of /cvsroot/pycrust/PyCrust
In directory sc8-pr-cvs1:/tmp/cvs-serv26726
Modified Files:
shell.py
Log Message:
Show calltip in tab, even when turned off in shell.
Index: shell.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/shell.py,v
retrieving revision 1.118
retrieving revision 1.119
diff -C2 -d -r1.118 -r1.119
*** shell.py 29 Mar 2003 02:42:01 -0000 1.118
--- shell.py 30 Mar 2003 20:47:25 -0000 1.119
***************
*** 328,333 ****
command = self.GetTextRange(stoppos, currpos) + '('
self.write('(')
! if self.autoCallTip:
! self.autoCallTipShow(command)
else:
# Allow the normal event handling to take place.
--- 328,332 ----
command = self.GetTextRange(stoppos, currpos) + '('
self.write('(')
! self.autoCallTipShow(command)
else:
# Allow the normal event handling to take place.
***************
*** 819,822 ****
--- 818,825 ----
self.CallTipCancel()
(name, argspec, tip) = self.interp.getCallTip(command)
+ if tip:
+ dispatcher.send(signal='Shell.calltip', sender=self, calltip=tip)
+ if not self.autoCallTip:
+ return
if argspec:
startpos = self.GetCurrentPos()
***************
*** 831,835 ****
# fallback.
tippos = max(tippos, fallback)
- dispatcher.send(signal='Shell.calltip', sender=self, calltip=tip)
self.CallTipShow(tippos, tip)
--- 834,837 ----
|
|
From: <po...@us...> - 2003-03-29 05:10:20
|
Update of /cvsroot/pycrust/PyCrust
In directory sc8-pr-cvs1:/tmp/cvs-serv22368
Modified Files:
PyAlaMode.py
Log Message:
Minor tweak
Index: PyAlaMode.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/PyAlaMode.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyAlaMode.py 29 Mar 2003 02:42:04 -0000 1.1
--- PyAlaMode.py 29 Mar 2003 05:10:12 -0000 1.2
***************
*** 22,28 ****
"""PyAlaMode standalone application."""
! def __init__(self, flag, filename=None):
self.filename = filename
! wx.App.__init__(self, flag)
def OnInit(self):
--- 22,28 ----
"""PyAlaMode standalone application."""
! def __init__(self, filename=None):
self.filename = filename
! wx.App.__init__(self, redirect=False)
def OnInit(self):
***************
*** 35,39 ****
def main(filename=None):
! app = App(False, filename)
app.MainLoop()
--- 35,39 ----
def main(filename=None):
! app = App(filename)
app.MainLoop()
|
Update of /cvsroot/pycrust/PyCrust
In directory sc8-pr-cvs1:/tmp/cvs-serv5691
Modified Files:
shell.py filling.py crust.py CHANGES.txt
Added Files:
frame.py editor.py base.py PyAlaMode.py
Log Message:
PyAlaMode... Yummm!
--- NEW FILE: frame.py ---
"""Base frame with menu."""
__author__ = "Patrick K. O'Brien <po...@or...>"
__cvsid__ = "$Id: frame.py,v 1.1 2003/03/29 02:42:01 pobrien Exp $"
__revision__ = "$Revision: 1.1 $"[11:-2]
from wxPython import wx
from version import VERSION
try:
True
except NameError:
True = 1==1
False = 1==0
ID_AUTOCOMP = wx.wxNewId()
ID_AUTOCOMP_SHOW = wx.wxNewId()
ID_AUTOCOMP_INCLUDE_MAGIC = wx.wxNewId()
ID_AUTOCOMP_INCLUDE_SINGLE = wx.wxNewId()
ID_AUTOCOMP_INCLUDE_DOUBLE = wx.wxNewId()
ID_CALLTIPS = wx.wxNewId()
ID_CALLTIPS_SHOW = wx.wxNewId()
ID_COPY_PLUS = wx.wxNewId()
ID_PASTE_PLUS = wx.wxNewId()
ID_WRAP = wx.wxNewId()
class Frame(wx.wxFrame):
"""Frame with standard menu items."""
revision = __revision__
def __init__(self, parent=None, id=-1, title='Editor',
pos=wx.wxDefaultPosition, size=wx.wxDefaultSize,
style=wx.wxDEFAULT_FRAME_STYLE):
"""Create a Frame instance."""
wx.wxFrame.__init__(self, parent, id, title, pos, size, style)
self.CreateStatusBar()
self.SetStatusText('Frame')
import images
self.SetIcon(images.getPyCrustIcon())
self.__createMenus()
wx.EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
"""Event handler for closing."""
self.Destroy()
def __createMenus(self):
m = self.fileMenu = wx.wxMenu()
m.AppendSeparator()
m.Append(wx.wxID_EXIT, 'E&xit', 'Exit Program')
m = self.editMenu = wx.wxMenu()
m.Append(wx.wxID_UNDO, '&Undo \tCtrl+Z',
'Undo the last action')
m.Append(wx.wxID_REDO, '&Redo \tCtrl+Y',
'Redo the last undone action')
m.AppendSeparator()
m.Append(wx.wxID_CUT, 'Cu&t \tCtrl+X',
'Cut the selection')
m.Append(wx.wxID_COPY, '&Copy \tCtrl+C',
'Copy the selection')
m.Append(ID_COPY_PLUS, 'Cop&y Plus \tCtrl+Shift+C',
'Copy the selection - retaining prompts')
m.Append(wx.wxID_PASTE, '&Paste \tCtrl+V', 'Paste from clipboard')
m.Append(ID_PASTE_PLUS, 'Past&e Plus \tCtrl+Shift+V',
'Paste and run commands')
m.AppendSeparator()
m.Append(wx.wxID_CLEAR, 'Cle&ar',
'Delete the selection')
m.Append(wx.wxID_SELECTALL, 'Select A&ll \tCtrl+A',
'Select all text')
m = self.autocompMenu = wx.wxMenu()
m.Append(ID_AUTOCOMP_SHOW, 'Show Auto Completion',
'Show auto completion list', 1)
m.Append(ID_AUTOCOMP_INCLUDE_MAGIC, 'Include Magic Attributes',
'Include attributes visible to __getattr__ and __setattr__',
1)
m.Append(ID_AUTOCOMP_INCLUDE_SINGLE, 'Include Single Underscores',
'Include attibutes prefixed by a single underscore', 1)
m.Append(ID_AUTOCOMP_INCLUDE_DOUBLE, 'Include Double Underscores',
'Include attibutes prefixed by a double underscore', 1)
m = self.calltipsMenu = wx.wxMenu()
m.Append(ID_CALLTIPS_SHOW, 'Show Call Tips',
'Show call tips with argument signature and docstring', 1)
m = self.optionsMenu = wx.wxMenu()
m.AppendMenu(ID_AUTOCOMP, '&Auto Completion', self.autocompMenu,
'Auto Completion Options')
m.AppendMenu(ID_CALLTIPS, '&Call Tips', self.calltipsMenu,
'Call Tip Options')
m.Append(ID_WRAP, '&Wrap Lines',
'Wrap lines at right edge', 1)
m = self.helpMenu = wx.wxMenu()
m.AppendSeparator()
m.Append(wx.wxID_ABOUT, '&About...', 'About this program')
b = self.menuBar = wx.wxMenuBar()
b.Append(self.fileMenu, '&File')
b.Append(self.editMenu, '&Edit')
b.Append(self.optionsMenu, '&Options')
b.Append(self.helpMenu, '&Help')
self.SetMenuBar(b)
wx.EVT_MENU(self, wx.wxID_EXIT, self.OnExit)
wx.EVT_MENU(self, wx.wxID_UNDO, self.OnUndo)
wx.EVT_MENU(self, wx.wxID_REDO, self.OnRedo)
wx.EVT_MENU(self, wx.wxID_CUT, self.OnCut)
wx.EVT_MENU(self, wx.wxID_COPY, self.OnCopy)
wx.EVT_MENU(self, ID_COPY_PLUS, self.OnCopyPlus)
wx.EVT_MENU(self, wx.wxID_PASTE, self.OnPaste)
wx.EVT_MENU(self, ID_PASTE_PLUS, self.OnPastePlus)
wx.EVT_MENU(self, wx.wxID_CLEAR, self.OnClear)
wx.EVT_MENU(self, wx.wxID_SELECTALL, self.OnSelectAll)
wx.EVT_MENU(self, wx.wxID_ABOUT, self.OnAbout)
wx.EVT_MENU(self, ID_AUTOCOMP_SHOW,
self.OnAutoCompleteShow)
wx.EVT_MENU(self, ID_AUTOCOMP_INCLUDE_MAGIC,
self.OnAutoCompleteIncludeMagic)
wx.EVT_MENU(self, ID_AUTOCOMP_INCLUDE_SINGLE,
self.OnAutoCompleteIncludeSingle)
wx.EVT_MENU(self, ID_AUTOCOMP_INCLUDE_DOUBLE,
self.OnAutoCompleteIncludeDouble)
wx.EVT_MENU(self, ID_CALLTIPS_SHOW,
self.OnCallTipsShow)
wx.EVT_MENU(self, ID_WRAP, self.OnWrap)
wx.EVT_UPDATE_UI(self, wx.wxID_UNDO, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, wx.wxID_REDO, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, wx.wxID_CUT, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, wx.wxID_COPY, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_COPY_PLUS, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, wx.wxID_PASTE, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_PASTE_PLUS, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, wx.wxID_CLEAR, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, wx.wxID_SELECTALL, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_AUTOCOMP_SHOW, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_AUTOCOMP_INCLUDE_MAGIC, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_AUTOCOMP_INCLUDE_SINGLE, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_AUTOCOMP_INCLUDE_DOUBLE, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_CALLTIPS_SHOW, self.OnUpdateMenu)
wx.EVT_UPDATE_UI(self, ID_WRAP, self.OnUpdateMenu)
def OnExit(self, event):
self.Close(True)
def OnUndo(self, event):
win = wx.wxWindow_FindFocus()
win.Undo()
def OnRedo(self, event):
win = wx.wxWindow_FindFocus()
win.Redo()
def OnCut(self, event):
win = wx.wxWindow_FindFocus()
win.Cut()
def OnCopy(self, event):
win = wx.wxWindow_FindFocus()
win.Copy()
def OnCopyPlus(self, event):
win = wx.wxWindow_FindFocus()
win.CopyWithPrompts()
def OnPaste(self, event):
win = wx.wxWindow_FindFocus()
win.Paste()
def OnPastePlus(self, event):
win = wx.wxWindow_FindFocus()
win.PasteAndRun()
def OnClear(self, event):
win = wx.wxWindow_FindFocus()
win.Clear()
def OnSelectAll(self, event):
win = wx.wxWindow_FindFocus()
win.SelectAll()
def OnAbout(self, event):
"""Display an About window."""
title = 'About'
text = 'Your message here.'
dialog = wx.wxMessageDialog(self, text, title,
wx.wxOK | wx.wxICON_INFORMATION)
dialog.ShowModal()
dialog.Destroy()
def OnAutoCompleteShow(self, event):
win = wx.wxWindow_FindFocus()
win.autoComplete = event.IsChecked()
def OnAutoCompleteIncludeMagic(self, event):
win = wx.wxWindow_FindFocus()
win.autoCompleteIncludeMagic = event.IsChecked()
def OnAutoCompleteIncludeSingle(self, event):
win = wx.wxWindow_FindFocus()
win.autoCompleteIncludeSingle = event.IsChecked()
def OnAutoCompleteIncludeDouble(self, event):
win = wx.wxWindow_FindFocus()
win.autoCompleteIncludeDouble = event.IsChecked()
def OnCallTipsShow(self, event):
win = wx.wxWindow_FindFocus()
win.autoCallTip = event.IsChecked()
def OnWrap(self, event):
win = wx.wxWindow_FindFocus()
win.SetWrapMode(event.IsChecked())
def OnUpdateMenu(self, event):
"""Update menu items based on current status."""
win = wx.wxWindow_FindFocus()
id = event.GetId()
event.Enable(True)
try:
if id == wx.wxID_UNDO:
event.Enable(win.CanUndo())
elif id == wx.wxID_REDO:
event.Enable(win.CanRedo())
elif id == wx.wxID_CUT:
event.Enable(win.CanCut())
elif id == wx.wxID_COPY:
event.Enable(win.CanCopy())
elif id == ID_COPY_PLUS:
event.Enable(win.CanCopy() and hasattr(win, 'CopyWithPrompts'))
elif id == wx.wxID_PASTE:
event.Enable(win.CanPaste())
elif id == ID_PASTE_PLUS:
event.Enable(win.CanPaste() and hasattr(win, 'PasteAndRun'))
elif id == wx.wxID_CLEAR:
event.Enable(win.CanCut())
elif id == wx.wxID_SELECTALL:
event.Enable(hasattr(win, 'SelectAll'))
elif id == ID_AUTOCOMP_SHOW:
event.Check(win.autoComplete)
elif id == ID_AUTOCOMP_INCLUDE_MAGIC:
event.Check(win.autoCompleteIncludeMagic)
elif id == ID_AUTOCOMP_INCLUDE_SINGLE:
event.Check(win.autoCompleteIncludeSingle)
elif id == ID_AUTOCOMP_INCLUDE_DOUBLE:
event.Check(win.autoCompleteIncludeDouble)
elif id == ID_CALLTIPS_SHOW:
event.Check(win.autoCallTip)
elif id == ID_WRAP:
event.Check(win.GetWrapMode())
except AttributeError:
# object with keyboard focus doesn't support this menu option.
event.Enable(False)
--- NEW FILE: base.py ---
"""Base editor."""
__author__ = "Patrick K. O'Brien <po...@or...>"
__cvsid__ = "$Id: base.py,v 1.1 2003/03/29 02:42:04 pobrien Exp $"
__revision__ = "$Revision: 1.1 $"[11:-2]
from wxPython import wx
from wxPython import stc
import keyword
import os
import sys
import time
import dispatcher
from version import VERSION
try:
True
except NameError:
True = 1==1
False = 1==0
if wx.wxPlatform == '__WXMSW__':
FACES = { 'times' : 'Times New Roman',
'mono' : 'Courier New',
'helv' : 'Lucida Console',
'lucida' : 'Lucida Console',
'other' : 'Comic Sans MS',
'size' : 10,
'lnsize' : 9,
'backcol': '#FFFFFF',
}
else: # GTK
FACES = { 'times' : 'Times',
'mono' : 'Courier',
'helv' : 'Helvetica',
'other' : 'new century schoolbook',
'size' : 12,
'lnsize' : 10,
'backcol': '#FFFFFF',
}
class Editor(stc.wxStyledTextCtrl):
"""Editor based on StyledTextCtrl."""
revision = __revision__
def __init__(self, parent, id=-1, pos=wx.wxDefaultPosition,
size=wx.wxDefaultSize, style=wx.wxCLIP_CHILDREN):
"""Create an Editor instance."""
stc.wxStyledTextCtrl.__init__(self, parent, id, pos, size, style)
# Assign handlers for wxSTC events.
stc.EVT_STC_UPDATEUI(self, id, self.OnUpdateUI)
dispatcher.connect(receiver=self._fontsizer, signal='FontIncrease')
dispatcher.connect(receiver=self._fontsizer, signal='FontDecrease')
dispatcher.connect(receiver=self._fontsizer, signal='FontDefault')
# Configure various defaults and user preferences.
self.__config()
def _fontsizer(self, signal):
"""Receiver for Font* signals."""
size = self.GetZoom()
if signal == 'FontIncrease':
size += 1
elif signal == 'FontDecrease':
size -= 1
elif signal == 'FontDefault':
size = 0
self.SetZoom(size)
def __config(self):
"""Configure shell based on user preferences."""
self.SetMarginType(1, stc.wxSTC_MARGIN_NUMBER)
self.SetMarginWidth(1, 40)
self.SetLexer(stc.wxSTC_LEX_PYTHON)
self.SetKeyWords(0, ' '.join(keyword.kwlist))
self.setStyles(FACES)
self.SetViewWhiteSpace(False)
self.SetTabWidth(4)
self.SetUseTabs(False)
# Do we want to automatically pop up command completion options?
self.autoComplete = True
self.autoCompleteIncludeMagic = True
self.autoCompleteIncludeSingle = True
self.autoCompleteIncludeDouble = True
self.autoCompleteCaseInsensitive = True
self.AutoCompSetIgnoreCase(self.autoCompleteCaseInsensitive)
self.AutoCompSetAutoHide(False)
self.AutoCompStops(' .,;:([)]}\'"\\<>%^&+-=*/|`')
# Do we want to automatically pop up command argument help?
self.autoCallTip = True
self.CallTipSetBackground(wx.wxColour(255, 255, 232))
self.SetWrapMode(False)
try:
self.SetEndAtLastLine(False)
except AttributeError:
pass
def setStyles(self, faces):
"""Configure font size, typeface and color for lexer."""
# Default style
self.StyleSetSpec(stc.wxSTC_STYLE_DEFAULT,
"face:%(mono)s,size:%(size)d,back:%(backcol)s" % \
faces)
self.StyleClearAll()
# Built in styles
self.StyleSetSpec(stc.wxSTC_STYLE_LINENUMBER,
"back:#C0C0C0,face:%(mono)s,size:%(lnsize)d" % faces)
self.StyleSetSpec(stc.wxSTC_STYLE_CONTROLCHAR,
"face:%(mono)s" % faces)
self.StyleSetSpec(stc.wxSTC_STYLE_BRACELIGHT,
"fore:#0000FF,back:#FFFF88")
self.StyleSetSpec(stc.wxSTC_STYLE_BRACEBAD,
"fore:#FF0000,back:#FFFF88")
# Python styles
self.StyleSetSpec(stc.wxSTC_P_DEFAULT,
"face:%(mono)s" % faces)
self.StyleSetSpec(stc.wxSTC_P_COMMENTLINE,
"fore:#007F00,face:%(mono)s" % faces)
self.StyleSetSpec(stc.wxSTC_P_NUMBER,
"")
self.StyleSetSpec(stc.wxSTC_P_STRING,
"fore:#7F007F,face:%(mono)s" % faces)
self.StyleSetSpec(stc.wxSTC_P_CHARACTER,
"fore:#7F007F,face:%(mono)s" % faces)
self.StyleSetSpec(stc.wxSTC_P_WORD,
"fore:#00007F,bold")
self.StyleSetSpec(stc.wxSTC_P_TRIPLE,
"fore:#7F0000")
self.StyleSetSpec(stc.wxSTC_P_TRIPLEDOUBLE,
"fore:#000033,back:#FFFFE8")
self.StyleSetSpec(stc.wxSTC_P_CLASSNAME,
"fore:#0000FF,bold")
self.StyleSetSpec(stc.wxSTC_P_DEFNAME,
"fore:#007F7F,bold")
self.StyleSetSpec(stc.wxSTC_P_OPERATOR,
"")
self.StyleSetSpec(stc.wxSTC_P_IDENTIFIER,
"")
self.StyleSetSpec(stc.wxSTC_P_COMMENTBLOCK,
"fore:#7F7F7F")
self.StyleSetSpec(stc.wxSTC_P_STRINGEOL,
"fore:#000000,face:%(mono)s,back:#E0C0E0,eolfilled" % faces)
def OnUpdateUI(self, event):
"""Check for matching braces."""
# If the auto-complete window is up let it do its thing.
if self.AutoCompActive():
return
braceAtCaret = -1
braceOpposite = -1
charBefore = None
caretPos = self.GetCurrentPos()
if caretPos > 0:
charBefore = self.GetCharAt(caretPos - 1)
styleBefore = self.GetStyleAt(caretPos - 1)
# Check before.
if charBefore and chr(charBefore) in '[]{}()' \
and styleBefore == stc.wxSTC_P_OPERATOR:
braceAtCaret = caretPos - 1
# Check after.
if braceAtCaret < 0:
charAfter = self.GetCharAt(caretPos)
styleAfter = self.GetStyleAt(caretPos)
if charAfter and chr(charAfter) in '[]{}()' \
and styleAfter == stc.wxSTC_P_OPERATOR:
braceAtCaret = caretPos
if braceAtCaret >= 0:
braceOpposite = self.BraceMatch(braceAtCaret)
if braceAtCaret != -1 and braceOpposite == -1:
self.BraceBadLight(braceAtCaret)
else:
self.BraceHighlight(braceAtCaret, braceOpposite)
def CanCut(self):
"""Return true if text is selected and can be cut."""
return self.CanCopy()
def CanCopy(self):
"""Return true if text is selected and can be copied."""
return self.GetSelectionStart() != self.GetSelectionEnd()
def CanEdit(self):
"""Return true if editing should succeed."""
return True
## def Cut(self):
## """Remove selection and place it on the clipboard."""
## if self.CanCut() and self.CanCopy():
## if self.AutoCompActive():
## self.AutoCompCancel()
## if self.CallTipActive():
## self.CallTipCancel()
## self.Copy()
## self.ReplaceSelection('')
## def Copy(self):
## """Copy selection and place it on the clipboard."""
## if self.CanCopy():
## ps1 = str(sys.ps1)
## ps2 = str(sys.ps2)
## command = self.GetSelectedText()
## command = command.replace(os.linesep + ps2, os.linesep)
## command = command.replace(os.linesep + ps1, os.linesep)
## command = self.lstripPrompt(text=command)
## data = wx.wxTextDataObject(command)
## self._clip(data)
## def _clip(self, data):
## if wx.wxTheClipboard.Open():
## wx.wxTheClipboard.UsePrimarySelection(False)
## wx.wxTheClipboard.SetData(data)
## wx.wxTheClipboard.Flush()
## wx.wxTheClipboard.Close()
--- NEW FILE: PyAlaMode.py ---
#!/usr/bin/env python
"""PyAlaMode is a programmer's editor."""
__author__ = "Patrick K. O'Brien <po...@or...>"
__cvsid__ = "$Id: PyAlaMode.py,v 1.1 2003/03/29 02:42:04 pobrien Exp $"
__revision__ = "$Revision: 1.1 $"[11:-2]
import os
import sys
import wx
from editor import EditorFrame
try:
True
except NameError:
True = 1==1
False = 1==0
class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, flag, filename=None):
self.filename = filename
wx.App.__init__(self, flag)
def OnInit(self):
wx.InitAllImageHandlers()
self.frame = EditorFrame()
self.frame.FileOpen(self.filename)
self.frame.Show()
self.SetTopWindow(self.frame)
return True
def main(filename=None):
app = App(False, filename)
app.MainLoop()
if __name__ == '__main__':
sys.path.insert(0, os.curdir)
filename = None
if len(sys.argv) > 1:
filename = os.path.realpath(sys.argv[1])
main(filename)
Index: shell.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/shell.py,v
retrieving revision 1.117
retrieving revision 1.118
diff -C2 -d -r1.117 -r1.118
*** shell.py 18 Mar 2003 17:14:35 -0000 1.117
--- shell.py 29 Mar 2003 02:42:01 -0000 1.118
***************
*** 11,38 ****
__revision__ = "$Revision$"[11:-2]
import keyword
import os
import sys
import time
from pseudo import PseudoFileIn
from pseudo import PseudoFileOut
from pseudo import PseudoFileErr
- from shellmenu import ShellMenu
from version import VERSION
- import dispatcher
-
- try:
- import wxd.d_wx
- except ImportError:
- from wxPython import wx
- else:
- from wxd.d_wx import wx
-
- try:
- import wxd.d_stc
- except ImportError:
- from wxPython import stc
- else:
- from wxd.d_stc import stc
try:
--- 11,29 ----
__revision__ = "$Revision$"[11:-2]
+ from wxd.d_wx import wx
+ from wxd.d_stc import stc
+
import keyword
import os
import sys
import time
+
+ import base
+ import dispatcher
+ import frame
from pseudo import PseudoFileIn
from pseudo import PseudoFileOut
from pseudo import PseudoFileErr
from version import VERSION
try:
***************
*** 44,72 ****
sys.ps3 = '<-- ' # Input prompt.
! NAVKEYS = (wx.WXK_END, wx.WXK_LEFT, wx.WXK_RIGHT,
wx.WXK_UP, wx.WXK_DOWN, wx.WXK_PRIOR, wx.WXK_NEXT)
- if wx.wxPlatform == '__WXMSW__':
- faces = { 'times' : 'Times New Roman',
- 'mono' : 'Courier New',
- 'helv' : 'Lucida Console',
- 'lucida' : 'Lucida Console',
- 'other' : 'Comic Sans MS',
- 'size' : 10,
- 'lnsize' : 9,
- 'backcol': '#FFFFFF',
- }
- else: # GTK
- faces = { 'times' : 'Times',
- 'mono' : 'Courier',
- 'helv' : 'Helvetica',
- 'other' : 'new century schoolbook',
- 'size' : 12,
- 'lnsize' : 10,
- 'backcol': '#FFFFFF',
- }
-
! class ShellFrame(wx.wxFrame, ShellMenu):
"""Frame containing the PyCrust shell component."""
--- 35,43 ----
sys.ps3 = '<-- ' # Input prompt.
! NAVKEYS = (wx.WXK_END, wx.WXK_LEFT, wx.WXK_RIGHT,
wx.WXK_UP, wx.WXK_DOWN, wx.WXK_PRIOR, wx.WXK_NEXT)
! class ShellFrame(frame.Frame):
"""Frame containing the PyCrust shell component."""
***************
*** 79,90 ****
InterpClass=None, *args, **kwds):
"""Create a PyCrust ShellFrame instance."""
! wx.wxFrame.__init__(self, parent, id, title, pos, size, style)
intro = 'PyCrust %s - The Flakiest Python Shell' % VERSION
intro += '\nSponsored by Orbtech - ' + \
'Your source for Python programming expertise.'
- self.CreateStatusBar()
self.SetStatusText(intro.replace('\n', ', '))
- import images
- self.SetIcon(images.getPyCrustIcon())
self.shell = Shell(parent=self, id=-1, introText=intro,
locals=locals, InterpClass=InterpClass,
--- 50,58 ----
InterpClass=None, *args, **kwds):
"""Create a PyCrust ShellFrame instance."""
! frame.Frame.__init__(self, parent, id, title, pos, size, style)
intro = 'PyCrust %s - The Flakiest Python Shell' % VERSION
intro += '\nSponsored by Orbtech - ' + \
'Your source for Python programming expertise.'
self.SetStatusText(intro.replace('\n', ', '))
self.shell = Shell(parent=self, id=-1, introText=intro,
locals=locals, InterpClass=InterpClass,
***************
*** 92,97 ****
# Override the shell so that status messages go to the status bar.
self.shell.setStatusText = self.SetStatusText
- self.createMenus()
- wx.EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
--- 60,63 ----
***************
*** 192,197 ****
! class Shell(stc.wxStyledTextCtrl):
! """PyCrust Shell based on wxStyledTextCtrl."""
name = 'PyCrust Shell'
--- 158,163 ----
! class Shell(base.Editor):
! """PyCrust Shell based on StyledTextCtrl."""
name = 'PyCrust Shell'
***************
*** 202,206 ****
introText='', locals=None, InterpClass=None, *args, **kwds):
"""Create a PyCrust Shell instance."""
! stc.wxStyledTextCtrl.__init__(self, parent, id, pos, size, style)
if locals is None:
locals = {}
--- 168,173 ----
introText='', locals=None, InterpClass=None, *args, **kwds):
"""Create a PyCrust Shell instance."""
! base.Editor.__init__(self, parent, id, pos, size, style)
! self.wrap()
if locals is None:
locals = {}
***************
*** 219,223 ****
self.reader = PseudoFileIn(self.readline, self.readlines)
self.reader.input = ''
! self.reader.isreading = 0
# Set up the interpreter.
self.interp = Interpreter(locals=locals,
--- 186,190 ----
self.reader = PseudoFileIn(self.readline, self.readlines)
self.reader.input = ''
! self.reader.isreading = False
# Set up the interpreter.
self.interp = Interpreter(locals=locals,
***************
*** 233,237 ****
self.promptPosEnd = 0
# Keep track of multi-line commands.
! self.more = 0
# Create the command history. Commands are added into the
# front of the list (ie. at index 0) as they are entered.
--- 200,204 ----
self.promptPosEnd = 0
# Keep track of multi-line commands.
! self.more = False
# Create the command history. Commands are added into the
# front of the list (ie. at index 0) as they are entered.
***************
*** 244,259 ****
self.historyIndex = -1
# Assign handlers for keyboard events.
- wx.EVT_KEY_DOWN(self, self.OnKeyDown)
wx.EVT_CHAR(self, self.OnChar)
! # Assign handlers for wxSTC events.
! stc.EVT_STC_UPDATEUI(self, id, self.OnUpdateUI)
# Assign handler for idle time.
self.waiting = False
wx.EVT_IDLE(self, self.OnIdle)
- dispatcher.connect(receiver=self.fontsizer, signal='FontIncrease')
- dispatcher.connect(receiver=self.fontsizer, signal='FontDecrease')
- dispatcher.connect(receiver=self.fontsizer, signal='FontDefault')
- # Configure various defaults and user preferences.
- self.config()
# Display the introductory banner information.
self.showIntro(introText)
--- 211,219 ----
self.historyIndex = -1
# Assign handlers for keyboard events.
wx.EVT_CHAR(self, self.OnChar)
! wx.EVT_KEY_DOWN(self, self.OnKeyDown)
# Assign handler for idle time.
self.waiting = False
wx.EVT_IDLE(self, self.OnIdle)
# Display the introductory banner information.
self.showIntro(introText)
***************
*** 267,314 ****
wx.wxCallAfter(self.ScrollToLine, 0)
- def fontsizer(self, signal):
- """Receiver for Font* signals."""
- size = self.GetZoom()
- if signal == 'FontIncrease':
- size += 1
- elif signal == 'FontDecrease':
- size -= 1
- elif signal == 'FontDefault':
- size = 0
- self.SetZoom(size)
-
def destroy(self):
del self.interp
- pass
-
- def config(self):
- """Configure shell based on user preferences."""
- self.SetMarginType(1, stc.wxSTC_MARGIN_NUMBER)
- self.SetMarginWidth(1, 40)
-
- self.SetLexer(stc.wxSTC_LEX_PYTHON)
- self.SetKeyWords(0, ' '.join(keyword.kwlist))
! self.setStyles(faces)
! self.SetViewWhiteSpace(0)
! self.SetTabWidth(4)
! self.SetUseTabs(0)
! # Do we want to automatically pop up command completion options?
! self.autoComplete = 1
! self.autoCompleteIncludeMagic = 1
! self.autoCompleteIncludeSingle = 1
! self.autoCompleteIncludeDouble = 1
! self.autoCompleteCaseInsensitive = 1
! self.AutoCompSetIgnoreCase(self.autoCompleteCaseInsensitive)
! self.AutoCompSetAutoHide(False)
! self.AutoCompStops(' .,;:([)]}\'"\\<>%^&+-=*/|`')
! # Do we want to automatically pop up command argument help?
! self.autoCallTip = 1
! self.CallTipSetBackground(wx.wxColour(255, 255, 232))
! self.wrap()
! try:
! self.SetEndAtLastLine(False)
! except AttributeError:
! pass
def showIntro(self, text=''):
--- 227,237 ----
wx.wxCallAfter(self.ScrollToLine, 0)
def destroy(self):
del self.interp
! def OnIdle(self, event):
! """Free the CPU to do other things."""
! if self.waiting:
! time.sleep(0.05)
def showIntro(self, text=''):
***************
*** 355,408 ****
self.push('')
- def setStyles(self, faces):
- """Configure font size, typeface and color for lexer."""
-
- # Default style
- self.StyleSetSpec(stc.wxSTC_STYLE_DEFAULT,
- "face:%(mono)s,size:%(size)d,back:%(backcol)s" % \
- faces)
-
- self.StyleClearAll()
-
- # Built in styles
- self.StyleSetSpec(stc.wxSTC_STYLE_LINENUMBER,
- "back:#C0C0C0,face:%(mono)s,size:%(lnsize)d" % faces)
- self.StyleSetSpec(stc.wxSTC_STYLE_CONTROLCHAR,
- "face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_STYLE_BRACELIGHT,
- "fore:#0000FF,back:#FFFF88")
- self.StyleSetSpec(stc.wxSTC_STYLE_BRACEBAD,
- "fore:#FF0000,back:#FFFF88")
-
- # Python styles
- self.StyleSetSpec(stc.wxSTC_P_DEFAULT,
- "face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_COMMENTLINE,
- "fore:#007F00,face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_NUMBER,
- "")
- self.StyleSetSpec(stc.wxSTC_P_STRING,
- "fore:#7F007F,face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_CHARACTER,
- "fore:#7F007F,face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_WORD,
- "fore:#00007F,bold")
- self.StyleSetSpec(stc.wxSTC_P_TRIPLE,
- "fore:#7F0000")
- self.StyleSetSpec(stc.wxSTC_P_TRIPLEDOUBLE,
- "fore:#000033,back:#FFFFE8")
- self.StyleSetSpec(stc.wxSTC_P_CLASSNAME,
- "fore:#0000FF,bold")
- self.StyleSetSpec(stc.wxSTC_P_DEFNAME,
- "fore:#007F7F,bold")
- self.StyleSetSpec(stc.wxSTC_P_OPERATOR,
- "")
- self.StyleSetSpec(stc.wxSTC_P_IDENTIFIER,
- "")
- self.StyleSetSpec(stc.wxSTC_P_COMMENTBLOCK,
- "fore:#7F7F7F")
- self.StyleSetSpec(stc.wxSTC_P_STRINGEOL,
- "fore:#000000,face:%(mono)s,back:#E0C0E0,eolfilled" % faces)
-
def about(self):
"""Display information about PyCrust."""
--- 278,281 ----
***************
*** 419,461 ****
self.write(text.strip())
- def OnIdle(self, event):
- """Free the CPU to do other things."""
- if self.waiting:
- time.sleep(0.05)
-
- def OnUpdateUI(self, event):
- """Check for matching braces."""
- # If the auto-complete window is up let it do its thing.
- if self.AutoCompActive():
- return
- braceAtCaret = -1
- braceOpposite = -1
- charBefore = None
- caretPos = self.GetCurrentPos()
- if caretPos > 0:
- charBefore = self.GetCharAt(caretPos - 1)
- styleBefore = self.GetStyleAt(caretPos - 1)
-
- # Check before.
- if charBefore and chr(charBefore) in '[]{}()' \
- and styleBefore == stc.wxSTC_P_OPERATOR:
- braceAtCaret = caretPos - 1
-
- # Check after.
- if braceAtCaret < 0:
- charAfter = self.GetCharAt(caretPos)
- styleAfter = self.GetStyleAt(caretPos)
- if charAfter and chr(charAfter) in '[]{}()' \
- and styleAfter == stc.wxSTC_P_OPERATOR:
- braceAtCaret = caretPos
-
- if braceAtCaret >= 0:
- braceOpposite = self.BraceMatch(braceAtCaret)
-
- if braceAtCaret != -1 and braceOpposite == -1:
- self.BraceBadLight(braceAtCaret)
- else:
- self.BraceHighlight(braceAtCaret, braceOpposite)
-
def OnChar(self, event):
"""Keypress event handler.
--- 292,295 ----
***************
*** 639,643 ****
self.SetSelection(startpos, endpos)
self.ReplaceSelection('')
! self.more = 0
def OnHistoryReplace(self, step):
--- 473,477 ----
self.SetSelection(startpos, endpos)
self.ReplaceSelection('')
! self.more = False
def OnHistoryReplace(self, step):
***************
*** 674,678 ****
# The text up to the cursor is what we search for.
numCharsAfterCursor = self.GetTextLength() - startpos
! searchText = self.getCommand(rstrip=0)
if numCharsAfterCursor > 0:
searchText = searchText[:-numCharsAfterCursor]
--- 508,512 ----
# The text up to the cursor is what we search for.
numCharsAfterCursor = self.GetTextLength() - startpos
! searchText = self.getCommand(rstrip=False)
if numCharsAfterCursor > 0:
searchText = searchText[:-numCharsAfterCursor]
***************
*** 709,713 ****
if self.CanEdit():
self.write(os.linesep)
! self.more = 1
self.prompt()
--- 543,547 ----
if self.CanEdit():
self.write(os.linesep)
! self.more = True
self.prompt()
***************
*** 726,730 ****
if self.CanEdit():
self.SetCurrentPos(endpos)
! self.interp.more = 0
command = self.GetTextRange(startpos, endpos)
lines = command.split(os.linesep + ps2)
--- 560,564 ----
if self.CanEdit():
self.SetCurrentPos(endpos)
! self.interp.more = False
command = self.GetTextRange(startpos, endpos)
lines = command.split(os.linesep + ps2)
***************
*** 744,748 ****
else:
# If the line contains a command (even an invalid one).
! if self.getCommand(rstrip=0):
command = self.getMultilineCommand()
self.clearCommand()
--- 578,582 ----
else:
# If the line contains a command (even an invalid one).
! if self.getCommand(rstrip=False):
command = self.getMultilineCommand()
self.clearCommand()
***************
*** 753,757 ****
self.SetAnchor(thepos)
! def getMultilineCommand(self, rstrip=1):
"""Extract a multi-line command from the editor.
--- 587,591 ----
self.SetAnchor(thepos)
! def getMultilineCommand(self, rstrip=True):
"""Extract a multi-line command from the editor.
***************
*** 790,794 ****
return command
! def getCommand(self, text=None, rstrip=1):
"""Extract a command from text which may include a shell prompt.
--- 624,628 ----
return command
! def getCommand(self, text=None, rstrip=True):
"""Extract a command from text which may include a shell prompt.
***************
*** 863,867 ****
If this is a continuation line, autoindent as necessary."""
isreading = self.reader.isreading
! skip = 0
if isreading:
prompt = str(sys.ps3)
--- 697,701 ----
If this is a continuation line, autoindent as necessary."""
isreading = self.reader.isreading
! skip = False
if isreading:
prompt = str(sys.ps3)
***************
*** 873,877 ****
if pos > 0:
if isreading:
! skip = 1
else:
self.write(os.linesep)
--- 707,711 ----
if pos > 0:
if isreading:
! skip = True
else:
self.write(os.linesep)
***************
*** 894,898 ****
input = ''
reader = self.reader
! reader.isreading = 1
self.prompt()
try:
--- 728,732 ----
input = ''
reader = self.reader
! reader.isreading = True
self.prompt()
try:
***************
*** 902,906 ****
finally:
reader.input = ''
! reader.isreading = 0
input = str(input) # In case of Unicode.
return input
--- 736,740 ----
finally:
reader.input = ''
! reader.isreading = False
input = str(input) # In case of Unicode.
return input
***************
*** 939,943 ****
self.ClearAll()
! def run(self, command, prompt=1, verbose=1):
"""Execute command as if it was typed in directly.
>>> shell.run('print "this"')
--- 773,777 ----
self.ClearAll()
! def run(self, command, prompt=True, verbose=True):
"""Execute command as if it was typed in directly.
>>> shell.run('print "this"')
***************
*** 963,969 ****
if command[:6] == 'shell.':
# Run shell methods silently.
! self.run(command, prompt=0, verbose=0)
else:
! self.run(command, prompt=0, verbose=1)
finally:
file.close()
--- 797,803 ----
if command[:6] == 'shell.':
# Run shell methods silently.
! self.run(command, prompt=False, verbose=False)
else:
! self.run(command, prompt=False, verbose=True)
finally:
file.close()
***************
*** 1008,1012 ****
self.write(text)
! def redirectStdin(self, redirect=1):
"""If redirect is true then sys.stdin will come from the shell."""
if redirect:
--- 842,846 ----
self.write(text)
! def redirectStdin(self, redirect=True):
"""If redirect is true then sys.stdin will come from the shell."""
if redirect:
***************
*** 1015,1019 ****
sys.stdin = self.stdin
! def redirectStdout(self, redirect=1):
"""If redirect is true then sys.stdout will go to the shell."""
if redirect:
--- 849,853 ----
sys.stdin = self.stdin
! def redirectStdout(self, redirect=True):
"""If redirect is true then sys.stdout will go to the shell."""
if redirect:
***************
*** 1022,1026 ****
sys.stdout = self.stdout
! def redirectStderr(self, redirect=1):
"""If redirect is true then sys.stderr will go to the shell."""
if redirect:
--- 856,860 ----
sys.stdout = self.stdout
! def redirectStderr(self, redirect=True):
"""If redirect is true then sys.stderr will go to the shell."""
if redirect:
***************
*** 1034,1051 ****
and self.GetSelectionStart() >= self.promptPosEnd \
and self.GetSelectionEnd() >= self.promptPosEnd:
! return 1
else:
! return 0
!
! def CanCopy(self):
! """Return true if text is selected and can be copied."""
! return self.GetSelectionStart() != self.GetSelectionEnd()
def CanPaste(self):
"""Return true if a paste should succeed."""
! if self.CanEdit() and stc.wxStyledTextCtrl.CanPaste(self):
! return 1
else:
! return 0
def CanEdit(self):
--- 868,881 ----
and self.GetSelectionStart() >= self.promptPosEnd \
and self.GetSelectionEnd() >= self.promptPosEnd:
! return True
else:
! return False
def CanPaste(self):
"""Return true if a paste should succeed."""
! if self.CanEdit() and base.Editor.CanPaste(self):
! return True
else:
! return False
def CanEdit(self):
***************
*** 1054,1060 ****
if self.GetSelectionStart() >= self.promptPosEnd \
and self.GetSelectionEnd() >= self.promptPosEnd:
! return 1
else:
! return 0
else:
return self.GetCurrentPos() >= self.promptPosEnd
--- 884,890 ----
if self.GetSelectionStart() >= self.promptPosEnd \
and self.GetSelectionEnd() >= self.promptPosEnd:
! return True
else:
! return False
else:
return self.GetCurrentPos() >= self.promptPosEnd
***************
*** 1172,1176 ****
wx.wxTheClipboard.Close()
! def wrap(self, wrap=1):
"""Sets whether text is word wrapped."""
try:
--- 1002,1006 ----
wx.wxTheClipboard.Close()
! def wrap(self, wrap=True):
"""Sets whether text is word wrapped."""
try:
***************
*** 1181,1187 ****
def zoom(self, points=0):
"""Set the zoom level.
!
This number of points is added to the size of all fonts. It
may be positive to magnify or negative to reduce."""
self.SetZoom(points)
-
--- 1011,1016 ----
def zoom(self, points=0):
"""Set the zoom level.
!
This number of points is added to the size of all fonts. It
may be positive to magnify or negative to reduce."""
self.SetZoom(points)
Index: filling.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/filling.py,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** filling.py 19 Mar 2003 02:42:17 -0000 1.54
--- filling.py 29 Mar 2003 02:42:01 -0000 1.55
***************
*** 7,12 ****
from wxPython import wx
! from wxPython import stc
! from version import VERSION
import dispatcher
import inspect
--- 7,12 ----
from wxPython import wx
!
! import base
import dispatcher
import inspect
***************
*** 15,18 ****
--- 15,19 ----
import sys
import types
+ from version import VERSION
try:
***************
*** 46,52 ****
revision = __revision__
! def __init__(self, parent, id=-1, pos=wx.wxDefaultPosition,
! size=wx.wxDefaultSize, style=wx.wxTR_DEFAULT_STYLE,
! rootObject=None, rootLabel=None, rootIsNamespace=0,
static=False):
"""Create a PyCrust FillingTree instance."""
--- 47,53 ----
revision = __revision__
! def __init__(self, parent, id=-1, pos=wx.wxDefaultPosition,
! size=wx.wxDefaultSize, style=wx.wxTR_DEFAULT_STYLE,
! rootObject=None, rootLabel=None, rootIsNamespace=False,
static=False):
"""Create a PyCrust FillingTree instance."""
***************
*** 56,60 ****
if rootObject is None:
rootObject = __main__.__dict__
! self.rootIsNamespace = 1
if rootObject is __main__.__dict__ and rootLabel is None:
rootLabel = 'locals()'
--- 57,61 ----
if rootObject is None:
rootObject = __main__.__dict__
! self.rootIsNamespace = True
if rootObject is __main__.__dict__ and rootLabel is None:
rootLabel = 'locals()'
***************
*** 238,242 ****
def setStatusText(self, text):
"""Display status information."""
!
# This method will likely be replaced by the enclosing app to
# do something more interesting, like write to a status bar.
--- 239,243 ----
def setStatusText(self, text):
"""Display status information."""
!
# This method will likely be replaced by the enclosing app to
# do something more interesting, like write to a status bar.
***************
*** 244,284 ****
! if wx.wxPlatform == '__WXMSW__':
! faces = { 'times' : 'Times New Roman',
! 'mono' : 'Courier New',
! 'helv' : 'Lucida Console',
! 'lucida' : 'Lucida Console',
! 'other' : 'Comic Sans MS',
! 'size' : 10,
! 'lnsize' : 9,
! 'backcol': '#FFFFFF',
! }
! else: # GTK
! faces = { 'times' : 'Times',
! 'mono' : 'Courier',
! 'helv' : 'Helvetica',
! 'other' : 'new century schoolbook',
! 'size' : 12,
! 'lnsize' : 10,
! 'backcol': '#FFFFFF',
! }
!
! class FillingText(stc.wxStyledTextCtrl):
! """PyCrust FillingText based on wxStyledTextCtrl."""
!
! name = 'PyCrust Filling Text'
revision = __revision__
! def __init__(self, parent, id=-1, pos=wx.wxDefaultPosition,
size=wx.wxDefaultSize, style=wx.wxCLIP_CHILDREN,
static=False):
! """Create a PyCrust FillingText instance."""
! stc.wxStyledTextCtrl.__init__(self, parent, id, pos, size, style)
# Configure various defaults and user preferences.
! self.config()
! dispatcher.connect(receiver=self.fontsizer, signal='FontIncrease')
! dispatcher.connect(receiver=self.fontsizer, signal='FontDecrease')
! dispatcher.connect(receiver=self.fontsizer, signal='FontDefault')
if not static:
dispatcher.connect(receiver=self.push, signal='Interpreter.push')
--- 245,263 ----
! class FillingText(base.Editor):
! """FillingText based on StyledTextCtrl."""
! name = 'PyFilling Text'
revision = __revision__
! def __init__(self, parent, id=-1, pos=wx.wxDefaultPosition,
size=wx.wxDefaultSize, style=wx.wxCLIP_CHILDREN,
static=False):
! """Create a FillingText instance."""
! base.Editor.__init__(self, parent, id, pos, size, style)
# Configure various defaults and user preferences.
! self.SetReadOnly(True)
! self.SetWrapMode(True)
! self.SetMarginWidth(1, 0)
if not static:
dispatcher.connect(receiver=self.push, signal='Interpreter.push')
***************
*** 288,387 ****
self.Refresh()
- def fontsizer(self, signal):
- """Receiver for Font* signals."""
- size = self.GetZoom()
- if signal == 'FontIncrease':
- size += 1
- elif signal == 'FontDecrease':
- size -= 1
- elif signal == 'FontDefault':
- size = 0
- self.SetZoom(size)
-
- def config(self):
- """Configure shell based on user preferences."""
- self.SetMarginWidth(1, 0)
-
- self.SetLexer(stc.wxSTC_LEX_PYTHON)
- self.SetKeyWords(0, ' '.join(keyword.kwlist))
-
- self.setStyles(faces)
- self.SetViewWhiteSpace(0)
- self.SetTabWidth(4)
- self.SetUseTabs(0)
- self.SetReadOnly(1)
- try:
- self.SetWrapMode(1)
- except AttributeError:
- pass
-
- def setStyles(self, faces):
- """Configure font size, typeface and color for lexer."""
-
- # Default style
- self.StyleSetSpec(stc.wxSTC_STYLE_DEFAULT,
- "face:%(mono)s,size:%(size)d" % faces)
-
- self.StyleClearAll()
-
- # Built in styles
- self.StyleSetSpec(stc.wxSTC_STYLE_LINENUMBER,
- "back:#C0C0C0,face:%(mono)s,size:%(lnsize)d" % faces)
- self.StyleSetSpec(stc.wxSTC_STYLE_CONTROLCHAR,
- "face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_STYLE_BRACELIGHT,
- "fore:#0000FF,back:#FFFF88")
- self.StyleSetSpec(stc.wxSTC_STYLE_BRACEBAD,
- "fore:#FF0000,back:#FFFF88")
-
- # Python styles
- self.StyleSetSpec(stc.wxSTC_P_DEFAULT,
- "face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_COMMENTLINE,
- "fore:#007F00,face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_NUMBER,
- "")
- self.StyleSetSpec(stc.wxSTC_P_STRING,
- "fore:#7F007F,face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_CHARACTER,
- "fore:#7F007F,face:%(mono)s" % faces)
- self.StyleSetSpec(stc.wxSTC_P_WORD,
- "fore:#00007F,bold")
- self.StyleSetSpec(stc.wxSTC_P_TRIPLE,
- "fore:#7F0000")
- self.StyleSetSpec(stc.wxSTC_P_TRIPLEDOUBLE,
- "fore:#000033,back:#FFFFE8")
- self.StyleSetSpec(stc.wxSTC_P_CLASSNAME,
- "fore:#0000FF,bold")
- self.StyleSetSpec(stc.wxSTC_P_DEFNAME,
- "fore:#007F7F,bold")
- self.StyleSetSpec(stc.wxSTC_P_OPERATOR,
- "")
- self.StyleSetSpec(stc.wxSTC_P_IDENTIFIER,
- "")
- self.StyleSetSpec(stc.wxSTC_P_COMMENTBLOCK,
- "fore:#7F7F7F")
- self.StyleSetSpec(stc.wxSTC_P_STRINGEOL,
- "fore:#000000,face:%(mono)s,back:#E0C0E0,eolfilled" % faces)
-
def SetText(self, *args, **kwds):
! self.SetReadOnly(0)
! stc.wxStyledTextCtrl.SetText(self, *args, **kwds)
! self.SetReadOnly(1)
class Filling(wx.wxSplitterWindow):
! """PyCrust Filling based on wxSplitterWindow."""
!
! name = 'PyCrust Filling'
revision = __revision__
!
! def __init__(self, parent, id=-1, pos=wx.wxDefaultPosition,
size=wx.wxDefaultSize, style=wx.wxSP_3D,
name='Filling Window', rootObject=None,
! rootLabel=None, rootIsNamespace=0, static=False):
! """Create a PyCrust Filling instance."""
wx.wxSplitterWindow.__init__(self, parent, id, pos, size, style, name)
! self.tree = FillingTree(parent=self, rootObject=rootObject,
rootLabel=rootLabel,
rootIsNamespace=rootIsNamespace,
--- 267,289 ----
self.Refresh()
def SetText(self, *args, **kwds):
! self.SetReadOnly(False)
! base.Editor.SetText(self, *args, **kwds)
! self.SetReadOnly(True)
class Filling(wx.wxSplitterWindow):
! """Filling based on wxSplitterWindow."""
!
! name = 'PyFilling'
revision = __revision__
!
! def __init__(self, parent, id=-1, pos=wx.wxDefaultPosition,
size=wx.wxDefaultSize, style=wx.wxSP_3D,
name='Filling Window', rootObject=None,
! rootLabel=None, rootIsNamespace=False, static=False):
! """Create a Filling instance."""
wx.wxSplitterWindow.__init__(self, parent, id, pos, size, style, name)
! self.tree = FillingTree(parent=self, rootObject=rootObject,
rootLabel=rootLabel,
rootIsNamespace=rootIsNamespace,
***************
*** 398,411 ****
class FillingFrame(wx.wxFrame):
! """Frame containing the PyCrust filling, or namespace tree component."""
!
! name = 'PyCrust Filling Frame'
revision = __revision__
!
! def __init__(self, parent=None, id=-1, title='PyFilling',
! pos=wx.wxDefaultPosition, size=wx.wxDefaultSize,
! style=wx.wxDEFAULT_FRAME_STYLE, rootObject=None,
! rootLabel=None, rootIsNamespace=0, static=False):
! """Create a PyCrust FillingFrame instance."""
wx.wxFrame.__init__(self, parent, id, title, pos, size, style)
intro = 'PyFilling - The Tastiest Namespace Inspector'
--- 300,313 ----
class FillingFrame(wx.wxFrame):
! """Frame containing the namespace tree component."""
!
! name = 'PyFilling Frame'
revision = __revision__
!
! def __init__(self, parent=None, id=-1, title='PyFilling',
! pos=wx.wxDefaultPosition, size=(600, 400),
! style=wx.wxDEFAULT_FRAME_STYLE, rootObject=None,
! rootLabel=None, rootIsNamespace=False, static=False):
! """Create a FillingFrame instance."""
wx.wxFrame.__init__(self, parent, id, title, pos, size, style)
intro = 'PyFilling - The Tastiest Namespace Inspector'
***************
*** 414,419 ****
import images
self.SetIcon(images.getPyCrustIcon())
! self.filling = Filling(parent=self, rootObject=rootObject,
! rootLabel=rootLabel,
rootIsNamespace=rootIsNamespace,
static=static)
--- 316,321 ----
import images
self.SetIcon(images.getPyCrustIcon())
! self.filling = Filling(parent=self, rootObject=rootObject,
! rootLabel=rootLabel,
rootIsNamespace=rootIsNamespace,
static=static)
***************
*** 424,428 ****
class App(wx.wxApp):
"""PyFilling standalone application."""
!
def OnInit(self):
wx.wxInitAllImageHandlers()
--- 326,330 ----
class App(wx.wxApp):
"""PyFilling standalone application."""
!
def OnInit(self):
wx.wxInitAllImageHandlers()
***************
*** 431,436 ****
self.SetTopWindow(self.fillingFrame)
return True
-
-
-
-
--- 333,334 ----
Index: crust.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/crust.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** crust.py 18 Mar 2003 17:14:38 -0000 1.36
--- crust.py 29 Mar 2003 02:42:04 -0000 1.37
***************
*** 6,13 ****
from wxPython import wx
! from filling import Filling
import os
from shell import Shell
- from shellmenu import ShellMenu
from version import VERSION
--- 6,17 ----
from wxPython import wx
!
import os
+ import sys
+
+ import dispatcher
+ from filling import Filling
+ import frame
from shell import Shell
from version import VERSION
***************
*** 74,78 ****
def __init__(self, parent=None, id=-1):
- import dispatcher
style = wx.wxTE_MULTILINE | wx.wxTE_READONLY | wx.wxTE_RICH2
wx.wxTextCtrl.__init__(self, parent=parent, id=id, style=style)
--- 78,81 ----
***************
*** 89,93 ****
def __init__(self, parent=None, id=-1):
- import dispatcher
style = wx.wxTE_MULTILINE | wx.wxTE_READONLY | \
wx.wxTE_RICH2 | wx.wxTE_DONTWRAP
--- 92,95 ----
***************
*** 109,113 ****
def __init__(self, parent=None, id=-1):
- import dispatcher
style = wx.wxTE_MULTILINE | wx.wxTE_READONLY | \
wx.wxTE_RICH2 | wx.wxTE_DONTWRAP
--- 111,114 ----
***************
*** 125,129 ****
! class CrustFrame(wx.wxFrame, ShellMenu):
"""Frame containing all the PyCrust components."""
--- 126,130 ----
! class CrustFrame(frame.Frame):
"""Frame containing all the PyCrust components."""
***************
*** 131,169 ****
revision = __revision__
! def __init__(self, parent=None, id=-1, title='PyCrust',
! pos=wx.wxDefaultPosition, size=wx.wxDefaultSize,
! style=wx.wxDEFAULT_FRAME_STYLE,
! rootObject=None, rootLabel=None, rootIsNamespace=True,
locals=None, InterpClass=None, *args, **kwds):
"""Create a PyCrust CrustFrame instance."""
! wx.wxFrame.__init__(self, parent, id, title, pos, size, style)
intro = 'PyCrust %s - The Flakiest Python Shell' % VERSION
intro += '\nSponsored by Orbtech - '
intro += 'Your source for Python programming expertise.'
- self.CreateStatusBar()
self.SetStatusText(intro.replace('\n', ', '))
! import images
! self.SetIcon(images.getPyCrustIcon())
! self.crust = Crust(parent=self, intro=intro,
! rootObject=rootObject,
! rootLabel=rootLabel,
! rootIsNamespace=rootIsNamespace,
! locals=locals,
InterpClass=InterpClass, *args, **kwds)
# 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.crust.shell.setStatusText = self.SetStatusText
# Fix a problem with the sash shrinking to nothing.
self.crust.filling.SetSashPosition(200)
- self.shell = self.crust.shell
- self.createMenus()
- wx.EVT_CLOSE(self, self.OnCloseWindow)
# Set focus to the shell editor.
! self.crust.shell.SetFocus()
def OnCloseWindow(self, event):
self.crust.shell.destroy()
self.Destroy()
!
--- 132,181 ----
revision = __revision__
! def __init__(self, parent=None, id=-1, title='PyCrust',
! pos=wx.wxDefaultPosition, size=wx.wxDefaultSize,
! style=wx.wxDEFAULT_FRAME_STYLE,
! rootObject=None, rootLabel=None, rootIsNamespace=True,
locals=None, InterpClass=None, *args, **kwds):
"""Create a PyCrust CrustFrame instance."""
! frame.Frame.__init__(self, parent, id, title, pos, size, style)
intro = 'PyCrust %s - The Flakiest Python Shell' % VERSION
intro += '\nSponsored by Orbtech - '
intro += 'Your source for Python programming expertise.'
self.SetStatusText(intro.replace('\n', ', '))
! self.crust = Crust(parent=self, intro=intro,
! rootObject=rootObject,
! rootLabel=rootLabel,
! rootIsNamespace=rootIsNamespace,
! locals=locals,
InterpClass=InterpClass, *args, **kwds)
+ 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)
# Set focus to the shell editor.
! self.shell.SetFocus()
def OnCloseWindow(self, event):
+ """Event handler for closing."""
self.crust.shell.destroy()
self.Destroy()
! def OnAbout(self, event):
! """Display an About window."""
! title = 'About PyCrust'
! text = 'PyCrust %s\n\n' % VERSION + \
! 'Yet another Python shell, only flakier.\n\n' + \
! 'Half-baked by Patrick K. O\'Brien,\n' + \
! 'the other half is still in the oven.\n\n' + \
! 'Shell Revision: %s\n' % self.shell.revision + \
! 'Interpreter Revision: %s\n\n' % self.shell.interp.revision + \
! 'Python Version: %s\n' % sys.version.split()[0] + \
! 'wxPython Version: %s\n' % wx.__version__ + \
! 'Platform: %s\n' % sys.platform
! dialog = wx.wxMessageDialog(self, text, title,
! wx.wxOK | wx.wxICON_INFORMATION)
! dialog.ShowModal()
! dialog.Destroy()
Index: CHANGES.txt
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/CHANGES.txt,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** CHANGES.txt 24 Mar 2003 15:07:57 -0000 1.29
--- CHANGES.txt 29 Mar 2003 02:42:04 -0000 1.30
***************
*** 25,28 ****
--- 25,32 ----
* examples.txt (in wx/examples)
+ Added PyAlaMode.py code editor.
+
+ Major refactoring to support editor and shell from the same base.
+
|
|
From: <po...@us...> - 2003-03-27 19:26:03
|
Update of /cvsroot/pycrust/wx/examples/hello In directory sc8-pr-cvs1:/tmp/cvs-serv21593/examples/hello Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:56
|
Update of /cvsroot/pycrust/wx In directory sc8-pr-cvs1:/tmp/cvs-serv22135 Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:19
|
Update of /cvsroot/pycrust/wx/examples In directory sc8-pr-cvs1:/tmp/cvs-serv21593/examples Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:17
|
Update of /cvsroot/pycrust/wx/examples/basic In directory sc8-pr-cvs1:/tmp/cvs-serv21593/examples/basic Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:14
|
Update of /cvsroot/pycrust/wx/lib/colourchooser In directory sc8-pr-cvs1:/tmp/cvs-serv21593/lib/colourchooser Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:14
|
Update of /cvsroot/pycrust/wx/lib/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv21593/lib/PyCrust Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:13
|
Update of /cvsroot/pycrust/wx/lib In directory sc8-pr-cvs1:/tmp/cvs-serv21593/lib Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:13
|
Update of /cvsroot/pycrust/wx/lib/editor In directory sc8-pr-cvs1:/tmp/cvs-serv21593/lib/editor Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 19:21:08
|
Update of /cvsroot/pycrust/wx/lib/mixins In directory sc8-pr-cvs1:/tmp/cvs-serv21593/lib/mixins Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 18:53:04
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv8569 Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 18:53:00
|
Update of /cvsroot/pycrust/PyCrust/Demos In directory sc8-pr-cvs1:/tmp/cvs-serv8569/Demos Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 18:52:59
|
Update of /cvsroot/pycrust/PyCrust/tests In directory sc8-pr-cvs1:/tmp/cvs-serv8569/tests Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 18:52:59
|
Update of /cvsroot/pycrust/PyCrust/wxd In directory sc8-pr-cvs1:/tmp/cvs-serv8569/wxd Removed Files: .cvsignore Log Message: Not needed. --- .cvsignore DELETED --- |
|
From: <po...@us...> - 2003-03-27 15:24:32
|
Update of /cvsroot/pycrust/PyCrust/wxd
In directory sc8-pr-cvs1:/tmp/cvs-serv4010
Modified Files:
Sizers.py
Log Message:
Added "call Layout()" reminders.
Index: Sizers.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/wxd/Sizers.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Sizers.py 25 Mar 2003 23:12:40 -0000 1.5
--- Sizers.py 27 Mar 2003 15:24:19 -0000 1.6
***************
*** 139,143 ****
item - window, sizer, or spacer. Spacer is specified with a
! (width, height) tuple or wx.Size representing the spacer size."""
pass
--- 139,145 ----
item - window, sizer, or spacer. Spacer is specified with a
! (width, height) tuple or wx.Size representing the spacer size.
!
! Call Layout() to update the layout on-screen after adding."""
pass
***************
*** 214,218 ****
userData=wx.NULL):
"""Same as Add, but inserts item into list of items (windows,
! subsizers or spacers) owned by this sizer."""
pass
--- 216,222 ----
userData=wx.NULL):
"""Same as Add, but inserts item into list of items (windows,
! subsizers or spacers) owned by this sizer.
!
! Call Layout() to update the layout on-screen after inserting."""
pass
***************
*** 231,235 ****
userData=wx.NULL):
"""Same as Add, but prepends item to beginning of list of
! items (windows, subsizers or spacers) owned by this sizer."""
pass
--- 235,241 ----
userData=wx.NULL):
"""Same as Add, but prepends item to beginning of list of
! items (windows, subsizers or spacers) owned by this sizer.
!
! Call Layout() to update the layout on-screen after prepending."""
pass
|
|
From: <po...@us...> - 2003-03-25 23:12:45
|
Update of /cvsroot/pycrust/PyCrust/wxd
In directory sc8-pr-cvs1:/tmp/cvs-serv9021
Modified Files:
Sizers.py
Log Message:
Finished.
Index: Sizers.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/wxd/Sizers.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Sizers.py 25 Mar 2003 20:24:28 -0000 1.4
--- Sizers.py 25 Mar 2003 23:12:40 -0000 1.5
***************
*** 360,366 ****
class GridSizer(Sizer):
"""A grid sizer lays out its children in a two-dimensional table
! with all cells having the same size: the width of each cell is the
width of the widest child, the height of each cell is the height
! of the tallest child."""
def __init__(self, rows=1, cols=0, vgap=0, hgap=0):
--- 360,366 ----
class GridSizer(Sizer):
"""A grid sizer lays out its children in a two-dimensional table
! where all cells have the same size: the width of each cell is the
width of the widest child, the height of each cell is the height
! of the tallest child. See also the FlexGridSizer."""
def __init__(self, rows=1, cols=0, vgap=0, hgap=0):
***************
*** 417,432 ****
class FlexGridSizer(GridSizer):
! """"""
def __init__(self, rows=1, cols=0, vgap=0, hgap=0):
! """"""
pass
def AddGrowableCol(self, idx):
! """"""
pass
def AddGrowableRow(self, idx):
! """"""
pass
--- 417,443 ----
class FlexGridSizer(GridSizer):
! """A flex grid sizer lays out its children in a two-dimensional
! table where all cells in one row have the same height and all
! cells in one column have the same width, but all cells are not
! necessarily the same height and width, as in the GridSizer."""
def __init__(self, rows=1, cols=0, vgap=0, hgap=0):
! """Create a GridSizer instance.
!
! rows and cols - the number of rows and columns in the grid; if
! either is zero, it will be calculated as the number of
! children in the sizer, allowing the sizer grow dynamically.
!
! vgap and hgap - extra space between all cells, in pixels."""
pass
def AddGrowableCol(self, idx):
! """Specify that column idx (starting from zero) should expand
! if there is extra space available to the sizer."""
pass
def AddGrowableRow(self, idx):
! """Specify that row idx (starting from zero) should expand if
! there is extra space available to the sizer."""
pass
***************
*** 436,456 ****
def RecalcSizes(self):
! """"""
pass
def RemoveGrowableCol(self, idx):
! """"""
pass
def RemoveGrowableRow(self, idx):
! """"""
pass
class NotebookSizer(Sizer):
! """"""
def __init__(self, nb):
! """"""
pass
--- 447,470 ----
def RecalcSizes(self):
! """Recalculate sizes, then set the size of its children
! (calling SetSize if child is a window). Do not call directly."""
pass
def RemoveGrowableCol(self, idx):
! """Specify that column idx is no longer growable."""
pass
def RemoveGrowableRow(self, idx):
! """Specify that row idx is no longer growable."""
pass
class NotebookSizer(Sizer):
! """NotebookSizer works with a notebook to determine the size of
! the biggest page and report an adjusted minimal size to a more
! toplevel sizer. Do not add children to a NotebookSizer."""
def __init__(self, nb):
! """Create a NotebookSizer instance for notebook."""
pass
***************
*** 460,468 ****
def GetNotebook(self):
! """"""
pass
def RecalcSizes(self):
! """"""
pass
--- 474,482 ----
def GetNotebook(self):
! """Return the notebook associated with the sizer."""
pass
def RecalcSizes(self):
! """Recalculate size. Do not call directly."""
pass
|
|
From: <po...@us...> - 2003-03-25 20:24:38
|
Update of /cvsroot/pycrust/PyCrust/wxd
In directory sc8-pr-cvs1:/tmp/cvs-serv7428
Modified Files:
Sizers.py
Log Message:
New signatures.
Index: Sizers.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/wxd/Sizers.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Sizers.py 22 Mar 2003 20:19:24 -0000 1.3
--- Sizers.py 25 Mar 2003 20:24:28 -0000 1.4
***************
*** 1,3 ****
--- 1,34 ----
"""Decorator classes for documentation and shell scripting.
+
+ Sizer is the abstract base class used for laying out subwindows in a
+ window. You cannot use Sizer directly; instead, you will have to use
+ one of the sizer classes derived from it. Currently there are
+ BoxSizer, StaticBoxSizer, NotebookSizer, GridSizer, and FlexGridSizer.
+
+ The layout algorithm used by sizers in wxPython is closely related to
+ layout in other GUI toolkits, such as Java's AWT, the GTK toolkit or
[...1006 lines suppressed...]
+ """Set a floating point aspect ratio (width/height). If
+ wx.SHAPED flag is used item will maintain ratio when resized."""
+ pass
! def SetRatioWH(self, width, height):
! """Set a floating point aspect ratio (width/height). If
! wx.SHAPED flag is used item will maintain ratio when resized."""
pass
! def SetSizer(self, sizer):
! """Set sizer associated with SizerItem."""
pass
! def SetWindow(self, window):
! """Set window associated with SizerItem."""
pass
! def Show(self, show):
! """Is show is True, show item, otherwise hide item."""
pass
|
|
From: <po...@us...> - 2003-03-24 15:08:01
|
Update of /cvsroot/pycrust/PyCrust
In directory sc8-pr-cvs1:/tmp/cvs-serv18499
Modified Files:
CHANGES.txt
Log Message:
Changes
Index: CHANGES.txt
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/CHANGES.txt,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** CHANGES.txt 21 Mar 2003 05:57:21 -0000 1.28
--- CHANGES.txt 24 Mar 2003 15:07:57 -0000 1.29
***************
*** 18,21 ****
--- 18,28 ----
... l. <-- failed to popup autocomplete list
+ Added documentation files:
+
+ * PyCrust.txt (in PyCrust)
+ * wxPython.txt (in PyCrust/wxd)
+ * wx.txt (in wx)
+ * examples.txt (in wx/examples)
+
|
|
From: <po...@us...> - 2003-03-24 15:07:12
|
Update of /cvsroot/pycrust/PyCrust
In directory sc8-pr-cvs1:/tmp/cvs-serv17534
Added Files:
default.css
Log Message:
For PyCrust.html
--- NEW FILE: default.css ---
/*
:Author: David Goodger
:Contact: go...@us...
:date: $Date: 2003/03/24 15:07:04 $
:version: $Revision: 1.1 $
:copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
*/
.first {
margin-top: 0 }
.last {
margin-bottom: 0 }
a.toc-backref {
text-decoration: none ;
color: black }
dd {
margin-bottom: 0.5em }
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.attention, div.caution, div.danger, div.error, div.hint,
div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
color: red ;
font-weight: bold ;
font-family: sans-serif }
div.hint p.admonition-title, div.important p.admonition-title,
div.note p.admonition-title, div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em }
div.footer, div.header {
font-size: smaller }
div.sidebar {
margin-left: 1em ;
border: medium outset ;
padding: 0em 1em ;
background-color: #ffffee ;
width: 40% ;
float: right }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr {
width: 75% }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font-family: serif ;
font-size: 100% }
pre.line-block {
font-family: serif ;
font-size: 100% }
pre.literal-block, pre.doctest-block {
margin-left: 2em ;
margin-right: 2em ;
background-color: #eeeeee }
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.option-argument {
font-style: italic }
span.pre {
white-space: pre }
span.problematic {
color: red }
table {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.citation {
border-left: solid thin gray ;
padding-left: 0.5ex }
table.docinfo {
margin: 2em 4em }
table.footnote {
border-left: solid thin black ;
padding-left: 0.5ex }
td, th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
th.docinfo-name, th.field-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap }
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
font-size: 100% }
tt {
background-color: #eeeeee }
ul.auto-toc {
list-style-type: none }
|
|
From: <po...@us...> - 2003-03-24 14:58:19
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv7131 Added Files: PyCrust.txt Log Message: New doc --- NEW FILE: PyCrust.txt --- ========= PyCrust ========= --------------------------- The Flakiest Python Shell --------------------------- :Author: Patrick K. O'Brien :Contact: po...@or... :Date: $Date: 2003/03/24 14:58:14 $ :Revision: $Revision: 1.1 $ .. contents:: Introduction ============ This document will show you how to make use of PyCrust. What is PyCrust? ================ PyCrust is really several things. First, PyCrust is a standalone application that provides a graphical, Python shell interface. Second, PyCrust is a collections of modules that you can use in your own wxPython applications to provide similar services, either for your own use during development, or as an interface for users of your program. Third, PyCrust is a wrapper utility, providing you with runtime introspection capabilities for your wxPython programs without having to include PyCrust in your program or alter one line of code. PyCrust standalone ================== There are actually three standalone applications in the PyCrust package: * PyCrustApp * PyShellApp * PyFillingApp PyCrust modules =============== PyCrust was designed to be modular. That means graphical code is kept separate from non-graphical code, and many of the PyCrust modules can be used by other programs. Likewise, other programs can supply some of the modules needed by PyCrust. For example, you could supply a customized interpreter module and plug it in to the PyCrust standalone application. As long as it supports the minimum functionality required, PyCrust will work just as well with your interpreter as with its default interpreter. PyCrust runtime wrapper ======================= The PyCrust wrapper utility (``wrap.py``) lets you run an existing wxPython program with a PyCrust frame at the same time. Inside the 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. |
|
From: <po...@us...> - 2003-03-22 20:19:29
|
Update of /cvsroot/pycrust/PyCrust/wxd
In directory sc8-pr-cvs1:/tmp/cvs-serv7754
Modified Files:
Sizers.py
Log Message:
Signatures are complete.
Index: Sizers.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/wxd/Sizers.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Sizers.py 7 Mar 2003 04:36:03 -0000 1.2
--- Sizers.py 22 Mar 2003 20:19:24 -0000 1.3
***************
*** 16,44 ****
import Parameters as wx
class Sizer(Object):
! """"""
! def Add(self):
""""""
pass
! def AddMany(self):
""""""
pass
! def AddSizer(self):
""""""
pass
! def AddSpacer(self):
""""""
pass
! def AddWindow(self):
""""""
pass
! def Clear(self):
""""""
pass
--- 16,61 ----
import Parameters as wx
+ try:
+ True
+ except NameError:
+ True = 1==1
+ False = 1==0
+
class Sizer(Object):
! """Sizer is the abstract base class used for laying out subwindows
! in a window. You shouldn't use Sizer directly; instead, you should
! use one of the sizer classes derived from it.
! If you wish to create a sizer class in wxPython you should derive
! the class from PySizer in order to get Python-aware capabilities
! for the various virtual methods."""
!
! def __init__(self):
""""""
pass
! def Add(self):
! """Do not use. Instead, use AddSizer, AddSpacer, or
! AddWindow."""
! pass
!
! def AddMany(self, widgets):
""""""
pass
! def AddSizer(self, sizer, option=0, flag=0, border=0, userData=wx.NULL):
""""""
pass
! def AddSpacer(self, width, height, option=0, flag=0, border=0, userData=wx.NULL):
""""""
pass
! def AddWindow(self, window, option=0, flag=0, border=0, userData=wx.NULL):
""""""
pass
! def Clear(self, delete_windows=False):
""""""
pass
***************
*** 52,60 ****
pass
! def Fit(self):
""""""
pass
! def FitInside(self):
""""""
pass
--- 69,77 ----
pass
! def Fit(self, window):
""""""
pass
! def FitInside(self, window):
""""""
pass
***************
*** 89,128 ****
def Hide(self):
! """"""
pass
! def HideSizer(self):
""""""
pass
! def HideWindow(self):
""""""
pass
def Insert(self):
! """"""
pass
! def InsertSizer(self):
""""""
pass
! def InsertSpacer(self):
""""""
pass
! def InsertWindow(self):
""""""
pass
def IsShown(self):
! """"""
pass
! def IsShownSizer(self):
""""""
pass
! def IsShownWindow(self):
""""""
pass
--- 106,149 ----
def Hide(self):
! """Do not use. Instead, use HideSizer or HideWindow."""
pass
! def HideSizer(self, sizer):
""""""
pass
! def HideWindow(self, window):
""""""
pass
def Insert(self):
! """Do not use. Instead, use InsertSizer, InsertSpacer, or
! InsertWindow."""
pass
! def InsertSizer(self, before, sizer, option=0, flag=0, border=0,
! userData=wx.NULL):
""""""
pass
! def InsertSpacer(self, before, width, height, option=0, flag=0,
! border=0, userData=wx.NULL):
""""""
pass
! def InsertWindow(self, before, window, option=0, flag=0, border=0,
! userData=wx.NULL):
""""""
pass
def IsShown(self):
! """Do not use. Instead, use IsShownSizer or IsShowWindow."""
pass
! def IsShownSizer(self, sizer):
""""""
pass
! def IsShownWindow(self, window):
""""""
pass
***************
*** 133,220 ****
def Prepend(self):
! """"""
pass
! def PrependSizer(self):
""""""
pass
! def PrependSpacer(self):
""""""
pass
! def PrependWindow(self):
""""""
pass
def Remove(self):
! """"""
pass
! def RemovePos(self):
""""""
pass
! def RemoveSizer(self):
""""""
pass
! def RemoveWindow(self):
""""""
pass
! def SetDimension(self):
""""""
pass
def SetItemMinSize(self):
! """"""
pass
! def SetItemMinSizePos(self):
""""""
pass
! def SetItemMinSizeSizer(self):
""""""
pass
! def SetItemMinSizeWindow(self):
""""""
pass
! def SetMinSize(self):
""""""
pass
! def SetSizeHints(self):
""""""
pass
! def SetVirtualSizeHints(self):
""""""
pass
def Show(self):
! """"""
pass
! def ShowItems(self):
""""""
pass
! def ShowSizer(self):
""""""
pass
! def ShowWindow(self):
""""""
pass
- def __init__(self):
- """"""
- pass
! def _setOORInfo(self):
""""""
pass
--- 154,248 ----
def Prepend(self):
! """Do not use. Instead, use PrependSizer, PrependSpacer, or
! PrependWindow."""
pass
! def PrependSizer(self, sizer, option=0, flag=0, border=0,
! userData=wx.NULL):
""""""
pass
! def PrependSpacer(self, width, height, option=0, flag=0, border=0,
! userData=wx.NULL):
""""""
pass
! def PrependWindow(self, window, option=0, flag=0, border=0,
! userData=wx.NULL):
""""""
pass
def Remove(self):
! """Do not use. Instead, use RemovePos, RemoveSizer, or
! RemoveWindow."""
pass
! def RemovePos(self, pos):
""""""
pass
! def RemoveSizer(self, sizer):
""""""
pass
! def RemoveWindow(self, window):
""""""
pass
! def SetDimension(self, x, y, width, height):
""""""
pass
def SetItemMinSize(self):
! """Do not use. Instead, use SetItemMinSizePos,
! SetItemMinSizeSizer, or SetItemMinSizeWindow."""
pass
! def SetItemMinSizePos(self, pos, width, height):
""""""
pass
! def SetItemMinSizeSizer(self, sizer, width, height):
""""""
pass
! def SetItemMinSizeWindow(self, window, width, height):
""""""
pass
! def SetMinSize(self, size):
""""""
pass
! def SetSizeHints(self, window):
""""""
pass
! def SetVirtualSizeHints(self, window):
""""""
pass
def Show(self):
! """Do not use. Instead, use ShowItems, ShowSizer, or
! ShowWindow."""
pass
! def ShowItems(self, show):
""""""
pass
! def ShowSizer(self, sizer, show=True):
""""""
pass
! def ShowWindow(self, window, show=True):
""""""
pass
! class PySizer(Sizer):
! """"""
!
! def __init__(self):
""""""
pass
***************
*** 224,227 ****
--- 252,260 ----
""""""
+ def __init__(self, this):
+ """Create a SizerItem instance. You don't normally create one
+ directly."""
+ pass
+
def CalcMin(self):
""""""
***************
*** 261,265 ****
def GetUserData(self):
! """"""
pass
--- 294,298 ----
def GetUserData(self):
! """Return a wx.PyUserData object."""
pass
***************
*** 284,332 ****
pass
! def SetBorder(self):
! """"""
! pass
!
! def SetDimension(self):
""""""
pass
! def SetFlag(self):
""""""
pass
! def SetInitSize(self):
""""""
pass
! def SetOption(self):
""""""
pass
! def SetRatio(self):
""""""
pass
! def SetRatioSize(self):
""""""
pass
! def SetRatioWH(self):
""""""
pass
! def SetSizer(self):
""""""
pass
! def SetWindow(self):
""""""
pass
! def Show(self):
""""""
pass
! def __init__(self):
""""""
pass
--- 317,361 ----
pass
! def SetBorder(self, border):
""""""
pass
! def SetDimension(self, pos, size):
""""""
pass
! def SetFlag(self, flag):
""""""
pass
! def SetInitSize(self, x, y):
""""""
pass
! def SetOption(self, option):
""""""
pass
! def SetRatio(self, ratio):
""""""
pass
! def SetRatioSize(self, size):
""""""
pass
! def SetRatioWH(self, width, height):
""""""
pass
! def SetSizer(self, sizer):
""""""
pass
! def SetWindow(self, window):
""""""
pass
! def Show(self, show):
""""""
pass
***************
*** 336,356 ****
""""""
! def CalcMin(self):
""""""
pass
! def GetOrientation(self):
""""""
pass
! def RecalcSizes(self):
""""""
pass
! def SetOrientation(self):
""""""
pass
! def __init__(self):
""""""
pass
--- 365,385 ----
""""""
! def __init__(self, orient=wx.HORIZONTAL):
""""""
pass
! def CalcMin(self):
""""""
pass
! def GetOrientation(self):
""""""
pass
! def RecalcSizes(self):
""""""
pass
! def SetOrientation(self, orient):
""""""
pass
***************
*** 360,363 ****
--- 389,396 ----
""""""
+ def __init__(self, rows=1, cols=0, vgap=0, hgap=0):
+ """"""
+ pass
+
def CalcMin(self):
""""""
***************
*** 384,404 ****
pass
! def SetCols(self):
! """"""
! pass
!
! def SetHGap(self):
""""""
pass
! def SetRows(self):
""""""
pass
! def SetVGap(self):
""""""
pass
! def __init__(self):
""""""
pass
--- 417,433 ----
pass
! def SetCols(self, cols):
""""""
pass
! def SetHGap(self, gap):
""""""
pass
! def SetRows(self, rows):
""""""
pass
! def SetVGap(self, gap):
""""""
pass
***************
*** 408,436 ****
""""""
! def AddGrowableCol(self):
""""""
pass
! def AddGrowableRow(self):
""""""
pass
! def CalcMin(self):
""""""
pass
! def RecalcSizes(self):
""""""
pass
! def RemoveGrowableCol(self):
""""""
pass
! def RemoveGrowableRow(self):
""""""
pass
! def __init__(self):
""""""
pass
--- 437,465 ----
""""""
! def __init__(self, rows=1, cols=0, vgap=0, hgap=0):
""""""
pass
! def AddGrowableCol(self, idx):
""""""
pass
! def AddGrowableRow(self, idx):
""""""
pass
! def CalcMin(self):
""""""
pass
! def RecalcSizes(self):
""""""
pass
! def RemoveGrowableCol(self, idx):
""""""
pass
! def RemoveGrowableRow(self, idx):
""""""
pass
***************
*** 440,475 ****
""""""
! def CalcMin(self):
""""""
pass
! def GetNotebook(self):
""""""
pass
! def RecalcSizes(self):
""""""
pass
! def __init__(self):
""""""
pass
! class PySizer(Sizer):
""""""
! def __init__(self):
! """"""
! pass
!
! def _setCallbackInfo(self):
""""""
pass
-
- class StaticBoxSizer(BoxSizer):
- """"""
-
def CalcMin(self):
""""""
--- 469,496 ----
""""""
! def __init__(self, nb):
""""""
pass
! def CalcMin(self):
""""""
pass
! def GetNotebook(self):
""""""
pass
! def RecalcSizes(self):
""""""
pass
! class StaticBoxSizer(BoxSizer):
""""""
! def __init__(self, box, orient=wx.HORIZONTAL):
""""""
pass
def CalcMin(self):
""""""
***************
*** 481,488 ****
def RecalcSizes(self):
- """"""
- pass
-
- def __init__(self):
""""""
pass
--- 502,505 ----
|
|
From: <po...@us...> - 2003-03-22 20:18:37
|
Update of /cvsroot/pycrust/PyCrust/wxd
In directory sc8-pr-cvs1:/tmp/cvs-serv7405
Modified Files:
Parameters.py
Log Message:
New param
Index: Parameters.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/wxd/Parameters.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Parameters.py 18 Mar 2003 04:25:04 -0000 1.5
--- Parameters.py 22 Mar 2003 20:18:34 -0000 1.6
***************
*** 37,40 ****
--- 37,41 ----
'EmptyString',
'EVT_NULL',
+ 'HORIZONTAL',
'HSCROLL',
'NO_BORDER',
|
|
From: <po...@us...> - 2003-03-22 16:03:50
|
Update of /cvsroot/pycrust/PyCrust/wxd In directory sc8-pr-cvs1:/tmp/cvs-serv21211 Modified Files: wxPython.txt Log Message: Rearranged the order of stuff. Index: wxPython.txt =================================================================== RCS file: /cvsroot/pycrust/PyCrust/wxd/wxPython.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxPython.txt 22 Mar 2003 15:58:49 -0000 1.1 --- wxPython.txt 22 Mar 2003 16:03:47 -0000 1.2 *************** *** 34,61 **** ! Source Document ! =============== ! The source document is named wxPython.txt and is located in the ! PyCrust/wxd directory. It is written using a fantastic formatting ! convention called reStructuredText. The wxPython.html file is created ! using the Docutils utilities, which can turn reStructuredText ! documents into html, xml, pdf, and even OpenOffice files. ! Some items in the source text file look like this:: ! .. This is text from the wxWindows documentation that needs to be ! translated into something appropriate for the wxPython version. ! The two dots followed by uniformly indented text turns this ! paragraph into a reStructuredText comment, so it doesn't appear ! in any output file, such as the html file. ! They have been commented out and are awaiting editorial review and a ! rewrite so that they make sense in the context of wxPython. Feel free ! to send me suggestions for rewording these, or any other parts of this ! document that you think need improving. I will be eternally grateful ! to you and will show my gratitude by adding your name to the list of ! contributors. (Contributors who also send me gifts of coffee, ! chocolate, or currency will have their names listed in bold.) --- 34,85 ---- ! What is wxPython? ! ================= ! wxPython is a GUI toolkit for the Python programming language. It ! allows Python programmers to create programs with a robust, highly ! functional graphical user interface, simply and easily. It is ! implemented as a Python extension module (native code) that wraps the ! popular wxWindows cross platform GUI library, which is written in C++. ! Like Python and wxWindows, wxPython is Open Source, which means that ! it is free for anyone to use and the source code is available for ! anyone to look at and modify. And anyone can contribute fixes or ! enhnacments to the project. ! wxPython is a cross-platform toolkit. This means that the same ! program will run on multiple platforms without modification. ! Currently supported platforms are 32-bit Microsoft Windows, most Unix ! or unix-like systems, and Macintosh OS X. ! Since the language is Python, wxPython programs are simple, easy to ! write and easy to understand. ! ! ! wxPython requirements ! ===================== ! ! To make use of wxPython, you currently need one of the following ! setups. ! ! MS-Windows ! ---------- ! ! * A 486 or higher PC running MS Windows. ! * At least ?? MB of disk space. ! ! Linux or Unix ! ------------- ! ! * Almost any C++ compiler, including GNU C++ (EGCS 1.1.1 or above). ! * Almost any Unix workstation, and one of: GTK+ 1.2, GTK+ 2.0, Motif ! 1.2 or higher, Lesstif. ! * At least ?? MB of disk space. ! ! Mac OS X ! -------- ! ! * A PowerPC Mac running Mac OS X 10.x. ! * At least ?? MB of disk space. *************** *** 111,115 **** toolkits such as Motif, GTK+ and MFC. - The importance of using a platform-independent class library cannot be overstated, since GUI application development is very time-consuming, --- 135,138 ---- *************** *** 160,213 **** - What is wxPython? - ================= - - wxPython is a GUI toolkit for the Python programming language. It - allows Python programmers to create programs with a robust, highly - functional graphical user interface, simply and easily. It is - implemented as a Python extension module (native code) that wraps the - popular wxWindows cross platform GUI library, which is written in C++. - - Like Python and wxWindows, wxPython is Open Source, which means that - it is free for anyone to use and the source code is available for - anyone to look at and modify. And anyone can contribute fixes or - enhnacments to the project. - - wxPython is a cross-platform toolkit. This means that the same - program will run on multiple platforms without modification. - Currently supported platforms are 32-bit Microsoft Windows, most Unix - or unix-like systems, and Macintosh OS X. - - Since the language is Python, wxPython programs are simple, easy to - write and easy to understand. - - - wxPython requirements - ===================== - - To make use of wxPython, you currently need one of the following - setups. - - MS-Windows - ---------- - - * A 486 or higher PC running MS Windows. - * At least ?? MB of disk space. - - Linux or Unix - ------------- - - * Almost any C++ compiler, including GNU C++ (EGCS 1.1.1 or above). - * Almost any Unix workstation, and one of: GTK+ 1.2, GTK+ 2.0, Motif - 1.2 or higher, Lesstif. - * At least ?? MB of disk space. - - Mac OS X - -------- - - * A PowerPC Mac running Mac OS X 10.x. - * At least ?? MB of disk space. - - wxPython Overview ================= --- 183,186 ---- *************** *** 926,929 **** --- 899,928 ---- Not done yet. + + + Source Document + =============== + + The source document is named wxPython.txt and is located in the + PyCrust/wxd directory. It is written using a fantastic formatting + convention called reStructuredText. The wxPython.html file is created + using the Docutils utilities, which can turn reStructuredText + documents into html, xml, pdf, and even OpenOffice files. + + Some items in the source text file look like this:: + + .. This is text from the wxWindows documentation that needs to be + translated into something appropriate for the wxPython version. + The two dots followed by uniformly indented text turns this + paragraph into a reStructuredText comment, so it doesn't appear + in any output file, such as the html file. + + They have been commented out and are awaiting editorial review and a + rewrite so that they make sense in the context of wxPython. Feel free + to send me suggestions for rewording these, or any other parts of this + document that you think need improving. I will be eternally grateful + to you and will show my gratitude by adding your name to the list of + contributors. (Contributors who also send me gifts of coffee, + chocolate, or currency will have their names listed in bold.) |