]> git.saurik.com Git - wxWidgets.git/commitdiff
PyCrust updates
authorRobin Dunn <robin@alldunn.com>
Mon, 10 Dec 2001 22:45:02 +0000 (22:45 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 10 Dec 2001 22:45:02 +0000 (22:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wxPython/lib/PyCrust/PyCrustApp.py
wxPython/wxPython/lib/PyCrust/PyFillingApp.py
wxPython/wxPython/lib/PyCrust/PyShellApp.py
wxPython/wxPython/lib/PyCrust/crust.py
wxPython/wxPython/lib/PyCrust/introspect.py
wxPython/wxPython/lib/PyCrust/shell.py

index 135b86a116c8ff66b4a09d1a45829f9bc518f1e9..1dcb1a668cb71f5c43fb9ccc743f369f57ffe439 100755 (executable)
@@ -6,15 +6,15 @@ __cvsid__ = "$Id$"
 __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.
@@ -33,4 +33,4 @@ def main():
 if __name__ == '__main__':
     main()
 
+
index 62cea73e1c821a1593cb5a013c39d929d9550e07..61d3db5cb0978554fa08eef64cade5729bf87519 100755 (executable)
@@ -8,14 +8,14 @@ __version__ = "$Revision$"[11:-2]
 # 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
 
@@ -32,4 +32,4 @@ def main():
 if __name__ == '__main__':
     main()
 
\ No newline at end of file
+
index 9b3f945fa87fb035c6ef5c3b2b9dcd4b8e24e0f0..b0a5af63c6b386b7497f10d831e4e668d1efe7e0 100755 (executable)
@@ -6,15 +6,15 @@ __cvsid__ = "$Id$"
 __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.
@@ -33,5 +33,5 @@ def main():
 if __name__ == '__main__':
     main()
 
\ No newline at end of file
+
+
index a97ac7fba7e5fdc0838ae1ebd7d19200cfe10070..5bb78f3d9489a2281f6efbb6efeaac0afc89cf0e 100644 (file)
@@ -52,9 +52,9 @@ class CrustFrame(wxFrame, ShellMenu):
         """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')
index 4139ec66c892465c8833a6840479751e2391abad..237ed198e501ac48ec2c904b1bb5d6d50032688d 100644 (file)
@@ -87,16 +87,10 @@ def getCallTip(command='', locals=None):
             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):
@@ -131,6 +125,17 @@ def getCallTip(command='', locals=None):
     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.
     
@@ -167,4 +172,4 @@ def getRoot(command, terminator=None):
     return root
 
      
\ No newline at end of file
index 8fe9f1caa0c5a006aa36396d355db842ec89f1aa..02744d9e3b522a0ac4bee1232d13c2acd18c0d2a 100644 (file)
@@ -1,7 +1,8 @@
 """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$"
@@ -782,6 +783,7 @@ class Shell(wxStyledTextCtrl):
                     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')
@@ -984,9 +986,9 @@ class ShellFrame(wxFrame, ShellMenu):
         """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')