]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wxPython/lib/pyshell.py
Put a backslash before a '_'
[wxWidgets.git] / wxPython / wxPython / lib / pyshell.py
index 4df731fd46ab428eab91e8fdf75ce8f7971ed1f9..7457f3c830eb1a3120ceca9b384e29968b0f799b 100644 (file)
@@ -20,6 +20,10 @@ There is still much to be done to improve this class, such as line
 buffering/recall, autoindent, calltips, autocomplete, fixing the colourizer,
 etc...  But it's a good start.
 
+
+8-10-2001         THIS MODULE IS NOW DEPRECATED.  Please see the most excellent
+                  PyCrust package instead.
+
 """
 
 
@@ -95,9 +99,10 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
 
         # copyright/banner message
         if banner is None:
-            self.write("Python %s on %s\n%s\n(%s)\n" %
-                       (sys.version, sys.platform, sys.copyright,
-                        self.__class__.__name__))
+            self.write("Python %s on %s\n" % #%s\n(%s)\n" %
+                       (sys.version, sys.platform,
+                        #sys.copyright, self.__class__.__name__
+                        ))
         else:
             self.write("%s\n" % banner)
 
@@ -143,17 +148,17 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
 
         self.StyleSetSpec(wxSTC_STYLE_BRACELIGHT, p['bracegood'])
         self.StyleSetSpec(wxSTC_STYLE_BRACEBAD, p['bracebad'])
-        self.StyleSetSpec(SCE_P_COMMENTLINE, p['comment'])
-        self.StyleSetSpec(SCE_P_NUMBER, p['number'])
-        self.StyleSetSpec(SCE_P_STRING, p['string'])
-        self.StyleSetSpec(SCE_P_CHARACTER, p['char'])
-        self.StyleSetSpec(SCE_P_WORD, p['keyword'])
-        self.StyleSetSpec(SCE_P_TRIPLE, p['triple'])
-        self.StyleSetSpec(SCE_P_TRIPLEDOUBLE, p['tripledouble'])
-        self.StyleSetSpec(SCE_P_CLASSNAME, p['class'])
-        self.StyleSetSpec(SCE_P_DEFNAME, p['def'])
-        self.StyleSetSpec(SCE_P_OPERATOR, p['operator'])
-        self.StyleSetSpec(SCE_P_COMMENTBLOCK, p['comment'])
+        self.StyleSetSpec(wxSTC_P_COMMENTLINE, p['comment'])
+        self.StyleSetSpec(wxSTC_P_NUMBER, p['number'])
+        self.StyleSetSpec(wxSTC_P_STRING, p['string'])
+        self.StyleSetSpec(wxSTC_P_CHARACTER, p['char'])
+        self.StyleSetSpec(wxSTC_P_WORD, p['keyword'])
+        self.StyleSetSpec(wxSTC_P_TRIPLE, p['triple'])
+        self.StyleSetSpec(wxSTC_P_TRIPLEDOUBLE, p['tripledouble'])
+        self.StyleSetSpec(wxSTC_P_CLASSNAME, p['class'])
+        self.StyleSetSpec(wxSTC_P_DEFNAME, p['def'])
+        self.StyleSetSpec(wxSTC_P_OPERATOR, p['operator'])
+        self.StyleSetSpec(wxSTC_P_COMMENTBLOCK, p['comment'])
 
 
     # used for writing to stdout, etc.
@@ -162,7 +167,7 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
         pos = self.GetCurrentPos()
         self.AddText(text)
         self.StartStyling(pos, 0xFF)
-        self.SetStyleFor(len(text), style)
+        self.SetStyling(len(text), style)
         self.EnsureCaretVisible()
         wxYield()
 
@@ -174,7 +179,7 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
 
     def Prompt(self):
         # is the current line non-empty?
-        text, pos = self.GetCurrentLineText()
+        text, pos = self.GetCurLine()
         if pos != 0:
             self.AddText('\n')
         self.AddText(self.props['ps1'])
@@ -198,7 +203,7 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
 
             # if not on the last line, duplicate the current line
             if self.GetLineCount()-1 !=  self.GetCurrentLine():
-                text, col = self.GetCurrentLineText()
+                text, col = self.GetCurLine()
                 prompt = self.props['ps1']
                 lp = len(prompt)
                 if text[:lp] == prompt:
@@ -251,14 +256,14 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
             styleBefore = self.GetStyleAt(caretPos - 1)
 
         # check before
-        if charBefore and charBefore in "[]{}()" and ord(styleBefore) == SCE_P_OPERATOR:
+        if charBefore and chr(charBefore) in "[]{}()" and styleBefore == wxSTC_P_OPERATOR:
             braceAtCaret = caretPos - 1
 
         # check after
         if braceAtCaret < 0:
             charAfter = self.GetCharAt(caretPos)
             styleAfter = self.GetStyleAt(caretPos)
-            if charAfter and charAfter in "[]{}()" and ord(styleAfter) == SCE_P_OPERATOR:
+            if charAfter and chr(charAfter) in "[]{}()" and styleAfter == wxSTC_P_OPERATOR:
                 braceAtCaret = caretPos
 
         if braceAtCaret >= 0: