__version__ = "$Revision$"[11:-2]
from wxPython.wx import *
-from PyCrust.crust import CrustFrame
+from crust import CrustFrame
class App(wxApp):
"""PyCrust standalone application."""
-
+
def OnInit(self):
locals = {'__app__': 'PyCrust Standalone Application'}
- self.crustFrame = CrustFrame(locals=locals)
+ self.crustFrame = CrustFrame(locals=locals, size=(800,600))
self.crustFrame.Show(true)
self.SetTopWindow(self.crustFrame)
# Add the application object to the sys module's namespace.
if __name__ == '__main__':
main()
-
+
# We use this object to get more introspection when run standalone.
application = None
-from PyCrust import filling
+import filling
# These are imported just to have something interesting to inspect.
-from PyCrust import crust
-from PyCrust import interpreter
-from PyCrust import introspect
-from PyCrust import pseudo
-from PyCrust import shell
+import crust
+import interpreter
+import introspect
+import pseudo
+import shell
import sys
from wxPython import wx
if __name__ == '__main__':
main()
-
\ No newline at end of file
+
__version__ = "$Revision$"[11:-2]
from wxPython.wx import *
-from PyCrust.shell import ShellFrame
+from shell import ShellFrame
class App(wxApp):
"""PyShell standalone application."""
-
+
def OnInit(self):
locals = {'__app__': 'PyShell Standalone Application'}
- self.shellFrame = ShellFrame(locals=locals)
+ self.shellFrame = ShellFrame(locals=locals, size=(800,600))
self.shellFrame.Show(true)
self.SetTopWindow(self.shellFrame)
# Add the application object to the sys module's namespace.
if __name__ == '__main__':
main()
-
-
\ No newline at end of file
+
+
"""Create a PyCrust CrustFrame instance."""
wxFrame.__init__(self, parent, id, title, pos, size, style)
intro = 'Welcome To PyCrust %s - The Flakiest Python Shell' % VERSION
- intro += '\nSponsored by Orbtech.com \96 Your Source For Python Development Services'
+ intro += '\nSponsored by Orbtech.com - Your Source For Python Development Services'
self.CreateStatusBar()
- self.SetStatusText(intro)
+ self.SetStatusText(intro.replace('\n', ', '))
if wxPlatform == '__WXMSW__':
import os
filename = os.path.join(os.path.dirname(__file__), 'PyCrust.ico')
dropSelf = 1
elif inspect.isclass(object):
# Get the __init__ method function for the class.
- try:
- object = object.__init__.im_func
+ constructor = getConstructor(object)
+ if constructor is not None:
+ object = constructor
dropSelf = 1
- except AttributeError:
- for base in object.__bases__:
- constructor = _find_constructor(base)
- if constructor is not None:
- object = constructor
- dropSelf = 1
- break
name = object.__name__
tip1 = ''
if inspect.isbuiltin(object):
else:
return ''
+def getConstructor(object):
+ """Return constructor for class object, or None if there isn't one."""
+ try:
+ return object.__init__.im_func
+ except AttributeError:
+ for base in object.__bases__:
+ constructor = getConstructor(base)
+ if constructor is not None:
+ return constructor
+ return None
+
def getRoot(command, terminator=None):
"""Return the rightmost root portion of an arbitrary Python command.
return root
-
\ No newline at end of file
+
"""The PyCrust Shell is an interactive text control in which a user types in
commands to be sent to the interpreter. This particular shell is based on
wxPython's wxStyledTextCtrl. The latest files are always available at the
-SourceForge project page at http://sourceforge.net/projects/pycrust/."""
+SourceForge project page at http://sourceforge.net/projects/pycrust/.
+Sponsored by Orbtech.com - Your Source For Python Development Services"""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id$"
data = wxTextDataObject()
if wxTheClipboard.GetData(data):
command = data.GetText()
+ command = command.rstrip()
command = self.fixLineEndings(command)
command = self.lstripPrompt(text=command)
command = command.replace(os.linesep + sys.ps2, '\n')
"""Create a PyCrust ShellFrame instance."""
wxFrame.__init__(self, parent, id, title, pos, size, style)
intro = 'Welcome To PyCrust %s - The Flakiest Python Shell' % VERSION
- intro += '\nSponsored by Orbtech.com \96 Your Source For Python Development Services'
+ intro += '\nSponsored by Orbtech.com - Your Source For Python Development Services'
self.CreateStatusBar()
- self.SetStatusText(intro)
+ self.SetStatusText(intro.replace('\n', ', '))
if wxPlatform == '__WXMSW__':
import os
filename = os.path.join(os.path.dirname(__file__), 'PyCrust.ico')